我正在使用Keras进行多类分类问题。我使用EarlyStopping(monitor='val_loss', patience=4)
作为学习的停止标准,即如果验证损失在4个时期内没有减少,则训练停止。使用val_acc作为停止标准还是val_loss更好?因为我看到val_loss增加了但也增加了val_acc。考虑以下输出Epoch 8和Epoch 13。
Epoch 1/200
240703/240703 [==============================] - 4831s - loss: 0.8581 - acc: 0.7603 - val_loss: 0.6247 - val_acc: 0.8160
Epoch 2/200
240703/240703 [==============================] - 4855s - loss: 0.6099 - acc: 0.8166 - val_loss: 0.5742 - val_acc: 0.8300
Epoch 3/200
240703/240703 [==============================] - 4627s - loss: 0.5573 - acc: 0.8308 - val_loss: 0.5600 - val_acc: 0.8337
Epoch 4/200
240703/240703 [==============================] - 4624s - loss: 0.5265 - acc: 0.8395 - val_loss: 0.5550 - val_acc: 0.8347
Epoch 5/200
240703/240703 [==============================] - 4623s - loss: 0.5042 - acc: 0.8452 - val_loss: 0.5529 - val_acc: 0.8377
Epoch 6/200
240703/240703 [==============================] - 4624s - loss: 0.4879 - acc: 0.8507 - val_loss: 0.5521 - val_acc: 0.8378
Epoch 7/200
240703/240703 [==============================] - 4625s - loss: 0.4726 - acc: 0.8555 - val_loss: 0.5554 - val_acc: 0.8383
Epoch 8/200
240703/240703 [==============================] - 4621s - loss: 0.4604 - acc: 0.8585 - val_loss: 0.5513 - val_acc: 0.8383
Epoch 9/200
240703/240703 [==============================] - 4716s - loss: 0.4508 - acc: 0.8606 - val_loss: 0.5649 - val_acc: 0.8366
Epoch 10/200
240703/240703 [==============================] - 4602s - loss: 0.4409 - acc: 0.8637 - val_loss: 0.5626 - val_acc: 0.8389
Epoch 11/200
240703/240703 [==============================] - 4651s - loss: 0.4318 - acc: 0.8662 - val_loss: 0.5710 - val_acc: 0.8387
Epoch 12/200
240703/240703 [==============================] - 4706s - loss: 0.4239 - acc: 0.8687 - val_loss: 0.5737 - val_acc: 0.8384
Epoch 13/200
240703/240703 [==============================] - 4706s - loss: 0.4190 - acc: 0.8698 - val_loss: 0.5730 - val_acc: 0.8391
答案 0 :(得分:4)
一般而言,损失是比准确度更好的衡量标准,因为它具有<更高精度。准确度与验证集中的样本数量一样多。另一方面,损失具有连续可能的值,因此您可以更精确地跟踪发生的情况。另一方面,准确性更容易分析,因为它是可解释的(它只是一个百分比),因此如果没有该领域的专业知识 - 基于损失的标准将更难使用,但可能稍微更精确(如果正确使用)。