File Exchange

## Radial Basis Function Network

version 1.3.0.0 (8.14 KB) by Travis Wiens

### Travis Wiens (view profile)

Simulates and trains Gaussian and polyharmonic spline radial basis function networks.

49 Downloads

Updated 02 Dec 2014

View License

Radial basis functions are use for function approximation and interpolation. This package supports two popular classes of rbf: Gaussian and Polyharmonic Splines (of which the Thin Plate Spline is a subclass).
The package also calculates line integrals between two points as well as the surface's gradients.

For more information, see blog.nutaksas.com for academic papers.

VAMSI KRISHNA

sehrish shah

### sehrish shah (view profile)

i want to create a radial base network for training ? how can i create plz help me

Gereon Kremer

### Gereon Kremer (view profile)

Hello,
I am unfamiliar with the RBFN method and would need some clarification about the inputs for the function. X_t is the vector of coordinates of the points that we want to interpolate, and what is Y_t ? It could be the vector containing the function's value on the sample points but then it should be shorter than X_t..

Sonali Jena

### Sonali Jena (view profile)

Nover Yosia Lembangan Putera

### Nover Yosia Lembangan Putera (view profile)

Hai, I want to ask how to make block diagram simulink Space Vector Pulse Width Modulation based by Radial Basis Function. Please I need that block diagram, because that is my honours project on my campus.

Fadya jaw

### Fadya jaw (view profile)

num_tr = 3000;
num_te = 500;
num_hd = 20;
num_ou = 1;
num_in = 2;
num_hd = 30;
num_samp = num_tr+num_te;
width = 4;
dist = -4;
seed=3000;
rand('seed',seed);
[data1,Y1,Xt1]= double halfmoons(rad,width,dist,(num_samp./2),)
random_data=[data1,Y1]';random_seq = randperm(num_samp);random_data = random_data(:,random_seq);
X = random_data(1:2,1:num_tr)';
[indx,centers] = kmeans(X,num_hd);
pos_vector = indx';
c = centers';
%Calculating the variance for each center
for i = 1 : num_hd;

cluster_number=(i);
variance = 0;
counter2=0;
for j = 1 : num_tr;
if cluster_number==pos_vector(j)
sssss = sqrt(sum((random_data(1:2,j)'-c(:,i)').^2))
variance = sssss + variance
counter2=counter2+1;
end
end
sigma(i) = variance/counter2;
end

%Parameters For RLS
w = ones(num_ou,num_hd);
lambda=0.9
P= (lambda)^(-1)*eye(num_hd);
spread = sigma;
IN = random_data(1:2,1:num_tr);
T = random_data(3,1:num_tr);

P= (lambda)^(-1)*eye(num_hd);
w = ones(num_ou,num_hd);
num_train_min=10;
for epoch =1:50;

for m = 1:(num_tr-num_tr./10);

for i = 1:num_hd;
g(i,:) = exp(-(x-c(:,i))'*(x-c(:,i))/(2*spread(i)^2));
end

alpha = d - w*g;
w_diffrence = ((P*g)*alpha' )';
if (norm(w_diffrence) < 0.01) && (m >= num_train_min)

break;
end
w = w + w_diffrence ;
P=P-((P*g/(g'*P*g))*g'*P) ;
end

end

Fadya jaw

### Fadya jaw (view profile)

%k-mean/rls

num_tr = 3600;
num_te = 400;
num_hd = 20;
num_ou = 1;
num_in = 2;
num_hd = 30;
num_samp = num_tr+num_te;
rad = 10;
width = 6;
dist = -6;
seed=30000000;
rand('seed',seed);
[data1,Y1,Xt1]=generate_two_moons(rad,width,dist,(num_samp./2),seed,0)
random_data=[data1,Y1]';random_seq = randperm(num_samp);random_data = random_data(:,random_seq);
X = random_data(1:2,1:num_tr)';
[indx,centers] = kmeans(X,num_hd);
pos_vector = indx';
c = centers';
%Calculating the variance for each center
for i = 1 : num_hd;

cluster_number=(i);
variance = 0;
counter2=0;
for j = 1 : num_tr;
if cluster_number==pos_vector(j)
sssss = sqrt(sum((random_data(1:2,j)'-c(:,i)').^2))
variance = sssss + variance
counter2=counter2+1;
end
end
sigma(i) = variance/counter2;
end

%Parameters For RLS
w = ones(num_ou,num_hd);
lambda=0.9
P= (lambda)^(-1)*eye(num_hd);
spread = sigma;
IN = random_data(1:2,1:num_tr);
T = random_data(3,1:num_tr);

P= (lambda)^(-1)*eye(num_hd);
w = ones(num_ou,num_hd);
num_train_min=10;
for epoch =1:50;

for m = 1:(num_tr-num_tr./10);

for i = 1:num_hd;
g(i,:) = exp(-(x-c(:,i))'*(x-c(:,i))/(2*spread(i)^2));
end

alpha = d - w*g;
w_diffrence = ((P*g)*alpha' )';
if (norm(w_diffrence) < 0.01) && (m >= num_train_min)

break;
end
w = w + w_diffrence ;
P=P-((P*g/(g'*P*g))*g'*P) ;
end

end

dana gera

Bat

It is ok.
Perfect!

Bat

### Bat (view profile)

Thank you,
For the gradient, 'polyharmonicspline' case, isn't it "r.^(k_i(i)-1).*dX(:,jj).*(1+k_i(i)*log(r)" instead?

chu pingjung

Wenny Juliyanti

### Wenny Juliyanti (view profile)

hi sir..i need your help to solving my problem.. i am university student from indonesia..now i have research use metode RBF function for prediction rainfall.. in my research i have 4 input and 1 ouput which is output as rainfall..but i don't understand to use a scipt train_rbf;sim_rbf..if i input this code to windows command, it doesn't work.. could u gimme a prosedur step by step to use matlab 2014 a with metode

Shunmugesh

### Shunmugesh (view profile)

Dear Sir.,

I am new to ANN and i want to use RBF for my drilling optimization problem.
Which consist of 3 input and 3 output.
I would appreciate if you get in matlab coding.
Pl send the code to shunmugesh@gmail.com

priyadharsini ganesan

### priyadharsini ganesan (view profile)

please provide code for dual directional sparse radial basis function

hidangmayum saxena

thnk u

a shrestha

### a shrestha (view profile)

Hi,
i went through your last coding about rbf_1_02. I am just a beginner in RBF. I am working in a research for forecasting. I need a RBF network which has 5 input (environment factors) and one output(suitability index) for predicting the probability of fish catch. i would appreciate if i wil get any help in matlab coding.

Peter Ingram

Surendra Dhakal

### Surendra Dhakal (view profile)

hi,
I am a beginner in ANN and going through this code for some basic knowledge of RBF. I need to degin a RBF network(with gaussian function) for 22 inputs and 6 outputs. The problem is about the classification of breast cancer types. The 22 inputs are the features extracted from the given breast image(mammogram) and 6 outputs are the different cancer types. The second stage network is also needed with 2 or 3 outputs also(cancer stages). It would be great if you could manage some time to help me this with matlab code.
Thanks in advance!!

### Updates

 2 Dec 2014 1.3.0.0 This update adds a gradient calculator. 11 Feb 2010 1.2.0.0 Improved linear inversion. 17 Jul 2009 1.1.0.0 Removed GPL per Mathworks' requirements.
##### MATLAB Release Compatibility
Created with R2007a
Compatible with any release
##### Platform Compatibility
Windows macOS Linux

### Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.

Learn About Live Editor