Package ai.djl.training.listener
Class EpochTrainingListener
java.lang.Object
ai.djl.training.listener.TrainingListenerAdapter
ai.djl.training.listener.EpochTrainingListener
- All Implemented Interfaces:
TrainingListener
EpochTrainingListener
that tracks epochs.
Adds "epoch" metric with epoch times and saves "epoch" model property with numEpochs
-
Nested Class Summary
Nested classes/interfaces inherited from interface ai.djl.training.listener.TrainingListener
TrainingListener.BatchData, TrainingListener.Defaults
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the number of epochs.void
Listens to the end of an epoch during training.void
onTrainingBegin
(Trainer trainer) Listens to the beginning of training.void
onTrainingEnd
(Trainer trainer) Listens to the end of training.Methods inherited from class ai.djl.training.listener.TrainingListenerAdapter
onTrainingBatch, onValidationBatch
-
Constructor Details
-
EpochTrainingListener
public EpochTrainingListener()
-
-
Method Details
-
onEpoch
Listens to the end of an epoch during training.- Specified by:
onEpoch
in interfaceTrainingListener
- Overrides:
onEpoch
in classTrainingListenerAdapter
- Parameters:
trainer
- the trainer the listener is attached to
-
onTrainingBegin
Listens to the beginning of training.- Specified by:
onTrainingBegin
in interfaceTrainingListener
- Overrides:
onTrainingBegin
in classTrainingListenerAdapter
- Parameters:
trainer
- the trainer the listener is attached to
-
onTrainingEnd
Listens to the end of training.- Specified by:
onTrainingEnd
in interfaceTrainingListener
- Overrides:
onTrainingEnd
in classTrainingListenerAdapter
- Parameters:
trainer
- the trainer the listener is attached to
-
getNumEpochs
public int getNumEpochs()Returns the number of epochs.- Returns:
- the number of epochs
-