⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bpnn.m

📁 追隨sin函數,輸出有包含物插曲線圖,到傳遞神經網路
💻 M
字号:
clc;clear% L-K-J-I ANNL=3;K=3;J=5;I=1;% eta, learning rateeta=1.e-02;% No. of epochsN=1000;% initial conditions of weight and biasW_kl=rands(K,L);W_jk=rands(J,K);W_ij=rands(I,J);th_k=rands(K,1);th_j=rands(J,1);th_i=rands(I,1);%input x; output o_i; target TT=2.5;x=[0.1;0.7;-0.3];for epoch=1:N       % % 1. forward pathh_k=W_kl*x-th_k;o_k=tansig(h_k);     %h_j=W_jk*o_k-th_j;o_j=tansig(h_j);%h_i=W_ij*o_j-th_i;o_i=h_i;            % linear% 2. error signal deltadelta_i=(T-o_i)*1;delta_j=(W_ij'*delta_i).*dtansig(h_j,o_j);delta_k=(W_jk'*delta_j).*dtansig(h_k,o_k);% 3. weight  updatingfor k=1:K   for l=1:L      W_kl(k,l)=W_kl(k,l)+eta*delta_k(k)*x(l);   endend%for j=1:J   for k=1:K      W_jk(j,k)=W_jk(j,k)+eta*delta_j(j)*o_k(k);   endend%for i=1:I   for j=1:J      W_ij(i,j)=W_ij(i,j)+eta*delta_i(i)*o_j(j);   endend% bias updatingth_k=th_k+eta*delta_k*(-1);th_j=th_j+eta*delta_j*(-1);th_i=th_i+eta*delta_i*(-1);E(epoch)=0.5*delta_i*delta_i;  % error functiony(epoch)=o_i;  %y1(epoch)=T;   %end %   plot(E),figurez=1:epoch;      %plot(z,y,z,y1,'r') % 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -