cifar10怎么构建验证集?

如果不加验证集,拿测试集来调参,那么会面临一个问题,网络过拟合测试集,面对现实中的使用的鲁棒性不够好。所以需要构建验证集来验证。

主要提供想法,当你构建好训练网络,然后我的思想是在训练完毕以后,提取test set 中一个batch,

dev_set=int(num_examples_per_epoch_for_eval/batch_size)

num_examples_per_epoch_for_eval是验证集的总大小,

for i in range(1):

image_batch,label_batch=sess.run([image_test,label_test])

然后输出预测效果。这样就让你的网络有了验证集,前提是你的数据集不能使用shuffle,不然可能会影响结果。


猜你喜欢

转载自blog.csdn.net/qwe2508/article/details/80100007