added warnings to unimplemented methods (#1317)

* added warnings and removed default optimizer

* opt

* Apply suggestions from code review

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
This commit is contained in:
William Falcon
2020-04-03 15:06:51 -04:00
committed by GitHub
co-authored by Jirka Borovec
parent 3c5530c29d
commit e68ba1c836
3 changed files with 17 additions and 2 deletions
+11 -1
View File
@@ -269,7 +269,6 @@ In PyTorch we do it as follows:
In Lightning we do the same but organize it under the configure_optimizers method.
If you don't define this, Lightning will automatically use `Adam(self.parameters(), lr=1e-3)`.
.. code-block:: python
@@ -278,6 +277,17 @@ If you don't define this, Lightning will automatically use `Adam(self.parameters
def configure_optimizers(self):
return Adam(self.parameters(), lr=1e-3)
.. note:: The LightningModule itself has the parameters, so pass in self.parameters()
However, if you have multiple optimizers use the matching parameters
.. code-block:: python
class LitMNIST(pl.LightningModule):
def configure_optimizers(self):
return Adam(self.generator(), lr=1e-3), Adam(self.discriminator(), lr=1e-3)
Training step
^^^^^^^^^^^^^