Keras Cifar10示例验证和测试损失低于训练损失 [英] Keras cifar10 example validation and test loss lower than training loss

查看:121
本文介绍了Keras Cifar10示例验证和测试损失低于训练损失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究Keras的cifar10示例,您可以找到这里.我已经重新创建了模型(即,不是相同的文件,但是其他所有东西几乎都一样),您可以找到它

I'm playing around with the cifar10 example from Keras which you can find here. I've recreated the model (i.e., not same file but everything else pretty much the same) and you can find it here.

模型是相同的,我在50,000个图像训练集上训练了30个时期,并进行了0.2个验证划分.我无法理解我得到的结果.我的验证和测试损失少于培训的损失(相反,与验证和测试准确性相比,培训的准确性较低):

The model is identical and I train the model for 30 epochs with 0.2 validation split on the 50,000 image training set. I'm not able to understand the result I get. My validation and testing loss is lesser than the training less (inversely, training accuracy is the lower compared to the validation and testing accuracy):

                      Loss       Accuracy
   Training          1.345          0.572
 Validation          1.184          0.596
       Test           1.19          0.596

看看情节,我不确定为什么训练误差又开始如此严重地增加.我是否需要减少训练的时期数或实施早停?不同的模型架构会有所帮助吗?如果是这样,什么是好的建议?

Looking at the plot, I'm not sure why the training error starts increasing again so badly. Do I need to reduce the number of epochs I train for or maybe implement early stopping? Would a different model architecture help? If so, what would be good suggestions?

谢谢.

推荐答案

这是一种罕见的现象,但有时会发生.造成这种情况的原因有很多:

This is a rare phenomenon but it happens from time to time. There are several reasons why this might be the case:

  • 较小的数据集具有较小的内在变化,因此这意味着您的模型可以正确捕获数据内部的模式,而训练误差则更大,这是因为的内部变化训练集大于验证集.
  • 简单事故-这也可能发生-您的拆分适合这种行为.
  • smaller datasets have smaller intrinsic variance so this means that your model properly captures patterns inside of your data and train error is greater simply because the inner variance of training set is greater then validation set.
  • Simple accident - this might also occur - that your split is suitable for such behaviour.

这篇关于Keras Cifar10示例验证和测试损失低于训练损失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆