Package org.deeplearning4j.optimize.api
Class BaseTrainingListener
- java.lang.Object
-
- org.deeplearning4j.optimize.api.BaseTrainingListener
-
- All Implemented Interfaces:
TrainingListener
- Direct Known Subclasses:
CheckpointListener
,CollectScoresIterationListener
,CollectScoresListener
,ComposableIterationListener
,EvaluativeListener
,IterationListener
,PerformanceListener
,ScoreIterationListener
,SleepyTrainingListener
,TimeIterationListener
public abstract class BaseTrainingListener extends Object implements TrainingListener
-
-
Constructor Summary
Constructors Constructor Description BaseTrainingListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
iterationDone(Model model, int iteration, int epoch)
Event listener for each iteration.void
onBackwardPass(Model model)
Called once per iteration (backward pass) after gradients have been calculated, and updated Gradients are available viaModel.gradient()
.void
onEpochEnd(Model model)
Called once at the end of each epoch, when using methods such asMultiLayerNetwork.fit(DataSetIterator)
,ComputationGraph.fit(DataSetIterator)
orComputationGraph.fit(MultiDataSetIterator)
void
onEpochStart(Model model)
Called once at the start of each epoch, when using methods such asMultiLayerNetwork.fit(DataSetIterator)
,ComputationGraph.fit(DataSetIterator)
orComputationGraph.fit(MultiDataSetIterator)
void
onForwardPass(Model model, List<INDArray> activations)
Called once per iteration (forward pass) for activations (usually for aMultiLayerNetwork
), only at training timevoid
onForwardPass(Model model, Map<String,INDArray> activations)
Called once per iteration (forward pass) for activations (usually for aComputationGraph
), only at training timevoid
onGradientCalculation(Model model)
Called once per iteration (backward pass) before the gradients are updated Gradients are available viaModel.gradient()
.
-
-
-
Method Detail
-
onEpochStart
public void onEpochStart(Model model)
Description copied from interface:TrainingListener
Called once at the start of each epoch, when using methods such asMultiLayerNetwork.fit(DataSetIterator)
,ComputationGraph.fit(DataSetIterator)
orComputationGraph.fit(MultiDataSetIterator)
- Specified by:
onEpochStart
in interfaceTrainingListener
-
onEpochEnd
public void onEpochEnd(Model model)
Description copied from interface:TrainingListener
Called once at the end of each epoch, when using methods such asMultiLayerNetwork.fit(DataSetIterator)
,ComputationGraph.fit(DataSetIterator)
orComputationGraph.fit(MultiDataSetIterator)
- Specified by:
onEpochEnd
in interfaceTrainingListener
-
onForwardPass
public void onForwardPass(Model model, List<INDArray> activations)
Description copied from interface:TrainingListener
Called once per iteration (forward pass) for activations (usually for aMultiLayerNetwork
), only at training time- Specified by:
onForwardPass
in interfaceTrainingListener
- Parameters:
model
- Modelactivations
- Layer activations (including input)
-
onForwardPass
public void onForwardPass(Model model, Map<String,INDArray> activations)
Description copied from interface:TrainingListener
Called once per iteration (forward pass) for activations (usually for aComputationGraph
), only at training time- Specified by:
onForwardPass
in interfaceTrainingListener
- Parameters:
model
- Modelactivations
- Layer activations (including input)
-
onGradientCalculation
public void onGradientCalculation(Model model)
Description copied from interface:TrainingListener
Called once per iteration (backward pass) before the gradients are updated Gradients are available viaModel.gradient()
. Note that gradients will likely be updated in-place - thus they should be copied or processed synchronously in this method.For updates (gradients post learning rate/momentum/rmsprop etc) see
TrainingListener.onBackwardPass(Model)
- Specified by:
onGradientCalculation
in interfaceTrainingListener
- Parameters:
model
- Model
-
onBackwardPass
public void onBackwardPass(Model model)
Description copied from interface:TrainingListener
Called once per iteration (backward pass) after gradients have been calculated, and updated Gradients are available viaModel.gradient()
.Unlike
TrainingListener.onGradientCalculation(Model)
the gradients at this point will be post-update, rather than raw (pre-update) gradients at that method call.- Specified by:
onBackwardPass
in interfaceTrainingListener
- Parameters:
model
- Model
-
iterationDone
public void iterationDone(Model model, int iteration, int epoch)
Description copied from interface:TrainingListener
Event listener for each iteration. Called once, after each parameter update has ocurred while training the network- Specified by:
iterationDone
in interfaceTrainingListener
- Parameters:
model
- the model iteratingiteration
- the iteration
-
-