Skip to content

Update model checkpointing metric and periodic checkpointing #182

Description

@aditya0by0

Question

Currently, the best model is selected based on val_micro-f1. Shouldn't the best model instead be selected based on val_macro-f1?

- class_path: chebai.callbacks.model_checkpoint.CustomModelCheckpoint
init_args:
monitor: val_micro-f1
mode: 'max'
filename: 'best_micro_f1_{epoch:02d}_{val_loss:.4f}_{val_macro-f1:.4f}_{val_micro-f1:.4f}'
every_n_epochs: 1
save_top_k: 3
- class_path: chebai.callbacks.model_checkpoint.CustomModelCheckpoint
init_args:
filename: 'per_{epoch:02d}_{val_loss:.4f}_{val_macro-f1:.4f}_{val_micro-f1:.4f}'
every_n_epochs: 25
save_top_k: -1

cc: @sfluegel05

Changes requested

  • Change the best-model monitoring metric from val_micro-f1 to val_macro-f1, if this is the intended evaluation metric.
  • Save periodic checkpoints every 50 epochs.
  • Ensure a checkpoint is also saved at the last/final epoch, even when the final epoch is not a multiple of 50.
  • Keep all periodic checkpoints (save_top_k: -1).

Expected behavior

The checkpointing should:

  1. Select the top 3 best models based on val_macro-f1.

  2. Save periodic checkpoints at:

    • Epoch 50
    • Epoch 100
    • Epoch 150
    • etc.
  3. Always save a checkpoint at the final epoch.

Acceptance criteria

  • Confirm whether val_macro-f1 should be used instead of val_micro-f1 for selecting the best model.
  • If confirmed, change monitor to val_macro-f1.
  • Keep mode: max.
  • Change periodic checkpointing from every 25 epochs to every 50 epochs.
  • Ensure the final epoch is always saved.
  • Keep val_loss, val_macro-f1, and val_micro-f1 in the checkpoint filename.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions