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
public abstract class TrainingListenerAdapter extends java.lang.Object implements TrainingListener
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 Constructor Description TrainingListenerAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onEpoch(Trainer trainer)
Listens to the end of an epoch during training.void
onTrainingBatch(Trainer trainer, TrainingListener.BatchData batchData)
Listens to the end of training one batch of data during training.void
onTrainingBegin(Trainer trainer)
Listens to the beginning of training.void
onTrainingEnd(Trainer trainer)
Listens to the end of training.void
onValidationBatch(Trainer trainer, TrainingListener.BatchData batchData)
Listens to the end of validating one batch of data during validation.
-
-
-
Method Detail
-
onEpoch
public void onEpoch(Trainer trainer)
Listens to the end of an epoch during training.- Specified by:
onEpoch
in interfaceTrainingListener
- Parameters:
trainer
- the trainer the listener is attached to
-
onTrainingBatch
public void onTrainingBatch(Trainer trainer, TrainingListener.BatchData batchData)
Listens to the end of training one batch of data during training.- Specified by:
onTrainingBatch
in interfaceTrainingListener
- Parameters:
trainer
- the trainer the listener is attached tobatchData
- the data from the batch
-
onValidationBatch
public void onValidationBatch(Trainer trainer, TrainingListener.BatchData batchData)
Listens to the end of validating one batch of data during validation.- Specified by:
onValidationBatch
in interfaceTrainingListener
- Parameters:
trainer
- the trainer the listener is attached tobatchData
- the data from the batch
-
onTrainingBegin
public void onTrainingBegin(Trainer trainer)
Listens to the beginning of training.- Specified by:
onTrainingBegin
in interfaceTrainingListener
- Parameters:
trainer
- the trainer the listener is attached to
-
onTrainingEnd
public void onTrainingEnd(Trainer trainer)
Listens to the end of training.- Specified by:
onTrainingEnd
in interfaceTrainingListener
- Parameters:
trainer
- the trainer the listener is attached to
-
-