From 906c569584828c444629a42074c656bd5ffdf8a2 Mon Sep 17 00:00:00 2001 From: Jirka Borovec Date: Fri, 3 Apr 2020 01:03:36 +0200 Subject: [PATCH] Apply suggestions from code review --- docs/source/introduction_guide.rst | 4 ++-- pytorch_lightning/core/lightning.py | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/source/introduction_guide.rst b/docs/source/introduction_guide.rst index 13735e855ff7b..99f3c279af642 100644 --- a/docs/source/introduction_guide.rst +++ b/docs/source/introduction_guide.rst @@ -285,8 +285,8 @@ However, if you have multiple optimizers use the matching parameters class LitMNIST(pl.LightningModule): - def configure_optimizers(self): - return Adam(self.generator(), lr=1e-3), Adam(self.discriminator(), lr=1e-3) + def configure_optimizers(self): + return Adam(self.generator(), lr=1e-3), Adam(self.discriminator(), lr=1e-3) Training step ^^^^^^^^^^^^^ diff --git a/pytorch_lightning/core/lightning.py b/pytorch_lightning/core/lightning.py index 69d21907fd9db..6b32d6072be6a 100644 --- a/pytorch_lightning/core/lightning.py +++ b/pytorch_lightning/core/lightning.py @@ -224,7 +224,7 @@ def training_step(self, batch, batch_idx, hiddens): The presented loss value in progress bar is smooth (average) over last values, so it differs from values set in train/validation step. """ - warnings.warn('training_step must be implemented to be used with the Lightning Trainer') + warnings.warn('`training_step` must be implemented to be used with the Lightning Trainer') def training_end(self, *args, **kwargs): """ @@ -1076,8 +1076,7 @@ def configure_optimizers(self): } """ - warnings.warn('configure_optimizers must be implemented to be used with the ' - 'Lightning Trainer') + warnings.warn('`configure_optimizers` must be implemented to be used with the Lightning Trainer') def optimizer_step( self, @@ -1279,7 +1278,7 @@ def train_dataloader(self): return loader """ - warnings.warn('train_dataloader must be implemented to be used with the Lightning Trainer') + warnings.warn('`train_dataloader` must be implemented to be used with the Lightning Trainer') def tng_dataloader(self): # todo: remove in v1.0.0 """Implement a PyTorch DataLoader.