I just started learning keras. I am trying to train a non-linear regression model in keras but model doesn\'t seem to learn much.
Your learning rate is way too high.
Also, irrelevant to your issue, but you should not ask for metrics=['accuracy']
, as this is a regression setting and accuracy is meaningless.
So, with these changes:
sgd = SGD(lr=0.001);
model.compile(loss='mse', optimizer=sgd)
plt.legend([ 'Predicted Y' ,'Actual Y']) # typo in legend :)
here are some outputs (results will be different among runs, due to the random element of your y
):