Package ai.djl.training.listener
Class TrainingListenerAdapter
java.lang.Object
ai.djl.training.listener.TrainingListenerAdapter
- All Implemented Interfaces:
TrainingListener
- Direct Known Subclasses:
DivergenceCheckTrainingListener,EpochTrainingListener,EvaluatorTrainingListener,MemoryTrainingListener,SaveModelTrainingListener,TimeMeasureTrainingListener
Base implementation of the training listener that does nothing. This is to be used as a base
class for custom training listeners that just want to listen to one event, so it is not necessary
to override methods you do not care for.
-
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 TypeMethodDescriptionvoidListens to the end of an epoch during training.voidonTrainingBatch(Trainer trainer, TrainingListener.BatchData batchData) Listens to the end of training one batch of data during training.voidonTrainingBegin(Trainer trainer) Listens to the beginning of training.voidonTrainingEnd(Trainer trainer) Listens to the end of training.voidonValidationBatch(Trainer trainer, TrainingListener.BatchData batchData) Listens to the end of validating one batch of data during validation.
-
Constructor Details
-
TrainingListenerAdapter
public TrainingListenerAdapter()
-
-
Method Details
-
onEpoch
Listens to the end of an epoch during training.- Specified by:
onEpochin interfaceTrainingListener- Parameters:
trainer- the trainer the listener is attached to
-
onTrainingBatch
Listens to the end of training one batch of data during training.- Specified by:
onTrainingBatchin interfaceTrainingListener- Parameters:
trainer- the trainer the listener is attached tobatchData- the data from the batch
-
onValidationBatch
Listens to the end of validating one batch of data during validation.- Specified by:
onValidationBatchin interfaceTrainingListener- Parameters:
trainer- the trainer the listener is attached tobatchData- the data from the batch
-
onTrainingBegin
Listens to the beginning of training.- Specified by:
onTrainingBeginin interfaceTrainingListener- Parameters:
trainer- the trainer the listener is attached to
-
onTrainingEnd
Listens to the end of training.- Specified by:
onTrainingEndin interfaceTrainingListener- Parameters:
trainer- the trainer the listener is attached to
-