chainer.training.Updater¶
-
class
chainer.training.
Updater
[source]¶ Interface of updater objects for trainers.
Updater
implements a training iteration asupdate()
.Typically, the updating iteration proceeds as follows.
- Fetch a minibatch from :module:`~chainer.dataset`
- via
Iterator
.
- Run forward and backward process of
Chain
. - Update parameters according to their
UpdateRule
.
The first line is processed by
chainer.dataset.Iterator.__next__()
. The second and third are processed byupdate()
.Users can also implement original
update()
by overiding it.Methods
-
connect_trainer
(trainer)[source]¶ Connects the updater to the trainer that will call it.
The typical usage of this method is to register additional links to the reporter of the trainer. This method is called at the end of the initialization of
Trainer
. The default implementation does nothing.Parameters: trainer (Trainer) – Trainer object to which the updater is registered.
-
finalize
()[source]¶ Finalizes the updater object.
This method is called at the end of training loops. It should finalize each dataset iterator used in this updater.
-
get_all_optimizers
()[source]¶ Gets a dictionary of all optimizers for this updater.
Returns: Dictionary that maps names to optimizers. Return type: dict