From 119689ea696c0ac5978c830a35088845fa41c8bb Mon Sep 17 00:00:00 2001 From: Paul Tunison Date: Fri, 15 Nov 2024 11:29:39 -0500 Subject: [PATCH] Add learning rate monitor, save 10 best epoch models --- configs/callbacks/default.yaml | 4 ++-- configs/callbacks/learning_rate_monitor.yaml | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 configs/callbacks/learning_rate_monitor.yaml diff --git a/configs/callbacks/default.yaml b/configs/callbacks/default.yaml index 094adefaf..140ce14cf 100644 --- a/configs/callbacks/default.yaml +++ b/configs/callbacks/default.yaml @@ -3,6 +3,7 @@ defaults: - early_stopping - model_summary - rich_progress_bar + - learning_rate_monitor - plot_metrics - _self_ @@ -11,11 +12,10 @@ defaults: model_checkpoint: dirpath: ${paths.output_dir}/checkpoints filename: "epoch_{epoch:03d}" - # monitor: "val/loss" - # mode: "min" monitor: "val/f1" mode: "max" save_last: True + save_top_k: 10 # save k best models (determined by above metric) auto_insert_metric_name: False early_stopping: diff --git a/configs/callbacks/learning_rate_monitor.yaml b/configs/callbacks/learning_rate_monitor.yaml new file mode 100644 index 000000000..9347987d6 --- /dev/null +++ b/configs/callbacks/learning_rate_monitor.yaml @@ -0,0 +1,4 @@ +learning_rate_monitor: + _target_: pytorch_lightning.callbacks.LearningRateMonitor + logging_interval: epoch + log_momentum: false