Skip to content

Commit 3bba576

Browse files
committed
Doc fixes from Lightning-AI#1357 (awaelchli's comments) + changelog.
1 parent 42d9a02 commit 3bba576

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
2121
- Added `summary` method to Profilers. ([#1259](https://github.com/PyTorchLightning/pytorch-lightning/pull/1259))
2222
- Added informative errors if user defined dataloader has zero length ([#1280](https://github.com/PyTorchLightning/pytorch-lightning/pull/1280))
2323
- Added testing for python 3.8 ([#915](https://github.com/PyTorchLightning/pytorch-lightning/pull/915))
24-
24+
- Added a `training_epoch_end` method which is the mirror of `validation_epoch_end`. ([#1357](https://github.com/PyTorchLightning/pytorch-lightning/pull/1357))
2525
### Changed
2626

2727
- Changed `progress_bar_refresh_rate` trainer flag to disable progress bar when set to 0. ([#1108](https://github.com/PyTorchLightning/pytorch-lightning/pull/1108))

pytorch_lightning/core/lightning.py

+12-10
Original file line numberDiff line numberDiff line change
@@ -245,16 +245,17 @@ def training_epoch_end(
245245
for train_batch in train_data:
246246
out = training_step(train_batch)
247247
train_outs.append(out)
248-
training_epoch_end(val_outs)
248+
training_epoch_end(train_outs)
249249
250250
Args:
251251
outputs: List of outputs you defined in training_step, or if there are multiple
252-
dataloaders, a list containing a list of outputs for each dataloader
252+
dataloaders, a list containing a list of outputs for each dataloader
253253
254254
Return:
255-
Dict or OrderedDict (dict): Dict has the following optional keys:
256-
progress_bar -> Dict for progress bar display. Must have only tensors
257-
log -> Dict of metrics to add to logger. Must have only tensors (no images, etc)
255+
Dict or OrderedDict
256+
May contain the following optional keys:
257+
- log (metrics to be added to the logger ; only tensors)
258+
- any metric used in a callback (e.g. early stopping).
258259
259260
.. note:: If this method is not overridden, this won't be called.
260261
@@ -282,7 +283,7 @@ def training_epoch_end(self, outputs):
282283
283284
With multiple dataloaders, `outputs` will be a list of lists. The outer list contains
284285
one entry per dataloader, while the inner list contains the individual outputs of
285-
each validation step for that dataloader.
286+
each training step for that dataloader.
286287
287288
.. code-block:: python
288289
@@ -539,12 +540,13 @@ def validation_epoch_end(
539540
540541
Args:
541542
outputs: List of outputs you defined in validation_step, or if there are multiple
542-
dataloaders, a list containing a list of outputs for each dataloader
543+
dataloaders, a list containing a list of outputs for each dataloader
543544
544545
Return:
545-
Dict or OrderedDict (dict): Dict has the following optional keys:
546-
progress_bar -> Dict for progress bar display. Must have only tensors
547-
log -> Dict of metrics to add to logger. Must have only tensors (no images, etc)
546+
Dict or OrderedDict
547+
May have the following optional keys:
548+
- progress_bar (dict for progress bar display ; only tensors)
549+
- log (dict of metrics to add to logger ; only tensors).
548550
549551
.. note:: If you didn't define a validation_step, this won't be called.
550552

0 commit comments

Comments
 (0)