The training loop API centers around the abstract type Phase
and the function step!
. To implement a custom training, you need to
- fit for
n
epochs of supervised training and validation usingfit!
(learner, n)
- train for an epoch using
epoch!
(learner, phase, dataiter)
You can optionally
- overwrite default
epoch!
implementation - implement
phasedataiter
to define which data iterator should be used whenepoch!
is called without one. - create custom
Callback
andEvent
s with event handlers that dispatch on yourPhase
subtype.
Inside callback handlers and step!
implementations, you can throw CancelFittingException
to stop the training and CancelEpochException
and CancelStepException
to skip the current epoch or step.