chainer.training.extensions.LinearShift¶
-
class
chainer.training.extensions.LinearShift(attr, value_range, time_range, optimizer=None)[source]¶ Trainer extension to change an optimizer attribute linearly.
This extension changes an optimizer attribute from the first value to the last value linearly within a specified duration. The typical use case is warming up of the momentum coefficient.
For example, suppose that this extension is called at every iteration, and
value_range == (x, y)andtime_range == (i, j). Then, this extension keeps the attribute to bexup to thei-th iteration, linearly shifts the value toyby thej-th iteration, and then keeps the value to beyafter thej-th iteration.This extension is also called before the training loop starts by default.
Parameters: - attr (str) – Name of the optimizer attribute to adjust.
- value_range (tuple of float) – The first and the last values of the attribute.
- time_range (tuple of ints) – The first and last counts of calls in which the attribute is adjusted.
- optimizer (Optimizer) – Target optimizer object. If it is None, the main optimizer of the trainer is used.
Methods
Attributes
-
default_name¶ Default name of the extension.
It is the name of the class by default. Implementation can override this property, or provide a class attribute to hide it.
-
priority= 100¶
-
trigger= (1, 'iteration')¶