Update README.md

This commit is contained in:
William Falcon
2019-08-13 12:10:08 -04:00
committed by GitHub
parent 699fbabda7
commit b02f4a4ccf
+4 -3
View File
@@ -58,9 +58,10 @@ Don't worry about training on multiple gpus or speeding up your code, lightning
---
## How do I do use it?
The research code goes into a LightningModule and you train it using a Trainer. Think of the LightningModule as a *system* such as seq-2-seq, GAN, etc... However, the LightningModule can ALSO just be a simple classifier such as the example below.
To use lightning do 2 things:
1. [Define a LightningModel](https://williamfalcon.github.io/pytorch-lightning/LightningModule/RequiredTrainerInterface/)
1. [Define a LightningModule](https://williamfalcon.github.io/pytorch-lightning/LightningModule/RequiredTrainerInterface/)
```python
import os
import torch
@@ -71,7 +72,7 @@ import torchvision.transforms as transforms
import pytorch_lightning as pl
class CoolModel(pl.LightningModule):
class CoolSystem(pl.LightningModule):
def __init__(self):
super(CoolModel, self).__init__()
@@ -122,7 +123,7 @@ class CoolModel(pl.LightningModule):
```python
from pytorch_lightning import Trainer
model = CoolModel()
model = CoolSystem()
# most basic trainer, uses good defaults
trainer = Trainer()