可用的监听器包含下列几个:
序号 | 名称 | 说明 | 备注 |
1 | EvaluativeListener | This TrainingListener implementation provides simple way for model evaluation during training. It can be launched every Xth Iteration/Epoch, depending on frequency and InvocationType constructor arguments | This callback will be invoked after evaluation finished |
2 | TimeIterationListener | Time Iteration Listener. This listener displays into INFO logs the remaining time in minutes and the date of the end of the process. Remaining time is estimated from the amount of time for training so far, and the total number of iterations specified by the user | |
3 | CheckpointListener | CheckpointListener: The goal of this listener is to periodically save a copy of the model during training.. | |
4 | ScoreIterationListener | Score iteration listener. Reports the score (value of the loss function )of the network during training every N iterations | |
5 | ParamAndGradientIterationListener | An iteration listener that provides details on parameters and gradients at each iteration during traning. Attempts to provide much of the same information as the UI histogram iteration listener, but in a text-based format (for example, when learning on a system accessed via SSH etc). i.e., is intended to aid network tuning and debugging This iteration listener is set up to calculate mean, min, max, and mean absolute value of each type of parameter and gradient in the network at each iteration. | |
6 | SleepyTrainingListener | This TrainingListener implementation provides a way to “sleep” during specific Neural Network training phases. Suitable for debugging/testing purposes only. | 所有的计时器单位都是毫秒,另外生产环境禁止使用 |
7 | ComposableIterationListener | 组合监听器 | |
8 | SharedGradient | ||
9 | CollectScoresIterationListener | CollectScoresIterationListener simply stores the model scores internally (along with the iteration) every 1 or N iterations (this is configurable). These scores can then be obtained or exported. | |
10 | CollectScoresListener | A simple listener that collects scores to a list every N iterations. Can also optionally log the score. | |
11 | Checkpoint | ||
12 | PerformanceListener | Simple IterationListener that tracks time spend on training per iteration. | |
使用方法
To add one or more listeners to a MultiLayerNetwork
or ComputationGraph
, use the addListener
method:
MultiLayerNetwork model = new MultiLayerNetwork(conf);
model.init();
//print the score with every 1 iteration
model.setListeners(new ScoreIterationListener(1));