public interface TrainingListener
TrainingListener
offers an interface that allows performing some actions when certain
events have occurred in the Trainer
.
The methods onEpoch
, onTrainingBatch
, onValidationBatch
are called
during training. Adding an implementation of the listener to the Trainer
allows
performing any desired actions at those junctures. These could be used for collection metrics, or
logging, or any other purpose.
Modifier and Type | Interface and Description |
---|---|
static class |
TrainingListener.BatchData
A class to pass data from the batch into the training listeners.
|
static interface |
TrainingListener.Defaults
Contains default
TrainingListener sets. |
Modifier and Type | Method and 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.
|
void onEpoch(Trainer trainer)
trainer
- the trainer the listener is attached tovoid onTrainingBatch(Trainer trainer, TrainingListener.BatchData batchData)
trainer
- the trainer the listener is attached tobatchData
- the data from the batchvoid onValidationBatch(Trainer trainer, TrainingListener.BatchData batchData)
trainer
- the trainer the listener is attached tobatchData
- the data from the batchvoid onTrainingBegin(Trainer trainer)
trainer
- the trainer the listener is attached tovoid onTrainingEnd(Trainer trainer)
trainer
- the trainer the listener is attached to