• 大小: 3KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-09
  • 语言: Matlab
  • 标签: 神经网络  

资源简介

老师布置的大作业,传上来大家共享,希望对大家有用

资源截图

代码片段和文件信息

clear all;
%x=[1.582.32-5.8;0.671.58-4.78;1.041.01-3.63;-1.492.18-3.39;-0.411.21-4.73;1.393.162.87;1.201.40-1.89;-0.921.44-3.22;0.451.33-4.38;-0.760.84-1.96;0.210.03-2.21;0.370.28-1.8;0.181.220.16;-0.240.93-1.01;-1.180.39-0.39;0.740.96-1.16;-0.381.94-0.48;0.020.72-0.17;0.441.31-0.14;0.461.490.68];
xa=[1.582.32-5.8;0.210.03-2.21;0.671.58-4.78;0.370.28-1.8;1.041.01-3.63;0.181.220.16;-1.492.18-3.39;-0.240.93-1.01;-0.411.21-4.73;-1.180.39-0.39;1.393.162.87;0.740.96-1.16;1.201.40-1.89;-0.381.94-0.48;-0.921.44-3.22;0.020.72-0.17;0.451.33-4.38;0.441.31-0.14;-0.760.84-1.96;0.461.490.68];
x=xa(1:20:);
o=-(-1).^(1:20);
t=0.1; w=2*rand(14)-1;
aj=0.1; ak=0.1;
for i=1:20
    %输入模式顺传播
    sj(i)=w(1:3)*x(i:)‘-aj;
    bj(i)=(2*1.716/(1+exp(-(2/3)*sj(i))))-1.716;    %隐含层输出
    sk(i)=w(4)*sj(i)‘-ak;
    yk(i)=(2*1.716/(1+exp(-(2/3)*sk(i))))-1.716;    %输出层输出
    %输出误差逆传播
    deltak(i)=yk(i)*(1-yk(i))*(o(i)-yk(i));   %输出层修正值
    deltaj(i)=bj(i)*(1-bj(i))*(w(4)*deltak(i));     %隐含层修正值
    w(4)=w(4)+t*deltak(i)*bj(i);
    w(1:3)=w(1:3)+t*deltaj(i)*x(i:);
    ak=t*deltak(i);
    aj=t*deltaj(i);
    e(i)=(o(i)-yk(i));
end
plot(e);

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1268  2008-11-23 21:37  神经网络\myPB.m

     文件       1417  2008-11-29 10:25  神经网络\myPB1.m

     文件       1225  2008-11-30 21:36  神经网络\myPB2.m

     文件       1350  2008-11-30 21:18  神经网络\myPB3.m

     文件        433  2008-11-29 10:35  神经网络\myrbf.m

     目录          0  2009-02-11 20:30  神经网络

----------- ---------  ---------- -----  ----

                 5693                    6


评论

共有 条评论