Skip to content

Commit

Permalink
Update early_stopping.py
Browse files Browse the repository at this point in the history
  • Loading branch information
williamFalcon authored and Borda committed May 25, 2020
1 parent 0a954a3 commit 1680c88
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pytorch_lightning/callbacks/early_stopping.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ def on_train_start(self, trainer, pl_module):
self.best = torch_inf if self.monitor_op == torch.lt else -torch_inf

def on_validation_end(self, trainer, pl_module):
self._run_early_stopping_check(trainer, pl_module)

def _run_early_stopping_check(self, trainer, pl_module):
logs = trainer.callback_metrics
stop_training = False
if not self._validate_condition_metric(logs):
Expand Down

0 comments on commit 1680c88

Please sign in to comment.