[y , outrules , index, dst , mf ]=anfdirect(d,w1,w2,m ,t);
mse(t)=(y-d(t,n+1)); %[T,1]
mse2(t)=(y-d(t,n+1))*(y-d(t,n+1)); %[T,1]
%Die Berechnung der Vera:nderung des Vektores w2
for r=1:n^m
dedw2t(r,t)= -mse(t)*outrules(r);%[n^m,1]
end
if (t==2)
dedw2=dedw2t(:,t)+dedw2t(:,t-1);
if (t>2)
dedw2=dedw2+dedw2t(:,t);
end
end
%Die Berechnung der Vera:nderung des Vektores w1
%/////////
Zi=(index*w2)/9; %[9:27]*[27:1] = [9:1] w2'* C'= [1:27] * [27: 9] = [1:9]
l=0;
for i=1:n
for j=1:m
l=l+1;
dedw11t(l,1,t)=-mse(t)*Zi(l)*gauss1dc(w1(l,1),w1(l,2),dst(l));
dedw12t(l,2,t)=-mse(t)*Zi(l)*gauss1dsig(w1(l,1),w1(l,2),dst(l))*dst(l);
end
end
if (t==2)
dedw11=dedw11t(:,1,t)+dedw11t(:,1,t-1);
dedw12=dedw12t(:,2,t)+dedw12t(:,2,t-1);
if (t>2)
dedw11=dedw11+dedw11t(:,1,t);
dedw12=dedw12+dedw12t(:,2,t);
end;
end;
end;
mse2=mse2' ; % [1,T]
error(ep)=sum(mse2)/(2*fff); % das Vector nach der Epoches
dedw2=dedw2/fff;
deltaw2= nju.*dedw2;
w2=w2+deltaw2;
deltaw11=nju.*dedw11/fff;
deltaw12=nju.*dedw12/fff;
w1(:,1)=w1(:,1)+deltaw11;
w1(:,2)=w1(:,2)+deltaw12;
end
plot(error);grid on ;zoom;