Hi all, I am just getting started with the neural network toolbox. Our teacher asked us to use feedforwardnet to approximate a noiseless non-linear function.
I tried several example with success, but now, I am moving to simple polynomial functions and seem to be getting problems with the 'traingd' method (which I used with success (though sub-optimal by far) with other functions such as sin(x), tanh(x), etc.)
Anyway, whatever polynomial I try to learn, it fails after a few epochs, and the only thing I can see is that the gradient becomes larger and larger at each epoch, until it finally becomes 'NaN'.
Is this to be expected or am I missing something? Why would other non-linear function work but not the polynomial ones.
Here is my code with an example of polynomial function (y):
x = 0:1:1000 ; y = x.^2 + 1; p=con2seq(x); t=con2seq(y);net1 = feedforwardnet(10,'traingd');net1 = train(net1,p,t);
Thanks in advance for your help,
Best, Sedrik
Best Answer