556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
|
});
} else {
return Err(Error::NoMinorant);
}
}
self.cur_valid = true;
self.master.set_weight(1.0);
let state = current_state!(self, Step::Term);
let new_weight = self.weighter.weight(&state, &self.params);
self.master.set_weight(new_weight);
debug!("Init master completed");
Ok(())
|
>
>
>
>
>
>
>
>
>
>
>
>
|
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
|
});
} else {
return Err(Error::NoMinorant);
}
}
self.cur_valid = true;
// Solve the master problem once to compute the initial
// subgradient.
//
// We could compute that subgradient directly by
// adding up the initial minorants, but this would not include
// the eta terms. However, this is a heuristic anyway because
// we assume an initial weight of 1.0, which, in general, will
// *not* be the initial weight for the first iteration.
self.master.set_weight(1.0);
try!(self.master.solve(self.cur_val));
self.sgnorm = self.master.get_dualoptnorm2().sqrt();
// Compute the real initial weight.
let state = current_state!(self, Step::Term);
let new_weight = self.weighter.weight(&state, &self.params);
self.master.set_weight(new_weight);
debug!("Init master completed");
Ok(())
|