self.trainer_state_min_cost = self.trainer_state_previous
self.save_model()
else:
self.network_state_previous = self.network.get_state()
self.trainer_state_previous = self.get_state()
if (self.options["wait_improvement"] >= 0) and \
(validations_since_best > self.options["wait_improvement"]):
logging.debug("%d validations since the minimum perplexity was "
After Change
if validations_since_best == 0:
// At least three validations have been performed and this is the
// minimum cost so far.
assert not self.previous_state is None
// The minimum cost is from the three previous validations.
// Previous validation is in the middle of those validations.
self._set_min_cost_state(self.previous_state)