How can I update my newff functions. "Warning: NEWFF used in an obsolete way"
13 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
yanqi liu
on 10 Mar 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 Comments
More Answers (0)
See Also
Categories
Find more on Define Shallow Neural Network Architectures in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!