public class DefaultNeuronWithBias extends DefaultNeuron
activationFunction, learnFunction, weight
Constructor and Description |
---|
DefaultNeuronWithBias(double[] weightArray,
FunctionActivate activationFunction)
Creates a new instance of DefaultNeuronWithBias with specified weights
defined in array
|
DefaultNeuronWithBias(int weightNumber,
double[] maxWeight,
FunctionActivate activationFunction)
Creates a new instance of DefaultNeuronWithBias with random weights value
|
Modifier and Type | Method and Description |
---|---|
double |
getBias()
Return value of the bias
|
double |
getValue(double[] inputVector)
Return value of the neuron after activation.
|
void |
setBias(double bias)
Set bias
|
changeNeuronWeight, changeNeuronWeight, getActivationFunction, getWeight, setActivationFunction, setWeight, valueTimesWeights
public DefaultNeuronWithBias(int weightNumber, double[] maxWeight, FunctionActivate activationFunction)
weightNumber
- numbers of weigthsmaxWeight
- max value of the weight. If null or different number of entries to weightNumber
,
then start with random value between 0 and 1.activationFunction
- reference to activation functionpublic DefaultNeuronWithBias(double[] weightArray, FunctionActivate activationFunction)
weightArray
- array of weights valueactivationFunction
- reference to activation functionpublic double getValue(double[] inputVector) throws java.lang.Exception
getValue
in interface NeuronModel
getValue
in class DefaultNeuron
inputVector
- input vector for neuronjava.lang.Exception
- any error.public double getBias()
public void setBias(double bias)
bias
- value of the bias