[神经网络]Matlab神经网络原理6.5.3节 - 使用newff逼近二次函数

版权声明:转载请说明Zhonglihao原创 https://blog.csdn.net/xeonmm1/article/details/83663263
clc,clear;
close all;

x = -4:.5:4;
y = x.^2 - x;
net = newff(minmax(x),minmax(y),10); % 创建一个反向传播学习网络 10个节点
net = train(net,x,y);

xx = -4:.2:4;
yy = net(xx);
plot(x,y,'o-',xx,yy,'*-');
title('新版newff');
net1 = newff(minmax(x),[10,1],{'tansig','purelin'},'trainlm');
net1 = train(net1,x,y);
yy2 = net1(xx);
figure(2);
plot(x,y,'o-',xx,yy2,'*-');
title('旧版newff')

猜你喜欢

转载自blog.csdn.net/xeonmm1/article/details/83663263