A list,
Ii. Source code
%% Clear environment variables CLC clear %% Network parameters Load traffic_flux INPUT output input_test output_test M=size(input,2); % Number of input nodes N=size(output,2); % Number of output nodes n=6; % Number of hidden nodes lr1=0.01; % learning probability lr2=0.001; % learning probability maxgen=100; % iteration times % weight initialization Wjk=randn(n,M); Wjk_1=Wjk; Wjk_2=Wjk_1; Wij=randn(N,n); Wij_1=Wij; Wij_2=Wij_1; a=randn(1,n); a_1=a; a_2=a_1; b=randn(1,n); b_1=b; b_2=b_1; Y =zeros(1,N);
net=zeros(1,n);
net_ab=zeros(1,n); D_Wjk =zeros(n,M); d_Wij=zeros(N,n); d_a=zeros(1,n);
d_b=zeros(1,n); %% Input/output data normalization [inputn,inputps]=mapminmax(input');
[outputn,outputps]=mapminmax(output');
inputn=inputn';
outputn=outputn'; %% network trainingfor i=1:maxgen % error(I)=0; % Cycle trainingfor kk=1:size(input,1)
x=inputn(kk,:);
yqw=outputn(kk,:);
for j=1:n
for k=1:M
net(j)=net(j)+Wjk(j,k)*x(k);
net_ab(j)=(net(j)-b(j))/a(j);
end
temp=mymorlet(net_ab(j));
for k=1:N y=y+Wij(k,j)*temp; Error (I)=error(I)+sum(abs(yqw-y)); % weight adjustmentfor j=1D_Wij temp=mymorlet(net_ab(j));for k=1:N d_Wij(k,j)=d_Wij(k,j)-(yqw(k)-y(k))*temp; D_Wjk temp=d_mymorlet(net_ab(j));for k=1:M
for l=1:N
d_Wjk(j,k)=d_Wjk(j,k)+(yqw(l)-y(l))*Wij(l,j) ;
end
d_Wjk(j,k)=-d_Wjk(j,k)*temp*x(k)/a(j); End % computes D_Bfor k=1:N
d_b(j)=d_b(j)+(yqw(k)-y(k))*Wij(k,j);
end
d_b(j)=d_b(j)*temp/a(j); % calculation entriesfor k=1:N
d_a(j)=d_a(j)+(yqw(k)-y(k))*Wij(k,j);
end
d_a(j)=d_a(j)*temp*((net(j)-b(j))/b(j))/a(j); End % weight parameter update Wij= wiJ-lR1 *d_Wij; Wjk=Wjk-lr1*d_Wjk; b=b-lr2*d_b; a=a-lr2*d_a; d_Wjk=zeros(n,M); d_Wij=zeros(N,n); d_a=zeros(1,n);
d_b=zeros(1,n);
y=zeros(1,N);
net=zeros(1,n);
net_ab=zeros(1,n); Wjk_1=Wjk; Wjk_2=Wjk_1; Wij_1=Wij; Wij_2=Wij_1; a_1=a; a_2=a_1; b_1=b; b_2=b_1; end endCopy the code
3. Operation results
Fourth, note
Version: 2014 a