Skip to content

Commit 911852f

Browse files
jbschirattitullie
authored andcommitted
Doc fixes (Lightning-AI#1362)
* Doc fixes from Lightning-AI#1357 (awaelchli's comments) + changelog. * Fix indentation. * Add blank line to fix doc build?
1 parent 92882d8 commit 911852f

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
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

+14-10
Original file line numberDiff line numberDiff line change
@@ -245,16 +245,18 @@ 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+
258+
- log (metrics to be added to the logger ; only tensors)
259+
- any metric used in a callback (e.g. early stopping).
258260
259261
.. note:: If this method is not overridden, this won't be called.
260262
@@ -282,7 +284,7 @@ def training_epoch_end(self, outputs):
282284
283285
With multiple dataloaders, `outputs` will be a list of lists. The outer list contains
284286
one entry per dataloader, while the inner list contains the individual outputs of
285-
each validation step for that dataloader.
287+
each training step for that dataloader.
286288
287289
.. code-block:: python
288290
@@ -539,12 +541,14 @@ def validation_epoch_end(
539541
540542
Args:
541543
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
544+
dataloaders, a list containing a list of outputs for each dataloader
543545
544546
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)
547+
Dict or OrderedDict
548+
May have the following optional keys:
549+
550+
- progress_bar (dict for progress bar display ; only tensors)
551+
- log (dict of metrics to add to logger ; only tensors).
548552
549553
.. note:: If you didn't define a validation_step, this won't be called.
550554

pytorch_lightning/trainer/training_loop.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -826,4 +826,4 @@ def _recursive_detach(in_dict):
826826
out_dict.update({k: v.detach()})
827827
else:
828828
out_dict.update({k: v})
829-
return out_dict
829+
return out_dict

0 commit comments

Comments
 (0)