严格径向基网络RBF网络,概率神经网络PNN

严格径向基网络RBF网络
tic
P=-2:.2:2;
rand('state',pi);
T=P.^2+rand(1,length(P));	% 在二次函数中加入噪声
net=newrbe(P,T,3);			% newrbe(P,T)建立严格的径向基函数网络  3是径向基函数的扩散速度可任选默认1  net=newrb(P,T,0,0.6);  0是指定均放误差,0.6是径向基函数的扩散速度
test=-2:.1:2;
out=sim(net,test);			% 仿真测试
toc
figure(1);
plot(P,T,'o');
hold on;
plot(test,out,'b-');
legend('输入的数据','拟合的函数');

概率神经网络PNN 处理模式分类

rng('default');
rng(2);
a=rand(8,2)*10;			% 输入训练样本,8个二维向量
p=ceil(a)
tc=[2,1,1,1,2,1,2,1];		% 期望输出
plot(p([1,5,7],1),p([1,5,7],2),'o');
hold on;
plot(p([2,3,4,6,8],1),p([2,3,4,6,8],2),'+');
legend('第一类','第二类');
axis([0,8,1,9])
hold off
t=ind2vec(tc);          %下标变向量/得出稀疏矩阵
net=newpnn(p',t);		% 设计PNN网络
y=sim(net,p');			% 仿真
yc=vec2ind(y)			% 实际输出等于期望输出


你可能感兴趣的:(matlab,神经网络,严格径向基网络RBF网络,概率神经网络PNN)