network
Class DefaultNeuronWithBias

java.lang.Object
  extended by network.DefaultNeuronWithBias
All Implemented Interfaces:
NeuronModel

public class DefaultNeuronWithBias
extends java.lang.Object
implements NeuronModel

Class representing neuron with bias and specyfied activation function

See Also:
ActivationFunctionModel

Constructor Summary
DefaultNeuronWithBias(double[] weightArray, ActivationFunctionModel activationFunction)
          Creates a new instance of DefaultNeuronWithBias with specified weights defined in array
DefaultNeuronWithBias(int weightNumber, double[] maxWeight, ActivationFunctionModel activationFunction)
          Creates a new instance of DefaultNeuronWithBias with random weights value
 
Method Summary
 ActivationFunctionModel getActivationFunction()
          Return reference to activation function
 double getBias()
          Return value of the bias
 double getValue(double[] inputVector)
          Return value of the neuron after activation.
 double[] getWeight()
          Returns array contains valu of the weights
 void setActivationFunction(ActivationFunctionModel activationFunction)
          Set activation function
 void setBias(double bias)
          Set bias
 void setWeight(double[] weight)
          Set weigths from array as parameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultNeuronWithBias

public DefaultNeuronWithBias(int weightNumber,
                             double[] maxWeight,
                             ActivationFunctionModel activationFunction)
Creates a new instance of DefaultNeuronWithBias with random weights value

Parameters:
weightNumber - numbers of weigths
maxWeight - maximal value of neuron weight
activationFunction - reference to activation function

DefaultNeuronWithBias

public DefaultNeuronWithBias(double[] weightArray,
                             ActivationFunctionModel activationFunction)
Creates a new instance of DefaultNeuronWithBias with specified weights defined in array

Parameters:
weightArray - array of weights value
activationFunction - reference to activation function
Method Detail

getWeight

public double[] getWeight()
Returns array contains valu of the weights

Specified by:
getWeight in interface NeuronModel
Returns:
array of the weights

setWeight

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

Specified by:
setWeight in interface NeuronModel
Parameters:
weight - array of the weights

getValue

public double getValue(double[] inputVector)
Return value of the neuron after activation.

Specified by:
getValue in interface NeuronModel
Parameters:
inputVector - input vector for neuron
Returns:
return

getBias

public double getBias()
Return value of the bias

Returns:
value of the bias

setBias

public void setBias(double bias)
Set bias

Parameters:
bias - value of the bias

getActivationFunction

public ActivationFunctionModel getActivationFunction()
Return reference to activation function

Returns:
reference to activation function

setActivationFunction

public void setActivationFunction(ActivationFunctionModel activationFunction)
Set activation function

Parameters:
activationFunction - reference to activation function