Keras中model.evaluate()的最佳batch_size? [英] Optimum batch_size for model.evaluate() in Keras?

查看:865
本文介绍了Keras中model.evaluate()的最佳batch_size?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

训练精度和验证精度接近0.87,但是在测试部分中,使用evaluate()功能会根据不同的batch_size参数值给出波动的结果.测试精度从0.5到0.66不等.评估的最佳batch_size值是否必须与fit()中的值相同?

Training accuracy and validation accuracy gives nearly 0.87, but in testing part using evaluate() function gives fluctuated results according to different batch_size parameter values. Testing accuracy varies from 0.5 to 0.66. Is the optimum batch_size value for evaluate has to be same as in fit()?

推荐答案

我没有看到评估函数的批处理大小参数如何改变模型的准确性.仅训练期间使用的批次大小可以修改模型的性能(请参见

I don't see how the batch size parameter of the evaluate function can change the accuracy of your model. Only the batch size used during the training can modify the performances of your model (see this). Are you testing the same trained model for your different tests? If you're testing newly trained models every time, it explains the variation of accuracy you observe (because of the random initialization of the weights for example).

这篇关于Keras中model.evaluate()的最佳batch_size?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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