Dev (#123)
* fix quickstart command in readme * fix documentation links in model and datamodule * add `terminate_on_nan` trainer arg to readme * improve docstrings and type hinting
This commit is contained in:
1 parent
6a15f8ef3b
commit
e2c8ed4bf8
3 files changed
+23
-14
No files matched your search
@@ -9,12 +9,19 @@ from torchvision.transforms import transforms
|
||||
class MNISTDataModule(LightningDataModule):
|
||||
"""
|
||||
Example of LightningDataModule for MNIST dataset.
|
||||
|
||||
A DataModule standardizes the train, val, test splits, data preparation and transforms.
|
||||
The main advantage is consistent data splits, data preparation and transforms across models.
|
||||
|
||||
A DataModule implements 5 key methods:
|
||||
- prepare_data (things to do on 1 GPU/TPU, not on every GPU/TPU in distributed mode)
|
||||
- setup (things to do on every accelerator in distributed mode)
|
||||
- train_dataloader (the training dataloader)
|
||||
- val_dataloader (the validation dataloader(s))
|
||||
- test_dataloader (the test dataloader(s))
|
||||
|
||||
This allows you to share a full dataset without explaining how to download,
|
||||
split, transform and process the data
|
||||
|
||||
Read the docs:
|
||||
https://pytorch-lightning.readthedocs.io/en/latest/datamodules.html
|
||||
https://pytorch-lightning.readthedocs.io/en/latest/extensions/datamodules.html
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
@@ -24,7 +31,7 @@ class MNISTDataModule(LightningDataModule):
|
||||
batch_size: int = 64,
|
||||
num_workers: int = 0,
|
||||
pin_memory: bool = False,
|
||||
**kwargs,
|
||||
**kwargs
|
||||
):
|
||||
super().__init__()
|
||||
|
||||
|
||||
Reference in new issue
Block a user