Skip to content

Commit 85cc48b

Browse files
awaelchliSkafteNickitchatons-rogananyahjha93
authored andcommitted
Document behaviour when setting both on_step=True and on_epoch=True in self.log (#4327)
* update logging.rst * logger of choice Co-authored-by: Nicki Skafte <[email protected]> * add metrics reference * trigger ci * Revert "trigger ci" This reverts commit 97bf461. Co-authored-by: Nicki Skafte <[email protected]> Co-authored-by: chaton <[email protected]> Co-authored-by: Roger Shieh <[email protected]> Co-authored-by: Ananya Harsh Jha <[email protected]> (cherry picked from commit e971437)
1 parent 504603c commit 85cc48b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

docs/source/logging.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,14 @@ The :func:`~~pytorch_lightning.core.lightning.LightningModule.log` method has a
8585
* `logger`: Logs to the logger like Tensorboard, or any other custom logger passed to the :class:`~pytorch_lightning.trainer.trainer.Trainer`.
8686

8787

88-
.. note:: Setting `on_epoch=True` will accumulate your logged values over the full training epoch.
88+
.. note::
89+
90+
- Setting ``on_epoch=True`` will cache all your logged values during the full training epoch and perform a
91+
reduction `on_epoch_end`. We recommend using the :ref:`metrics` API when working with custom reduction.
92+
93+
- Setting both ``on_step=True`` and ``on_epoch=True`` will create two keys per metric you log with
94+
suffix ``_step`` and ``_epoch``, respectively. You can refer to these keys e.g. in the `monitor`
95+
argument of :class:`~pytorch_lightning.callbacks.model_checkpoint.ModelCheckpoint` or in the graphs plotted to the logger of your choice.
8996

9097

9198
Manual logging

0 commit comments

Comments
 (0)