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 TypeMethodDescriptionintReturns the number of epochs.voidListens to the end of an epoch during training.voidonTrainingBegin(Trainer trainer) Listens to the beginning of training.voidonTrainingEnd(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:
onEpochin interfaceTrainingListener- Overrides:
onEpochin classTrainingListenerAdapter- Parameters:
trainer- the trainer the listener is attached to
-
onTrainingBegin
Listens to the beginning of training.- Specified by:
onTrainingBeginin interfaceTrainingListener- Overrides:
onTrainingBeginin classTrainingListenerAdapter- Parameters:
trainer- the trainer the listener is attached to
-
onTrainingEnd
Listens to the end of training.- Specified by:
onTrainingEndin interfaceTrainingListener- Overrides:
onTrainingEndin classTrainingListenerAdapter- Parameters:
trainer- the trainer the listener is attached to
-
getNumEpochs
public int getNumEpochs()Returns the number of epochs.- Returns:
- the number of epochs
-