File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -117,12 +117,23 @@ class CoolModel(pl.LightningModule):
1171172 . Fit with a [ trainer] ( https://williamfalcon.github.io/pytorch-lightning/Trainer/ )
118118``` python
119119from pytorch_lightning import Trainer
120- from test_tube import Experiment
121120
122121model = 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
123133exp = Experiment(save_dir = os.getcwd())
124134
125135# train on cpu using only 10% of the data (for demo purposes)
136+ # pass in experi
126137trainer = 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
138149print (' View tensorboard logs by running\n tensorboard --logdir %s ' % os.getcwd())
139150print (' and going to http://localhost:6006 on your browser' )
140- ```
151+ ```
141152
142153## What does lightning control for me?
143154
You can’t perform that action at this time.
0 commit comments