network
Class KohonenNeuron

java.lang.Object
  extended by network.KohonenNeuron
All Implemented Interfaces:
NeuronModel
Direct Known Subclasses:
KohonenNeuronWithTired

public class KohonenNeuron
extends java.lang.Object
implements NeuronModel

Class representing neuron with bias and specyfied activation function

See Also:
ActivationFunctionModel

Constructor Summary
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 specyfied numbers of weight.
 
Method Summary
 MetricModel getDistanceFunction()
          Return reference to distance function
 double getValue(double[] inputVector)
          Return value of the neuron after activation.
 double[] getWeight()
          Return array of neuron weigths
 void setDistanceFunction(MetricModel distanceFunction)
          Set distance function
 void setWeight(double[] weight)
          Set weigths from array as parameter
 java.lang.String toString()
          Returns a string representation of the NeuronModel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KohonenNeuron

public KohonenNeuron(int weightNumber,
                     double[] maxWeight,
                     ActivationFunctionModel activationFunction)
Creates new neuron with specyfied numbers of weight. Value of the weight is random where max value is definited by maxWeight. Activation function is definied by activationFunction parameter.

Parameters:
weightNumber - numbers of weight
maxWeight - max value of the weight
activationFunction - 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 weight
activationFunction - activation function
Method Detail

getWeight

public double[] getWeight()
Return array of neuron weigths

Specified by:
getWeight in interface NeuronModel
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:
getValue in interface NeuronModel
Parameters:
inputVector - input vector for neuron
Returns:
return

setWeight

public void setWeight(double[] weight)
Set weigths from array as parameter

Specified by:
setWeight in interface NeuronModel
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:
toString in class java.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