Brief discussion on BP and RBF

BP network, which is called global approximation neural network, needs to modify the ownership value and threshold value of the network during training. The learning speed of global approximation neural network is very slow, so its application is limited in some occasions with strong real time (real time control).

RBF network is a kind of local approximation network. For each training concept, it only needs to modify a small number of weights and thresholds, so the training speed is fast.

Matlab implementation code

Net =newrb(P,T,g,s); net=newrb(P,T,g,s); net=newrb(P,T,g,s); P: input vector T: output vector G: mean square error accuracy (fitting ability) S: dispersion constant of radial base (generalization ability) SIM (NET,P)-- simulationCopy the code

Example of function approximation


y ( x ) = 1.1 ( 1 x + 2 x 2 ) e x p ( x 2 2 ) . Y (x) = (1-1.1 x x ^ 2 + 2) exp (- \ frac {x ^ 2} {2}).

x=-4:0.08:4;
t=1.1* (1-x+2*x.^2).*exp(-x.^2/2) +0.1*rand(1.101);
plot(x,t,'+');
hold on

net=newrb(x,t,0.001.1.1000000);
Y=net(x)
figure(1)
plot(x,Y,'g');
title('RBF neural network Function approximation ');
xlabel('input');
ylabel('output');
figure(2)
e=Y-t;
plot(x,e,'b-');
Copy the code

\ begin} {aligned & = & x (t + 0.5 \ PI) sin (t + 0.5 \ PI) \ \ & = & y (t + 0.5 \ PI) cos (t + 0.5 \ PI) & = & 1.5 t \ \ \ \ z && 0 \ le2 \ \ le t PI \end{aligned} \right.
t=0:0.1:10*pi;
x=(t+0.5*pi).*sin(t+0.5*pi); 
y=(t+0.5*pi).*cos(t+0.5*pi); 
z=1.5*t;

net=newrb([x;y],z,0.001.2); % squared error is less than0.001zf=net([x;y]); % neural network output value plot3(x,y,zf,'r'); % hold on plot3(x,y,z,'+'); % Function image title('RBF neural network Function approximation ');
xlabel('x');
ylabel('y');
zlabel('z'); Grid on MSE (zf,z) % square sum errorCopy the code