Updated "Models defined by data" (#3433)

* Updated "Models defined by data"

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

Co-authored-by: David Waterworth <david.waterworth@cim.io>
This commit is contained in:
David Waterworth 2020-09-10 23:22:27 +10:00 committed by GitHub
parent 19c0c2e091
commit 1255a8f738
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -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):