Neural Nets: gradient descent issue for polynomial functions
이전 댓글 표시
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
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 AI for Signals에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!