From cc1282f5b8342a190d329a5b7747b218e9a0a3aa Mon Sep 17 00:00:00 2001 From: GabrielCabas <38341255+GabrielCabas@users.noreply.github.com> Date: Tue, 21 Jan 2025 16:42:12 -0300 Subject: [PATCH] Update core_utils.py The early stopping isn't working. It's because it is an and instead an or in the line 78. --- utils/core_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/core_utils.py b/utils/core_utils.py index 6fa925b5..0841ecdc 100755 --- a/utils/core_utils.py +++ b/utils/core_utils.py @@ -75,7 +75,7 @@ def __call__(self, epoch, val_loss, model, ckpt_name = 'checkpoint.pt'): elif score < self.best_score: self.counter += 1 print(f'EarlyStopping counter: {self.counter} out of {self.patience}') - if self.counter >= self.patience and epoch > self.stop_epoch: + if self.counter >= self.patience or epoch > self.stop_epoch: self.early_stop = True else: self.best_score = score