这个损失,一会下降一会上升,准确率也不固定
来源:2-6 数据处理与模型图构建(2)
慕前端7108009
2019-11-05
【train】step: 0 ,loss: 0.45000 , acc: 0.55000 ,
【train】step: 500 ,loss: 0.35000 , acc: 0.65000 ,
【train】step: 1000 ,loss: 0.30000 , acc: 0.70000 ,
【train】step: 1500 ,loss: 0.60000 , acc: 0.40000 ,
【train】step: 2000 ,loss: 0.70000 , acc: 0.30000 ,
【train】step: 2500 ,loss: 0.20000 , acc: 0.80000 ,
【train】step: 3000 ,loss: 0.40000 , acc: 0.60000 ,
【train】step: 3500 ,loss: 0.35000 , acc: 0.65000 ,
【train】step: 4000 ,loss: 0.25000 , acc: 0.75000 ,
【train】step: 4500 ,loss: 0.65000 , acc: 0.35000 ,
【train】step: 5000 ,loss: 0.50000 , acc: 0.50000 ,
【train】step: 5500 ,loss: 0.50000 , acc: 0.50000 ,
【train】step: 6000 ,loss: 0.70000 , acc: 0.30000 ,
【train】step: 6500 ,loss: 0.65000 , acc: 0.35000 ,
【train】step: 7000 ,loss: 0.40000 , acc: 0.60000 ,
【train】step: 7500 ,loss: 0.45000 , acc: 0.55000 ,
【train】step: 8000 ,loss: 0.40000 , acc: 0.60000 ,
【train】step: 8500 ,loss: 0.55000 , acc: 0.45000 ,
【train】step: 9000 ,loss: 0.60000 , acc: 0.40000 ,
【train】step: 9500 ,loss: 0.50000 , acc: 0.50000 ,
还有test数据需要做归一化吗
跑老师代码也是一样的
(10000, 3072)
(10000,)
[Test ] Step: 95000, acc: 0.49300
[Train] Step: 95500, loss: 0.39210, acc: 0.90000
[Train] Step: 96000, loss: 0.88873, acc: 0.60000
[Train] Step: 96500, loss: 0.31466, acc: 0.90000
[Train] Step: 97000, loss: 0.72933, acc: 0.70000
[Train] Step: 97500, loss: 0.19846, acc: 0.90000
[Train] Step: 98000, loss: 1.13400, acc: 0.60000
[Train] Step: 98500, loss: 0.49486, acc: 0.85000
[Train] Step: 99000, loss: 0.61335, acc: 0.80000
[Train] Step: 99500, loss: 0.77424, acc: 0.75000
[Train] Step: 100000, loss: 0.60733, acc: 0.80000
(10000, 3072)
(10000,)
[Test ] Step: 100000, acc: 0.49000
1回答
-
正十七
2019-11-17
归一化的话,需要所有的数据集都做一致的操作,所以train/valid/test要做归一化都得做归一化。
loss忽高忽低的情况,可能是因为learning_rate太大,可以尝试用一个小的learning_rate,或者让learning_rate随着迭代次数递减!
00
相似问题