Skip to content

Commit

Permalink
Updated "Models defined by data" (#3433)
Browse files Browse the repository at this point in the history
* Updated "Models defined by data"

* Fixed WARNING: Inline substitution_reference start-string without end-string.

Co-authored-by: David Waterworth <[email protected]>
  • Loading branch information
david-waterworth and David Waterworth authored Sep 10, 2020
1 parent 19c0c2e commit 1255a8f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/source/introduction_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -289,15 +289,15 @@ When your models need to know about the data, it's best to process the data befo
dm.setup()
model = LitModel(out_features=dm.num_classes, img_width=dm.img_width, img_height=dm.img_height)
trainer.fit(model)
trainer.fit(model, dm)
1. use `prepare_data` to download and process the dataset.
2. use `setup` to do splits, and build your model internals

|
An alternative to using a DataModule is to defer initialization of the models modules to the `setup` method of your LightningModule as follows:

.. testcode::
.. code-block:: python
class LitMNIST(LightningModule):
Expand Down

0 comments on commit 1255a8f

Please sign in to comment.