mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-09 11:32:07 +08:00
finished rebase
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user