我实施了深度CNN并拥有此日志:
Iter 2300, Minibatch Loss 2535.55078125, Batch Accuracy 0.800000011920929
Test accuracy = 0.7236111164093018
Iter 2400, Minibatch Loss 2402.5517578125, Batch Accuracy 0.699999988079071
Test accuracy = 0.8097222182485794
Iter 2500, Minibatch Loss 1642.6527099609375, Batch Accuracy 0.8999999761581421
Test accuracy = 0.8311110999849107
Iter 2600, Minibatch Loss 4008.334716796875, Batch Accuracy 0.8999999761581421
Test accuracy = 0.8463888929949868
Iter 2700, Minibatch Loss 2555.335205078125, Batch Accuracy 0.800000011920929
Test accuracy = 0.8077777789698706
Iter 2800, Minibatch Loss 1188.008056640625, Batch Accuracy 0.8999999761581421
Test accuracy = 0.8074999981456332
Iter 2900, Minibatch Loss 426.5060119628906, Batch Accuracy 0.8999999761581421
Test accuracy = 0.7513888908757105
Iter 3000, Minibatch Loss 5560.1845703125, Batch Accuracy 0.699999988079071
Test accuracy = 0.8733333349227907
Iter 3100, Minibatch Loss 3904.02490234375, Batch Accuracy 0.8999999761581421
Test accuracy = 0.817222214407391
Iter 3110, Minibatch Loss 9638.71875, Batch Accuracy 0.8333333134651184
Test accuracy = 0.8238888879617057
我的问题是:我是否应该等待由于某种原因完成培训,或者我可以在测试准确度最高时停止?那里是0.8733333349227907。
答案 0 :(得分:4)
当测试准确度停止增加或开始减少时,您可以停止。这称为提前停止,并且可以直接实施。 XGBoost
,Keras
和许多图书馆都有此功能:https://keras.io/callbacks/#earlystopping
尝试绘制中间值,它将为您提供有关培训过程的重要见解。请参阅http://cs231n.github.io/neural-networks-3/#accuracy。