How can I update my newff functions. "Warning: NEWFF used in an obsolete way"
13 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Nikky schulz
am 9 Mär. 2022
Beantwortet: yanqi liu
am 10 Mär. 2022
My goal is to approximate the function by using a sequential mode on a backpropagation algorithm.
MATLAB is relatively new to me, and I'm having a difficult time figuring things out. Any assistance would be nice.
x=-1:0.05:1;
y=3*sin(pi*x)-cos(pi*x);
net=newff(minmax(x),[10,1],{'tansig','purelin'},'traingd');
net.trainparam.epochs=10;
xtest=-1.0:0.01:1.0;
ytest=1.2*sin(pi*xtest)-cos(2.4*pi*xtest);
net_output=sim(net,xtest);
the test results plot(xtest,ytest,'b+');
hold on;
plot(xtest,net_output,'r-');
hold off;
xlabel('x'),ylabel('y'),title('Sequential Mode, Number of Hidden Neuron = 10') legend('Target Output')
Is the code written correctly and how to rectify the warning message " NEWFF used in an obsolete way." ?
0 Kommentare
Akzeptierte Antwort
yanqi liu
am 10 Mär. 2022
yes,sir,we can ignore this warning message,such as
warning off all
x=-1:0.05:1;
y=3*sin(pi*x)-cos(pi*x);
net=newff(minmax(x),[10,1],{'tansig','purelin'},'traingd');
net.trainParam.show = 5;
net.trainParam.epochs = 1000;
net.trainParam.goal = 1e-4;
net.trainParam.lr = 0.05;
net = train(net, x, y);
xtest=-1.0:0.01:1.0;
% ytest=1.2*sin(pi*xtest)-cos(2.4*pi*xtest);
ytest=3*sin(pi*xtest)-cos(pi*xtest);
net_output=sim(net,xtest);
% the test results
plot(xtest,ytest,'b+');
hold on;
plot(xtest,net_output,'r-');
hold off;
xlabel('x'),ylabel('y'),title('Sequential Mode, Number of Hidden Neuron = 10')
legend('Target Output')
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Define Shallow Neural Network Architectures finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
