Skip to content

Commit 8723b6e

Browse files
authored
Merge pull request #17 from ChEB-AI/feature/early_stopping
Add Early Stopping feature
2 parents 9e5a827 + f453fb1 commit 8723b6e

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,4 +160,4 @@ cython_debug/
160160
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
161161
#.idea/
162162

163-
configs/
163+
# configs/ # commented as new configs can be added as a part of a feature
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
min_epochs: 100
1+
# min_epochs: 100
22
max_epochs: 100
33
default_root_dir: &default_root_dir logs
4-
logger: wandb_logger.yml
4+
logger: csv_logger.yml
55
callbacks: default_callbacks.yml
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
- class_path: chebai.callbacks.model_checkpoint.CustomModelCheckpoint
2+
init_args:
3+
monitor: val_micro-f1
4+
mode: 'max'
5+
filename: 'best_{epoch:02d}_{val_loss:.4f}_{val_macro-f1:.4f}_{val_micro-f1:.4f}'
6+
every_n_epochs: 1
7+
save_top_k: 5
8+
- class_path: chebai.callbacks.model_checkpoint.CustomModelCheckpoint
9+
init_args:
10+
filename: 'per_{epoch:02d}_{val_loss:.4f}_{val_macro-f1:.4f}_{val_micro-f1:.4f}'
11+
every_n_epochs: 5
12+
save_top_k: -1
13+
- class_path: lightning.pytorch.callbacks.early_stopping.EarlyStopping
14+
init_args:
15+
monitor: "val_loss_epoch"
16+
min_delta: 0.0
17+
patience: 3
18+
verbose: False
19+
mode: "min"

0 commit comments

Comments
 (0)