Lightning-AI / Lightning-AI/pytorch-lightning

ModelCheckpoint need monitor average loss

Open
#20,652 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

callback: model checkpoint feature
Dominant language
Python
Stars
31.4k
Forks
3.8k
Avg merge
6d 7h
Merged PRs (30d)
6

Description

### Description & Motivation

I know ModelCheckpoint can monitor like "train_loss" , "val_loss" , when the value is min and "every_n_train_steps" is true. but I want to cache "train_loss" or "val_loss" from "every_n_train_steps" to next "every_n_train_steps" ,when cache loss is lower than before, then save model.
Example:
every_n_train_steps = 50, monitor = "train_loss"

from step=50 to step=100, if average "train_loss" is lower than step=[0,50] then save model

### Pitch

_No response_

### Alternatives

_No response_

### Additional context

_No response_

cc @lantiga @borda

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ModelCheckpoint entry point and review how monitor and every_n_train_steps are currently handled. Clarify the intended train_loss or val_loss averaging window and comparison baseline, then identify the relevant checkpoint tests or add coverage showing when a model should be saved.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.