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 voiditerationDone(Model model, int iteration, int epoch)Event listener for each iteration.voidonBackwardPass(Model model)Called once per iteration (backward pass) after gradients have been calculated, and updated Gradients are available viaModel.gradient().voidonEpochEnd(Model model)Called once at the end of each epoch, when using methods such asMultiLayerNetwork.fit(DataSetIterator),ComputationGraph.fit(DataSetIterator)orComputationGraph.fit(MultiDataSetIterator)voidonEpochStart(Model model)Called once at the start of each epoch, when using methods such asMultiLayerNetwork.fit(DataSetIterator),ComputationGraph.fit(DataSetIterator)orComputationGraph.fit(MultiDataSetIterator)voidonForwardPass(Model model, List<INDArray> activations)Called once per iteration (forward pass) for activations (usually for aMultiLayerNetwork), only at training timevoidonForwardPass(Model model, Map<String,INDArray> activations)Called once per iteration (forward pass) for activations (usually for aComputationGraph), only at training timevoidonGradientCalculation(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:TrainingListenerCalled once at the start of each epoch, when using methods such asMultiLayerNetwork.fit(DataSetIterator),ComputationGraph.fit(DataSetIterator)orComputationGraph.fit(MultiDataSetIterator)- Specified by:
onEpochStartin interfaceTrainingListener
-
onEpochEnd
public void onEpochEnd(Model model)
Description copied from interface:TrainingListenerCalled once at the end of each epoch, when using methods such asMultiLayerNetwork.fit(DataSetIterator),ComputationGraph.fit(DataSetIterator)orComputationGraph.fit(MultiDataSetIterator)- Specified by:
onEpochEndin interfaceTrainingListener
-
onForwardPass
public void onForwardPass(Model model, List<INDArray> activations)
Description copied from interface:TrainingListenerCalled once per iteration (forward pass) for activations (usually for aMultiLayerNetwork), only at training time- Specified by:
onForwardPassin interfaceTrainingListener- Parameters:
model- Modelactivations- Layer activations (including input)
-
onForwardPass
public void onForwardPass(Model model, Map<String,INDArray> activations)
Description copied from interface:TrainingListenerCalled once per iteration (forward pass) for activations (usually for aComputationGraph), only at training time- Specified by:
onForwardPassin interfaceTrainingListener- Parameters:
model- Modelactivations- Layer activations (including input)
-
onGradientCalculation
public void onGradientCalculation(Model model)
Description copied from interface:TrainingListenerCalled 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:
onGradientCalculationin interfaceTrainingListener- Parameters:
model- Model
-
onBackwardPass
public void onBackwardPass(Model model)
Description copied from interface:TrainingListenerCalled 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:
onBackwardPassin interfaceTrainingListener- Parameters:
model- Model
-
iterationDone
public void iterationDone(Model model, int iteration, int epoch)
Description copied from interface:TrainingListenerEvent listener for each iteration. Called once, after each parameter update has ocurred while training the network- Specified by:
iterationDonein interfaceTrainingListener- Parameters:
model- the model iteratingiteration- the iteration
-
-