mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-09 11:32:07 +08:00
Update README.md
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user