📄 rbf_hybrid.m
字号:
function [w,y] = rbf_hybrid(P,T,c,sig);
%
% RBF_FIXED: Radial Basis Function Network with Fixed Centers Selected at Random
% (S. Haykin, pp. 299, 1999)
%
% function [w,y] = rbf_fixed(P,T,c,pnc)
% w -> weight matrix (m1 x no)
% y -> network output (np x no)
% P -> input patterns (np x ni)
% T -> desired output (np x no)
% C -> matrix of centers (m1 x ni)
%
% Copyright (c) by Leandro Nunes de Castro
% Ph.D. at UNICAMP
% August, 2000
%
[np,ni] = size(P);
if nargin == 2, m1 = round(np/2); end;
m1 = size(c,1);
% Input layer
% sig = max(max(dist(c,c')))/sqrt(2*m1);
% aux = max(max(dist(c,c')))/sqrt(2*m1);
r = dist(P,c')./sig;
G = exp(-(r.*r)./2); % Normalized RBF
% Output layer
w = pinv(G)*T; % Linear weights in the output layer
% Network output
y = G*w;
disp(sprintf('Arquitetura da RBF [ni,nh,no]: [%d,%d,%d]',ni,m1,size(y,2)));
figure(1); clf; plot(P,T,'+'); hold on; plot(P,y,'r'); title('+: Treinamento, - : Sa韉a da RBF'); hold off;
axis([min(P)-1 max(P)+1 min(T)-.1 max(T)+.1]); hold off;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -