public interface TrainingListener
BaseTrainingListener and selectively override the required methods,
instead of implementing TrainingListener directly and having a number of no-op methods.| Modifier and Type | Method and 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 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,
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,
Map<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(). |
void iterationDone(Model model, int iteration, int epoch)
iteration - the iterationmodel - the model iteratingvoid 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, List<org.nd4j.linalg.api.ndarray.INDArray> activations)
MultiLayerNetwork),
only at training timemodel - Modelactivations - Layer activations (including input)void onForwardPass(Model model, Map<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 - ModelCopyright © 2018. All rights reserved.