MLP in tensorflow for regression… not converging

这一生的挚爱 提交于 2019-12-07 11:43:26

A couple of points.

Your model is quite shallow being only two layers. Granted you'll need more data to train a larger model so I don't know how much data you have in the Boston data set.

What are your labels? That would better inform whether squared error is better for your model.

Also your learning rate is quite low.

You stated that your labels are in the range [0,1], but I cannot see that the predictions are in the same range. In order to make them comparable to the labels, you should transform them to the same range before returning, for example using the sigmoid function:

out_layer = tf.matmul(...)
out = tf.sigmoid(out_layer)
return out

Maybe this fixes the problem with the stability. You might also want to increase the batch size a bit, for example 20 examples per batch. If this improves the performance, you can probably increase the learning rate a bit.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!