Package ai.djl.training.listener
Class TimeMeasureTrainingListener
java.lang.Object
ai.djl.training.listener.TrainingListenerAdapter
ai.djl.training.listener.TimeMeasureTrainingListener
- All Implemented Interfaces:
TrainingListener
TrainingListener that outputs the training time metrics after training is done.
The training time data is placed in the file "$outputDir/training.log" and the validation data is placed in "$outputDir/validate.log".
-
Nested Class Summary
Nested classes/interfaces inherited from interface ai.djl.training.listener.TrainingListener
TrainingListener.BatchData, TrainingListener.Defaults -
Constructor Summary
ConstructorsConstructorDescriptionTimeMeasureTrainingListener(String outputDir) Constructs aTimeMeasureTrainingListener. -
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.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.Methods inherited from class ai.djl.training.listener.TrainingListenerAdapter
onTrainingBegin
-
Constructor Details
-
TimeMeasureTrainingListener
Constructs aTimeMeasureTrainingListener.- Parameters:
outputDir- the directory to output the tracked timing data in
-
-
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
-
onTrainingBatch
Listens to the end of training one batch of data during training.- Specified by:
onTrainingBatchin interfaceTrainingListener- Overrides:
onTrainingBatchin classTrainingListenerAdapter- 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- Overrides:
onValidationBatchin classTrainingListenerAdapter- Parameters:
trainer- the trainer the listener is attached tobatchData- the data from the batch
-
onTrainingEnd
Listens to the end of training.- Specified by:
onTrainingEndin interfaceTrainingListener- Overrides:
onTrainingEndin classTrainingListenerAdapter- Parameters:
trainer- the trainer the listener is attached to
-