From d2474313007e71a736ba0e646b702151e110b0dc Mon Sep 17 00:00:00 2001 From: William Falcon Date: Thu, 16 Jan 2020 07:45:36 -0500 Subject: [PATCH] finished rebase --- pytorch_lightning/trainer/__init__.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/pytorch_lightning/trainer/__init__.py b/pytorch_lightning/trainer/__init__.py index 9ce668ea..893b5cbe 100644 --- a/pytorch_lightning/trainer/__init__.py +++ b/pytorch_lightning/trainer/__init__.py @@ -1,6 +1,17 @@ """ - 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. + +The trainer de-couples the engineering code (16-bit, early stopping, GPU distribution, etc...) from the +science code (GAN, BERT, your project, etc...). It uses many assumptions which are best practices in +AI research today. + +The trainer automates all parts of training except: + +- what happens in training , test, val loop +- where the data come from +- which optimizers to use +- how to do the computations + +The Trainer delegates those calls to your LightningModule which defines how to do those parts. This is the basic use of the trainer: @@ -8,15 +19,10 @@ This is the basic use of the trainer: from pytorch_lightning import Trainer - model = LightningTemplate() + model = MyLightningModule() trainer = Trainer() trainer.fit(model) - -The Trainer holds all the engineering code you might need such as distributing over GPUs or early stopping. -The LightningTemplate holds the core computations, train, val, test loop, optimizer and dataloaders. - -This pattern de-couples the engineering from the science which makes your code reusable and free to run on any hardware. """ from .trainer import Trainer