clarify forward (#3609)

* clarify forward

* clarify forward
This commit is contained in:
William Falcon 2020-09-22 13:37:11 -04:00 committed by GitHub
parent ba01ec9dbf
commit 2a10cfaf3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -150,6 +150,10 @@ class LitAutoEncoder(pl.LightningModule):
def configure_optimizers(self):
optimizer = torch.optim.Adam(self.parameters(), lr=1e-3)
return optimizer
# def forward(self, x):
# in lightning this is optional and mostly used to say
# how your LightningModule should work for inference/predictions
```
#### Step 2: Train!

View File

@ -111,6 +111,10 @@ Step 1: Define LightningModule
optimizer = torch.optim.Adam(self.parameters(), lr=1e-3)
return optimizer
# def forward(self, x):
# in lightning this is optional and mostly used to say
# how your LightningModule should work for inference/predictions
A :class:`~pytorch_lightning.core.LightningModule` defines a *system* such as:
- `Autoencoder <https://github.com/PyTorchLightning/pytorch-lightning-bolts/blob/master/pl_bolts/models/autoencoders/basic_ae/basic_ae_module.py>`_