jhpro.nnet.jknnl
Class DefaultNeuronWithBias
- java.lang.Object
-
- jhpro.nnet.jknnl.DefaultNeuronWithBias
-
- All Implemented Interfaces:
- NeuronModel
public class DefaultNeuronWithBias extends java.lang.Object implements NeuronModel
Class representing neuron with bias and specified activation function- See Also:
ActivationFunctionModel
-
-
Constructor Summary
Constructors Constructor and Description DefaultNeuronWithBias(double[] weightArray, ActivationFunctionModel activationFunction)Creates a new instance of DefaultNeuronWithBias with specified weights defined in arrayDefaultNeuronWithBias(int weightNumber, double[] maxWeight, ActivationFunctionModel activationFunction)Creates a new instance of DefaultNeuronWithBias with random weights value
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description ActivationFunctionModelgetActivationFunction()Return reference to activation functiondoublegetBias()Return value of the biasdoublegetValue(double[] inputVector)Return value of the neuron after activation.double[]getWeight()Returns array contains value of the weightsvoidsetActivationFunction(ActivationFunctionModel activationFunction)Set activation functionvoidsetBias(double bias)Set biasvoidsetWeight(double[] weight)Set weights from array as parameter
-
-
-
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 weightsmaxWeight- maximal value of neuron weightactivationFunction- 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 valueactivationFunction- reference to activation function
-
-
Method Detail
-
getWeight
public double[] getWeight()
Returns array contains value of the weights- Specified by:
getWeightin interfaceNeuronModel- Returns:
- array of the weights
-
setWeight
public void setWeight(double[] weight)
Set weights from array as parameter- Specified by:
setWeightin interfaceNeuronModel- Parameters:
weight- array of the weights
-
getValue
public double getValue(double[] inputVector)
Return value of the neuron after activation.- Specified by:
getValuein interfaceNeuronModel- 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
-
-
DMelt 3.0 © DataMelt by jWork.ORG