elmankongtiaoyuce.m
来自「根据神经网络的相关原理」· M 代码 · 共 18 行
M
18 行
P=[0.4413 0.4707 0.6953 0.8133 0.4379 0.4677 0.6981 0.8002 0.4517 0.4725 0.7006 0.8201;
0.4379 0.4677 0.6981 0.8002 0.4517 0.4725 0.7006 0.8201 0.4557 0.4790 0.7019 0.8211;
0.4517 0.4725 0.7006 0.8201 0.4557 0.4790 0.7019 0.8211 0.4601 0.4811 0.7101 0.8298]';
T=[0.4557 0.4790 0.7019 0.8211;
0.4601 0.4811 0.7101 0.8298;
0.4612 0.4845 0.7188 0.8312]';
a=[13 17 23];
threshold=[0 1;0 1;0 1;0 1;0 1;0 1;0 1;0 1;0 1;0 1;0 1;0 1];
for i=1:3
net=newelm(threshold,[a(i),4],{'tansig','purelin'});
net.trainParam.epochs=1000;
net=init(net);
net=train(net,P,T);
y=sim(net,P);
error(i,:)=y-T;
end
t=1:4;
plot(t,error(1,:),t,error(2,:),'-.',t,error(3,:),'--')
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?