Triggers
A trigger specifies a timespot or several timespots during training, and a corresponding action will be taken when the timespot(s) s reached.
Every Epoch
Scala:
val trigger = Trigger.everyEpoch
Python:
trigger = EveryEpoch()
A trigger that triggers an action when each epoch finishes.
Could be used as trigger in setValidation
and setCheckpoint
in Optimizer, and also in TrainSummary.setSummaryTrigger
.
Several Iteration
Scala:
val trigger = Trigger.severalIteration(n)
Python:
trigger = SeveralIteration(n)
A trigger that triggers an action every n
iterations.
Could be used as trigger in setValidation
and setCheckpoint
in Optimizer, and also in TrainSummary.setSummaryTrigger
.
Max Epoch
Scala:
val trigger = Trigger.maxEpoch(max)
Python:
trigger = MaxEpoch(max)
A trigger that triggers an action when training reaches
the number of epochs specified by "max".
Usually used in Optimizer.setEndWhen
.
Max Iteration
Scala:
val trigger = Trigger.maxIteration(max)
Python:
trigger = MaxIteration(max)
A trigger that triggers an action when training reaches
the number of iterations specified by "max".
Usually used in Optimizer.setEndWhen
.
Max Score
Scala:
val trigger = Trigger.maxScore(max)
Python:
trigger = MaxScore(max)
A trigger that triggers an action when validation score larger than "max" score
Min Loss
Scala:
val trigger = Trigger.minLoss(min)
Python:
trigger = MinLoss(min)
A trigger that triggers an action when training loss less than "min" loss