Package ai.djl.training.listener
Class EpochTrainingListener
- java.lang.Object
-
- ai.djl.training.listener.TrainingListenerAdapter
-
- ai.djl.training.listener.EpochTrainingListener
-
- All Implemented Interfaces:
TrainingListener
public class EpochTrainingListener extends TrainingListenerAdapter
EpochTrainingListenerthat 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 Constructor Description EpochTrainingListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetNumEpochs()Returns the number of epochs.voidonEpoch(Trainer trainer)Listens 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
-
-
-
-
Method Detail
-
onEpoch
public void onEpoch(Trainer trainer)
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
public void onTrainingBegin(Trainer trainer)
Listens to the beginning of training.- Specified by:
onTrainingBeginin interfaceTrainingListener- Overrides:
onTrainingBeginin classTrainingListenerAdapter- Parameters:
trainer- the trainer the listener is attached to
-
onTrainingEnd
public void onTrainingEnd(Trainer trainer)
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
-
-