clear all net=init_net(1,4,1); x=linspace(-3,3,7)'; xx=linspace(-4,4,101); z=0.5*exp(-x.^2); zz=0.5*exp(-xx.^2); figure(1) subplot(121) plot(xx,zz,x,z,'o') title('z gaussa na przedziale -3 3 wybieramy 11 punktow'); pause(1) eta1=0;%0.15; eta2=0;%0.5;%0.0; zanikanie=1; for lekcja = 1:600 % ind=randperm(length(x)); % x=x(ind); % z=z(ind); sz=z;%+1/lekcja*z.*randn(size(z)); [net,Q]=ucz_net(net,x,sz,zanikanie); d(lekcja)=Q; if mod(lekcja,10)==0 for i=1:length(xx) net=sim_net(net,xx(i)); yy(i)=net.out(1).out; end subplot(121) plot(x,z,'o',xx,zz,'b',xx,yy,'r',xx,zz-yy) title(sprintf('aproksymacja gaussa z 11 punktow po %d krokach uczenia',lekcja)); subplot(122) sk=1:lekcja; semilogy(sk,d,'r') drawnow end end