瀏覽代碼

More informative `EarlyStopping()` message (#5303)

modifyDataloader
Glenn Jocher GitHub 3 年之前
父節點
當前提交
441b47c443
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: 4AEE18F83AFDEB23
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. +4
    -1
      utils/torch_utils.py

+ 4
- 1
utils/torch_utils.py 查看文件

@@ -299,7 +299,10 @@ class EarlyStopping:
self.possible_stop = delta >= (self.patience - 1) # possible stop may occur next epoch
stop = delta >= self.patience # stop training if patience exceeded
if stop:
LOGGER.info(f'EarlyStopping patience {self.patience} exceeded, stopping training.')
LOGGER.info(f'Stopping training early as no improvement observed in last {self.patience} epochs. '
f'Best results observed at epoch {self.best_epoch}, best model saved as best.pt.\n'
f'To update EarlyStopping(patience={self.patience}) pass a new patience value, '
f'i.e. `python train.py --patience 300` or use `--patience 0` to disable EarlyStopping.')
return stop



Loading…
取消
儲存