diff --git a/404.html b/404.html index 02970fa1..ebc26eaf 100644 --- a/404.html +++ b/404.html @@ -54,9 +54,36 @@ Lightning module + + + +
A lightning module is a strict superclass of nn.Module, it provides a standard interface for the trainer to interact with the model.
-To Define a Lightning Module, implement the following methods:
+The easiest thing to do is copy this template and modify accordingly.
+Otherwise, to Define a Lightning Module, implement the following methods:
Required:
The asdf
+Accumulated gradients runs K small batches of size N before doing a backwards pass. The effect is a large effective batch size of size KxN.
+# DEFAULT (ie: no accumulated grads)
+trainer = Trainer(accumulate_grad_batches=1)
+
+
+Cut the learning rate by 10 at every epoch listed in this list.
+# DEFAULT (don't anneal)
+trainer = Trainer(lr_scheduler_milestones=None)
+
+# cut LR by 10 at 100, 200, and 300 epochs
+trainer = Trainer(lr_scheduler_milestones=[100, 200, 300])
+
+
+Lightning automatically logs gpu usage to the test tube logs. It'll only do it at the metric logging interval, so it doesn't slow down training.
+This option prints a list of tensors with nan gradients.
+# DEFAULT
+trainer = Trainer(print_nan_grads=False)
+
+
+If you have a small dataset you might want to check validation every n epochs
+# DEFAULT
+trainer = Trainer(check_val_every_n_epoch=1)
+
+
+# DEFAULT
+trainer = Trainer(progress_bar=True)
+
+
+By default lightning prints a list of parameters and submodules when it starts training.
+It can be useful to force training for a minimum number of epochs or limit to a max number
+# DEFAULT
+trainer = Trainer(min_nb_epochs=1, max_nb_epochs=1000)
+
+
+Looking at grad norms can help you figure out where training might be going wrong.
+# DEFAULT (-1 doesn't track norms)
+trainer = Trainer(track_grad_norm=-1)
+
+# track the LP norm (P=2 here)
+trainer = Trainer(track_grad_norm=2)
+
+
+A useful debugging trick is to make your model overfit a tiny fraction of the data.
+# DEFAULT don't overfit (ie: normal training)
+trainer = Trainer(overfit_pct=0.0)
+
+# overfit on 1% of data
+trainer = Trainer(overfit_pct=0.01)
+
+
+If you don't want to check 100% of the validation set (for debugging or if it's huge), set this flag
+# DEFAULT
+trainer = Trainer(train_percent_check=1.0)
+
+# check 10% only
+trainer = Trainer(train_percent_check=0.1)
+
+
+ The lightning trainer abstracts best practices for running a training, val, test routine. It calls parts of your model when it wants to hand over full control and otherwise makes training assumptions which are now standard practice in AI research.
+This is the basic use of the trainer:
+from pytorch_lightning import Trainer
+
+model = LightningTemplate()
+
+trainer = Trainer()
+trainer.fit(model)
+
+
+But of course the fun is in all the advanced things it can do:
+Training loop
+Validation loop
+Distributed training
+Checkpointing
+Computing cluster (SLURM)
+