From d0554309cbbf5a7d544aa6bec76592929da9e066 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste SCHIRATTI Date: Fri, 3 Apr 2020 21:02:20 +0200 Subject: [PATCH] Doc fixes (#1362) * Doc fixes from #1357 (awaelchli's comments) + changelog. * Fix indentation. * Add blank line to fix doc build? --- pytorch_lightning/core/lightning.py | 24 +++++++++++++--------- pytorch_lightning/trainer/training_loop.py | 2 +- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/pytorch_lightning/core/lightning.py b/pytorch_lightning/core/lightning.py index 88067ae07031c0..dfa1c6ef3f2e8e 100644 --- a/pytorch_lightning/core/lightning.py +++ b/pytorch_lightning/core/lightning.py @@ -245,16 +245,18 @@ def training_epoch_end( for train_batch in train_data: out = training_step(train_batch) train_outs.append(out) - training_epoch_end(val_outs) + training_epoch_end(train_outs) Args: outputs: List of outputs you defined in training_step, or if there are multiple - dataloaders, a list containing a list of outputs for each dataloader + dataloaders, a list containing a list of outputs for each dataloader Return: - Dict or OrderedDict (dict): Dict has the following optional keys: - progress_bar -> Dict for progress bar display. Must have only tensors - log -> Dict of metrics to add to logger. Must have only tensors (no images, etc) + Dict or OrderedDict + May contain the following optional keys: + + - log (metrics to be added to the logger ; only tensors) + - any metric used in a callback (e.g. early stopping). .. note:: If this method is not overridden, this won't be called. @@ -282,7 +284,7 @@ def training_epoch_end(self, outputs): With multiple dataloaders, `outputs` will be a list of lists. The outer list contains one entry per dataloader, while the inner list contains the individual outputs of - each validation step for that dataloader. + each training step for that dataloader. .. code-block:: python @@ -539,12 +541,14 @@ def validation_epoch_end( Args: outputs: List of outputs you defined in validation_step, or if there are multiple - dataloaders, a list containing a list of outputs for each dataloader + dataloaders, a list containing a list of outputs for each dataloader Return: - Dict or OrderedDict (dict): Dict has the following optional keys: - progress_bar -> Dict for progress bar display. Must have only tensors - log -> Dict of metrics to add to logger. Must have only tensors (no images, etc) + Dict or OrderedDict + May have the following optional keys: + + - progress_bar (dict for progress bar display ; only tensors) + - log (dict of metrics to add to logger ; only tensors). .. note:: If you didn't define a validation_step, this won't be called. diff --git a/pytorch_lightning/trainer/training_loop.py b/pytorch_lightning/trainer/training_loop.py index 8a7e2816219ec1..071a2f94fe9190 100644 --- a/pytorch_lightning/trainer/training_loop.py +++ b/pytorch_lightning/trainer/training_loop.py @@ -826,4 +826,4 @@ def _recursive_detach(in_dict): out_dict.update({k: v.detach()}) else: out_dict.update({k: v}) - return out_dict + return out_dict