jhpro.nnet.jknnl
Class KohonenNeuron
- java.lang.Object
-
- jhpro.nnet.jknnl.KohonenNeuron
-
- All Implemented Interfaces:
- NeuronModel
- Direct Known Subclasses:
- KohonenNeuronWithTired
public class KohonenNeuron extends java.lang.Object implements NeuronModel
Class representing neuron with bias and specified activation function- See Also:
ActivationFunctionModel
-
-
Constructor Summary
Constructors Constructor and Description KohonenNeuron(double[] weightArray, ActivationFunctionModel activationFunction)Creates new neuron with weight specyfied by array and specified activation funciton.KohonenNeuron(int weightNumber, double[] maxWeight, ActivationFunctionModel activationFunction)Creates new neuron with specified numbers of weight.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description MetricModelgetDistanceFunction()Return reference to distance functiondoublegetValue(double[] inputVector)Return value of the neuron after activation.double[]getWeight()Return array of neuron weigthsvoidsetDistanceFunction(MetricModel distanceFunction)Set distance functionvoidsetWeight(double[] weight)Set weights from array as parameterjava.lang.StringtoString()Returns a string representation of the NeuronModel.
-
-
-
Constructor Detail
-
KohonenNeuron
public KohonenNeuron(int weightNumber, double[] maxWeight, ActivationFunctionModel activationFunction)Creates new neuron with specified numbers of weight. Value of the weight is random where max value is definite by maxWeight. Activation function is defined by activationFunction parameter.- Parameters:
weightNumber- numbers of weightmaxWeight- max value of the weightactivationFunction- activation function
-
KohonenNeuron
public KohonenNeuron(double[] weightArray, ActivationFunctionModel activationFunction)Creates new neuron with weight specyfied by array and specified activation funciton. Numbers of weights are the same as length of the array.- Parameters:
weightArray- array of the weightactivationFunction- activation function
-
-
Method Detail
-
getWeight
public double[] getWeight()
Return array of neuron weigths- Specified by:
getWeightin interfaceNeuronModel- Returns:
- array of neuron weigths
-
getValue
public double getValue(double[] inputVector)
Return value of the neuron after activation. if activation function is not set, function return sum of the multiplication of vector v_i and weight w_i for each i (numbers of weigth and lenght of the input vector)- Specified by:
getValuein interfaceNeuronModel- Parameters:
inputVector- input vector for neuron- Returns:
- return
-
setWeight
public void setWeight(double[] weight)
Set weights from array as parameter- Specified by:
setWeightin interfaceNeuronModel- Parameters:
weight- array of the weights
-
toString
public java.lang.String toString()
Returns a string representation of the NeuronModel. NeuronModel is describe by its weights [w_1,w_2,...]- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation of the NeuronModel
-
getDistanceFunction
public MetricModel getDistanceFunction()
Return reference to distance function- Returns:
- reference to distance function
-
setDistanceFunction
public void setDistanceFunction(MetricModel distanceFunction)
Set distance function- Parameters:
distanceFunction- reference to distance function
-
-
DMelt 3.0 © DataMelt by jWork.ORG