You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Lightning, the code above is moved within the :func:`~pytorch_lightning.core.LightningModule.configure_optimizers` method of the LightningModule.
150
+
In Lightning, the same code is re-organized within the :meth:`~pytorch_lightning.core.lightning.LightningModule.configure_optimizers` method.
150
151
151
152
.. testcode::
152
153
153
154
class LitMNIST(LightningModule):
154
155
def configure_optimizers(self):
155
156
return Adam(self.parameters(), lr=1e-3)
156
157
157
-
.. note:: The LightningModule is subclassing :class:`~torch.nn.Module` and therefore, you can access its children parameters directly with ``self.parameters()``.
158
+
.. note:: The ``LightningModule`` is subclassing :class:`~torch.nn.Module` and therefore, you can access its children parameters directly with ``self.parameters()``.
158
159
159
160
If you have multiple optimizers, you can configure them as follows:
0 commit comments