deep learning 调试

来源:互联网 发布:淘宝店铺导航栏代码 编辑:程序博客网 时间:2024/06/07 16:20

1. 在train mnist和cifar的时候training error很大,模型应该够大,后来改变learning rate到比较小的值仍然training error下不去,后来发现是没有对图片能进行归一化,pixel的值都是255范围的


2. sess.run() 与tensor.eval():

https://stackoverflow.com/questions/33610685/in-tensorflow-what-is-the-difference-between-session-run-and-tensor-eval

Note that each call to eval and run will execute the whole graph from scratch. To cache the result of a computation, assign it to a tf.Variable.

所以如果需要同时求多个变量的值而且需要一致的时候就要注意了,只能用sess.run,比如要一致地读取image和label的值

这也是导致training error大的原因,因为label和实际的data不match,数据完全是乱的


3. 后来cifar上面可以train下去了,但是一方面training震荡现象比较严重,修改batch_size一定程度上可以改善,有时也会train不下去,这是就需要调一下learning rate,调小点

最后在cifar上train的效果不是很好,training accuracy都只有80%,后面换个更大的模型试一下


4. 一般都要对输入数据进行归一化,所以有时候不太必要调learning rate??所以keras对于Adagrad  optimizers才会这样说:

It is recommended to leave the parameters of this optimizer at their default values.

但是对于

RMSprop:

It is recommended to leave the parameters of this optimizer at their default values (except the learning rate, which can be freely tuned).

但都说明learning rate是可不跳的,,莫非keras自动会对数据进行归一化?

原创粉丝点击