Update README.md

This commit is contained in:
William Falcon 2019-08-08 11:03:12 -04:00 committed by GitHub
parent 3d23a56ed2
commit fcea3971a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 2 deletions

View File

@ -117,12 +117,23 @@ class CoolModel(pl.LightningModule):
2. Fit with a [trainer](https://williamfalcon.github.io/pytorch-lightning/Trainer/)
```python
from pytorch_lightning import Trainer
from test_tube import Experiment
model = CoolModel()
# most basic trainer, uses good defaults
trainer = Trainer()
trainer.fit(model)
```
Or with tensorboard logger and some options turned on such as multi-gpu, etc...
```python
from test_tube import Experiment
# PyTorch summarywriter with a few bells and whistles
exp = Experiment(save_dir=os.getcwd())
# train on cpu using only 10% of the data (for demo purposes)
# pass in experi
trainer = Trainer(experiment=exp, max_nb_epochs=1, train_percent_check=0.1)
# train on 4 gpus