Package org.deeplearning4j.optimize.api
Interface TrainingListener
-
- All Known Implementing Classes:
BaseTrainingListener
,CheckpointListener
,CollectScoresIterationListener
,CollectScoresListener
,ComposableIterationListener
,EvaluativeListener
,FailureTestingListener
,IterationListener
,PerformanceListener
,ScoreIterationListener
,SleepyTrainingListener
,TimeIterationListener
public interface TrainingListener
-
-
Method Summary
All Methods Instance Methods Abstract 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
-
iterationDone
void iterationDone(Model model, int iteration, int epoch)
Event listener for each iteration. Called once, after each parameter update has ocurred while training the network- Parameters:
iteration
- the iterationmodel
- the model iterating
-
onEpochStart
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)
-
onEpochEnd
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)
-
onForwardPass
void onForwardPass(Model model, List<INDArray> activations)
Called once per iteration (forward pass) for activations (usually for aMultiLayerNetwork
), only at training time- Parameters:
model
- Modelactivations
- Layer activations (including input)
-
onForwardPass
void onForwardPass(Model model, Map<String,INDArray> activations)
Called once per iteration (forward pass) for activations (usually for aComputationGraph
), only at training time- Parameters:
model
- Modelactivations
- Layer activations (including input)
-
onGradientCalculation
void onGradientCalculation(Model model)
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
onBackwardPass(Model)
- Parameters:
model
- Model
-
onBackwardPass
void onBackwardPass(Model model)
Called once per iteration (backward pass) after gradients have been calculated, and updated Gradients are available viaModel.gradient()
.Unlike
onGradientCalculation(Model)
the gradients at this point will be post-update, rather than raw (pre-update) gradients at that method call.- Parameters:
model
- Model
-
-