Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
- fix #123
Browse files Browse the repository at this point in the history
  • Loading branch information
nasimrahaman committed Jun 30, 2018
1 parent e22deee commit df0d1a4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions inferno/trainers/callbacks/essentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,14 @@ def end_of_validation_run(self, **_):
if self._ema_validation_score is None:
self._ema_validation_score = current_validation_score
self._best_ema_validation_score = current_validation_score
# If no previous score is known, assume this is the best score and save
self.trainer._is_iteration_with_best_validation_score = True
else:
self._ema_validation_score = self.smoothness * self._ema_validation_score + \
(1 - self.smoothness) * current_validation_score
# This overrides the default behaviour, but reduces to it if smoothness = 0
self.trainer._is_iteration_with_best_validation_score = \
self._ema_validation_score < self._best_ema_validation_score
# This overrides the default behaviour, but reduces to it if smoothness = 0
self.trainer._is_iteration_with_best_validation_score = \
self._ema_validation_score < self._best_ema_validation_score
# Trigger a save
if self.trainer._is_iteration_with_best_validation_score:
if self.verbose:
Expand Down

0 comments on commit df0d1a4

Please sign in to comment.