神经网络中的Early Stop
神经网络中具体的做法如下:
1. 首先将训练数据划分为训练集和验证集(划分比例为2:1);
2. 在训练集上进行训练,并且在验证集上获取测试结果(比如每隔5个epoch测试一下),随着epoch的增加,如果在验证集上发现测试误差上升,则停止训练;
3. 将停止之后的权重作为网络的最终参数。
注:Early Stop能够防止过拟合。
- Split the training data into a training set and a validation set, e.g. in a 2-to-1 proportion.
- Train only on the training set and evaluate the per-example error on the validation set once in a while, e.g. after every fifth epoch.
- Stop training as soon as the error on the validation set is higher than it was the last time it was checked.
- Use the weights the network had in that previous step as the result of the training run.