more comments and explanations

This commit is contained in:
hobogalaxy committed 2020-12-12 22:39:40 +01:00
1 parent 757f0fc25a
commit 23e9c4fecf
5 files changed
+29 -21

No files matched your search

@@ -9,9 +9,9 @@ class MNISTDataModule(LightningDataModule):
This is example of datamodule for MNIST dataset.
The path to datamodule should be specified in your run config. (run_configs.yaml)
The 'hparams' dict contains your hparams specified in run config! (run_configs.yaml)
The 'hparams' dict contains your hparams specified in run config. (run_configs.yaml)
"""
def __init__(self, data_dir: str, hparams: dict):
super().__init__()
@@ -5,8 +5,9 @@ import os
class TestDataset(Dataset):
"""
Example dataset class for loading images from folder.
'Dataset' classes can be used by 'DataModule' class.
Example dataset class for loading images from folder and converting them to monochromatic.
Can be used to perform inference with trained MNIST model.
'Dataset' type classes can also be used to create 'DataLoader' type classes which are used by datamodules.
"""
def __init__(self, img_dir, transform):
@@ -1,3 +1,6 @@
"""
Example file containing data transformations which can be used by datamodule.
"""
from torchvision import transforms
@@ -3,7 +3,7 @@ import pytorch_lightning as pl
import torch.nn.functional as F
import torch
# custom models
# import custom models
from models.simple_mnist_classifier.models import *
@@ -12,7 +12,7 @@ class LitModel(pl.LightningModule):
This is example of lightning model for MNIST digits classification.
The path to model should be specified in your run config. (run_configs.yaml)
The 'hparams' dict contains your hparams specified in run config! (run_configs.yaml)
The 'hparams' dict contains your hparams specified in run config. (run_configs.yaml)
This class enables you to specify what happens during training, validation and test step.
You can just remove 'validation_step()' or 'test_step()' methods if you don't want to have them during training.