public class Rbf
extends java.lang.Object
implements java.lang.Cloneable
Class representing a Radial Basis Function Neuron. Needed to implement RBF Neural Networks
Constructor and Description |
---|
Rbf(int ent,
int sal)
Creates a new instance of neuron/rbf
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Clones a neuron/rbf
|
double |
euclideanDist(double[] v)
Computes the euclidean distance between a neuron and a vector
|
double |
evalRbf(double[] _input)
Computes the ouput of a RBF
|
double[] |
getCenter()
Gets the vector of centres of a neuron
|
java.lang.String |
getIdRbf()
Gets the id of the neuron
|
double |
getRadius()
Gets the radius of a neuron
|
double |
getWeight(int i)
Gets the i-th weight of a neuron
|
double[] |
getWeights()
Gets the weights of a neuron
|
void |
paint()
Prints neuron on std out
|
void |
paint(java.lang.String _fileName)
Prints neuron on a file
|
void |
setCenter(double[] c)
Sets the vector of centres of a neuron
|
void |
setParam(double[] c,
double r,
double[] p)
Sets the main parameters of a neuron
|
void |
setRadius(double r)
Sets the radius of a neuron
|
void |
setWeight(int i,
double val)
Sets the ith weight of a neuron
|
void |
setWeights(double[] p)
Sets the weights of a neuron
|
public Rbf(int ent, int sal)
Creates a new instance of neuron/rbf
ent
- Number of inputssal
- Number of outputspublic java.lang.Object clone()
Clones a neuron/rbf
clone
in class java.lang.Object
public void setParam(double[] c, double r, double[] p)
Sets the main parameters of a neuron
c
- Vector of centresr
- Radiusp
- Weightspublic double[] getCenter()
Gets the vector of centres of a neuron
public void setCenter(double[] c)
Sets the vector of centres of a neuron
c
- centre of a neuron
return Nothingpublic double getRadius()
Gets the radius of a neuron
public void setRadius(double r)
Sets the radius of a neuron
r
- Radius of a neuronpublic double[] getWeights()
Gets the weights of a neuron
public void setWeights(double[] p)
Sets the weights of a neuron
p
- A vector of doubles with the weights of a neuronpublic double getWeight(int i)
Gets the i-th weight of a neuron
i
- Index of weights of a neuron to getpublic void setWeight(int i, double val)
Sets the ith weight of a neuron
i
- Index of weights of a neuron to setval
- Value of the weightpublic java.lang.String getIdRbf()
Gets the id of the neuron
public double euclideanDist(double[] v)
Computes the euclidean distance between a neuron and a vector
v
- A vectorpublic double evalRbf(double[] _input)
Computes the ouput of a RBF
_input
- Input vectorpublic void paint()
Prints neuron on std out
public void paint(java.lang.String _fileName)
Prints neuron on a file
_fileName
- Name of the file.