public class KohonenNeuron extends DefaultNeuron
| Modifier and Type | Field and Description |
|---|---|
protected FunctionMetric |
distanceFunction
Distance function
|
activationFunction, learnFunction, weight| Constructor and Description |
|---|
KohonenNeuron(double[] weightArray,
FunctionMetric distanceFunction,
FunctionLearn learnFunction,
FunctionActivate activationFunction)
Creates new neuron with weight specified by array and specified activation function.
|
KohonenNeuron(int weightNumber,
double[] maxWeight,
FunctionMetric distanceFunction,
FunctionLearn learnFunction,
FunctionActivate activationFunction)
Creates new neuron with specified numbers of weight.
|
| Modifier and Type | Method and Description |
|---|---|
void |
changeNeuronWeight(double[] vector,
double factor,
double influence)
Change neuron weights for specified neuron number,factor and input data vector
|
FunctionMetric |
getDistanceFunction()
Return reference to distance function
|
FunctionLearn |
getLearnFunction()
Return reference to learn function
|
double |
getValue(double[] inputVector)
Return value of the neuron after activation.
|
boolean |
isBetter(double value1,
double value2)
Return true if value2 is better than value1, as determined by the measurements of
the distance evaluation function, or a direct comparison if there is not one.
|
void |
setDistanceFunction(FunctionMetric distanceFunction)
Set distance function
|
void |
setLearnFunction(FunctionLearn learnFunction)
Set learn function
|
java.lang.String |
toString()
Returns a string representation of the NeuronModel.
|
changeNeuronWeight, getActivationFunction, getWeight, setActivationFunction, setWeight, valueTimesWeightsprotected FunctionMetric distanceFunction
public KohonenNeuron(int weightNumber,
double[] maxWeight,
FunctionMetric distanceFunction,
FunctionLearn learnFunction,
FunctionActivate activationFunction)
weightNumber - numbers of weightmaxWeight - max value of the weight. If null or different number of entries to weightNumber,
then start with random value between 0 and 1.distanceFunction - distance function.learnFunction - reference to learning functionactivationFunction - activation function.public KohonenNeuron(double[] weightArray,
FunctionMetric distanceFunction,
FunctionLearn learnFunction,
FunctionActivate activationFunction)
weightArray - array of the weightdistanceFunction - distance function.learnFunction - reference to learning functionactivationFunction - activation function.public double getValue(double[] inputVector)
throws java.lang.Exception
getValue in interface NeuronModelgetValue in class DefaultNeuroninputVector - input vector for neuronjava.lang.Exception - any error.public void changeNeuronWeight(double[] vector,
double factor,
double influence)
throws java.lang.Exception
changeNeuronWeight in interface NeuronModelchangeNeuronWeight in class DefaultNeuronvector - input data vector.factor - the iteration number or factor.influence - cells in neighbourhood have a reduced influence.java.lang.Exception - any error.public boolean isBetter(double value1,
double value2)
throws java.lang.Exception
value1 - the first value type.value2 - the second value type.java.lang.Exception - any error.public java.lang.String toString()
toString in class java.lang.Objectpublic FunctionMetric getDistanceFunction()
public void setDistanceFunction(FunctionMetric distanceFunction)
distanceFunction - reference to distance functionpublic FunctionLearn getLearnFunction()
public void setLearnFunction(FunctionLearn learnFunction)
learnFunction - reference to learn function