public interface TrainingListener extends IterationListener
IterationListener
that adds onEpochStart, onEpochEnd, onForwardPass and
onBackwardPass methodsModifier and Type | Method and Description |
---|---|
void |
onBackwardPass(Model model)
Called once per iteration (backward pass) after gradients have been calculated, and updated
Gradients are available via
Model.gradient() . |
void |
onEpochEnd(Model model)
Called once at the end of each epoch, when using methods such as
MultiLayerNetwork.fit(DataSetIterator) ,
ComputationGraph.fit(DataSetIterator) or ComputationGraph.fit(MultiDataSetIterator) |
void |
onEpochStart(Model model)
Called once at the start of each epoch, when using methods such as
MultiLayerNetwork.fit(DataSetIterator) ,
ComputationGraph.fit(DataSetIterator) or ComputationGraph.fit(MultiDataSetIterator) |
void |
onForwardPass(Model model,
java.util.List<org.nd4j.linalg.api.ndarray.INDArray> activations)
Called once per iteration (forward pass) for activations (usually for a
MultiLayerNetwork ),
only at training time |
void |
onForwardPass(Model model,
java.util.Map<java.lang.String,org.nd4j.linalg.api.ndarray.INDArray> activations)
Called once per iteration (forward pass) for activations (usually for a
ComputationGraph ),
only at training time |
void |
onGradientCalculation(Model model)
Called once per iteration (backward pass) before the gradients are updated
Gradients are available via
Model.gradient() . |
invoke, invoked, iterationDone
void onEpochStart(Model model)
MultiLayerNetwork.fit(DataSetIterator)
,
ComputationGraph.fit(DataSetIterator)
or ComputationGraph.fit(MultiDataSetIterator)
void onEpochEnd(Model model)
MultiLayerNetwork.fit(DataSetIterator)
,
ComputationGraph.fit(DataSetIterator)
or ComputationGraph.fit(MultiDataSetIterator)
void onForwardPass(Model model, java.util.List<org.nd4j.linalg.api.ndarray.INDArray> activations)
MultiLayerNetwork
),
only at training timemodel
- Modelactivations
- Layer activations (including input)void onForwardPass(Model model, java.util.Map<java.lang.String,org.nd4j.linalg.api.ndarray.INDArray> activations)
ComputationGraph
),
only at training timemodel
- Modelactivations
- Layer activations (including input)void onGradientCalculation(Model model)
Model.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)
model
- Modelvoid onBackwardPass(Model model)
Model.gradient()
.
Unlike onGradientCalculation(Model)
the gradients at this point will be post-update, rather than
raw (pre-update) gradients at that method call.
model
- Model