public class Rbf
extends java.lang.Object
implements java.lang.Cloneable
This class codified a neuron or a RBF
Constructor and Description |
---|
Rbf(int inpt,
int outp)
Creates a new instance of neuron/rbf
|
Rbf(int inpt,
int outp,
int _vectors)
Creates a new instance of neuron/rbf
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Clones a neuron/rbf
|
double |
euclideaDist(double[] v)
Computes the euclidean distance between a neuron and a vector
|
double |
evaluationRbf(double[] _input)
Computes the ouput of a RBF
|
double[] |
getCentre()
Gets the vector of centres of a neuron
|
double |
getRadius()
Gets the radius of a neuron
|
double |
getWeight(int i)
Gets the ith weight of a neuron
|
double[] |
getWeights()
Gets the weights of a neuron
|
void |
printRbf()
Prints neuron on std out
|
void |
printRbf(java.lang.String _fileName)
Prints neuron on a file.
|
void |
setCentre(double[] c)
Sets the vector of centres of a neuron
|
void |
setParam(double[] c,
double r,
double[] w)
Sets the main parameters of a neuron
|
void |
setParam(double[] c,
double r,
double[] w,
int _vectors)
Sets the main parameters of a neuron
|
void |
setRadius(double r)
Sets the radius of a neuron
|
void |
setWeight(double[] w)
Sets the weights of a neuron
|
void |
setWeight(int i,
double val)
Sets the ith weight of a neuron
|
public Rbf(int inpt, int outp)
Creates a new instance of neuron/rbf
inpt
- Number of inputsoutp
- Number of outputspublic Rbf(int inpt, int outp, int _vectors)
Creates a new instance of neuron/rbf
inpt
- Number of inputsoutp
- Number of outputs_vectors
- public java.lang.Object clone()
Clones a neuron/rbf
clone
in class java.lang.Object
public void setParam(double[] c, double r, double[] w)
c
- Vector of centresr
- Radiusw
- Weightspublic void setParam(double[] c, double r, double[] w, int _vectors)
c
- Vector of centresr
- Radiusw
- Weights_vectors
- public double[] getCentre()
Gets the vector of centres of a neuron
public void setCentre(double[] c)
Sets the vector of centres of a neuron
c
- centre of a neuronpublic 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 setWeight(double[] w)
w
- A vector of doubles with the weights of a neuronpublic double getWeight(int i)
Gets the ith 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 double euclideaDist(double[] v)
Computes the euclidean distance between a neuron and a vector
v
- A vectorpublic double evaluationRbf(double[] _input)
Computes the ouput of a RBF
_input
- Input vectorpublic void printRbf()
Prints neuron on std out
public void printRbf(java.lang.String _fileName)
Prints neuron on a file.
_fileName
- Name of the file.