mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-09 11:32:07 +08:00
fix for #2051, always init with -inf
The comparison `self.monitor_op == torch.gt` was always false, compare with mode instead for #2051
This commit is contained in:
@@ -75,7 +75,7 @@ class EarlyStopping(Callback):
|
||||
if self.verbose > 0:
|
||||
log.info(f'EarlyStopping mode set to {self.mode} for monitoring {self.monitor}.')
|
||||
|
||||
self.min_delta *= 1 if self.monitor_op == torch.gt else -1
|
||||
self.min_delta *= 1 if self.mode == 'min' else -1
|
||||
|
||||
def _validate_condition_metric(self, logs):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user