Package ai.djl.training.tracker
Class CyclicalTracker.Builder
java.lang.Object
ai.djl.training.tracker.CyclicalTracker.Builder
- Enclosing class:
- CyclicalTracker
The Builder to construct an
CyclicalTracker
object.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds aCyclicalTracker
block.optBaseValue
(float baseValue) Sets the initial value.optGamma
(float gamma) Constant inCyclicalMode.EXP_RANGE
scaling function.optMaxValue
(float maxValue) Sets the initial value.Sets the cyclical mode.optScaleFunction
(CyclicalTracker.ScaleFunction scaleFunction) Custom scaling function.optScaleModeCycle
(boolean scaleModeCycle) Defines whether scaling function is evaluated on cycle number or update number.optStepSizeDown
(int stepSizeDown) Sets the number of iterations in up half of cycle.optStepSizeUp
(int stepSizeUp) Sets the number of iterations in up half of cycle.
-
Method Details
-
optBaseValue
Sets the initial value. Default: 0.001.- Parameters:
baseValue
- the initial value- Returns:
- this
Builder
-
optMaxValue
Sets the initial value. Default: 0.006.- Parameters:
maxValue
- the max value- Returns:
- this
Builder
-
optStepSizeUp
Sets the number of iterations in up half of cycle. Default: 2000.- Parameters:
stepSizeUp
- number of iterations in up half of cycle- Returns:
- this
Builder
-
optStepSizeDown
Sets the number of iterations in up half of cycle. IfstepSizeDown
equals 0, it is set tostepSizeUp
. Default: 0.- Parameters:
stepSizeDown
- number of iterations in the down half of cycle- Returns:
- this
Builder
-
optMode
Sets the cyclical mode. Can beCyclicalMode.TRIANGULAR
,CyclicalMode.TRIANGULAR2
orCyclicalMode.EXP_RANGE
. Values correspond to policies detailed above.- Parameters:
mode
- cyclical mode- Returns:
- this
Builder
-
optGamma
Constant inCyclicalMode.EXP_RANGE
scaling function. Default: 1.- Parameters:
gamma
- constant in 'exp_range' scaling function: gamma^cycleIterations- Returns:
- this
Builder
-
optScaleFunction
Custom scaling function. If set,mode
will be ignored. Default: null.- Parameters:
scaleFunction
- Custom scaling function- Returns:
- this
Builder
-
optScaleModeCycle
Defines whether scaling function is evaluated on cycle number or update number. Default: true.- Parameters:
scaleModeCycle
- if true then scaling function is evaluated on cycle number, else on update number- Returns:
- this
Builder
-
build
Builds aCyclicalTracker
block.- Returns:
- the
CyclicalTracker
block
-