public class LoggingTrainingListener extends java.lang.Object implements TrainingListener
TrainingListener
that outputs the progress of training each batch and epoch into logs.TrainingListener.BatchData, TrainingListener.Defaults
Constructor and Description |
---|
LoggingTrainingListener()
Constructs a
LoggingTrainingListener instance. |
LoggingTrainingListener(int frequency)
Constructs a
LoggingTrainingListener instance with specified steps. |
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.
|
public LoggingTrainingListener()
LoggingTrainingListener
instance.public LoggingTrainingListener(int frequency)
LoggingTrainingListener
instance with specified steps.
Print out logs every frequency
epoch.
frequency
- the frequency of epoch to print outpublic void onEpoch(Trainer trainer)
onEpoch
in interface TrainingListener
trainer
- the trainer the listener is attached topublic void onTrainingBatch(Trainer trainer, TrainingListener.BatchData batchData)
onTrainingBatch
in interface TrainingListener
trainer
- the trainer the listener is attached tobatchData
- the data from the batchpublic void onValidationBatch(Trainer trainer, TrainingListener.BatchData batchData)
onValidationBatch
in interface TrainingListener
trainer
- the trainer the listener is attached tobatchData
- the data from the batchpublic void onTrainingBegin(Trainer trainer)
onTrainingBegin
in interface TrainingListener
trainer
- the trainer the listener is attached topublic void onTrainingEnd(Trainer trainer)
onTrainingEnd
in interface TrainingListener
trainer
- the trainer the listener is attached to