Skip to content

Commit ab7b299

Browse files
authored
Model checkpointing save_on_train_epoch_end default behavior documentation (#20931)
* default behavior * clarify some docs
1 parent 460c60c commit ab7b299

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/lightning/pytorch/callbacks/model_checkpoint.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,15 @@ class ModelCheckpoint(Checkpoint):
133133
will only save checkpoints at epochs 0 < E <= N
134134
where both values for ``every_n_epochs`` and ``check_val_every_n_epoch`` evenly divide E.
135135
save_on_train_epoch_end: Whether to run checkpointing at the end of the training epoch.
136-
If this is ``False``, then the check runs at the end of the validation.
136+
If ``True``, checkpoints are saved at the end of every training epoch.
137+
If ``False``, checkpoints are saved at the end of validation.
138+
If ``None`` (default), checkpointing behavior is determined based on training configuration.
139+
If ``check_val_every_n_epoch != 1``, checkpointing will not be performed at the end of
140+
every training epoch. If there are no validation batches of data, checkpointing will occur at the
141+
end of the training epoch. If there is a non-default number of validation runs per training epoch
142+
(``val_check_interval != 1``), checkpointing is performed after validation.
137143
enable_version_counter: Whether to append a version to the existing file name.
138-
If this is ``False``, then the checkpoint files will be overwritten.
144+
If ``False``, then the checkpoint files will be overwritten.
139145
140146
Note:
141147
For extra customization, ModelCheckpoint includes the following attributes:

0 commit comments

Comments
 (0)