Skip to content

Commit fcea397

Browse files
Update README.md
1 parent 3d23a56 commit fcea397

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,23 @@ class CoolModel(pl.LightningModule):
117117
2. Fit with a [trainer](https://williamfalcon.github.io/pytorch-lightning/Trainer/)
118118
```python
119119
from pytorch_lightning import Trainer
120-
from test_tube import Experiment
121120

122121
model = CoolModel()
122+
123+
# most basic trainer, uses good defaults
124+
trainer = Trainer()
125+
trainer.fit(model)
126+
```
127+
128+
Or with tensorboard logger and some options turned on such as multi-gpu, etc...
129+
```python
130+
from test_tube import Experiment
131+
132+
# PyTorch summarywriter with a few bells and whistles
123133
exp = Experiment(save_dir=os.getcwd())
124134

125135
# train on cpu using only 10% of the data (for demo purposes)
136+
# pass in experi
126137
trainer = Trainer(experiment=exp, max_nb_epochs=1, train_percent_check=0.1)
127138

128139
# train on 4 gpus
@@ -137,7 +148,7 @@ trainer.fit(model)
137148
# view tensorflow logs
138149
print('View tensorboard logs by running\ntensorboard --logdir %s' % os.getcwd())
139150
print('and going to http://localhost:6006 on your browser')
140-
```
151+
```
141152

142153
## What does lightning control for me?
143154

0 commit comments

Comments
 (0)