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):
117
117
2 . Fit with a [ trainer] ( https://williamfalcon.github.io/pytorch-lightning/Trainer/ )
118
118
``` python
119
119
from pytorch_lightning import Trainer
120
- from test_tube import Experiment
121
120
122
121
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
123
133
exp = Experiment(save_dir = os.getcwd())
124
134
125
135
# train on cpu using only 10% of the data (for demo purposes)
136
+ # pass in experi
126
137
trainer = Trainer(experiment = exp, max_nb_epochs = 1 , train_percent_check = 0.1 )
127
138
128
139
# train on 4 gpus
@@ -137,7 +148,7 @@ trainer.fit(model)
137
148
# view tensorflow logs
138
149
print (' View tensorboard logs by running\n tensorboard --logdir %s ' % os.getcwd())
139
150
print (' and going to http://localhost:6006 on your browser' )
140
- ```
151
+ ```
141
152
142
153
## What does lightning control for me?
143
154
You can’t perform that action at this time.
0 commit comments