Class EvaluatorTrainingListener

java.lang.Object
ai.djl.training.listener.TrainingListenerAdapter
ai.djl.training.listener.EvaluatorTrainingListener
All Implemented Interfaces:
TrainingListener

public class EvaluatorTrainingListener extends TrainingListenerAdapter
TrainingListener that records evaluator results.

Results are recorded for the following stages:

  • TRAIN_EPOCH - This accumulates for the whole epoch and is recorded to a metric at the end of the epoch
  • TRAIN_PROGRESS - This accumulates for progressUpdateFrequency batches and is recorded to a metric at the end
  • TRAIN_ALL - This does not accumulates and records every training batch to a metric
  • VALIDATE_EPOCH - This accumulates for the whole validation epoch and is recorded to a metric at the end of the epoch

The training and validation evaluators are saved as metrics with names that can be found using metricName(Evaluator, String). The validation evaluators are also saved as model properties with the evaluator name.