Node Class
This class is responsible for managing all hidden nodes and most of the functionality behind other node types that inherit it.
Node
.new
( string
activeName
, number
bias
= 0
, number
learningRate
= 0.1
) Creates and returns the Node with the given activation function, bias, and learning rate.
void
:
(
) Fires the node and fires any node that is at it's output, potentially causing a chain reaction.
This function is fired when the Node object is called, such as:
This function is fired when the Node object is called, such as:
node:()
number
:GetValue
(
) Returns the node's output value if calculated. If not, calculates it and returns the new output value.
void
:SetValue
( number
value
) Sets the node's output value to
value
.number
:CalculateValue
(
) Calculates and sets the node's new output value while also returning it.
void
:ClearValue
(
) Resets the node's output value.
void
:AddInputSynapse
( Synapse
inputSynapse
) Adds the synapse
inputSynapse
as an input synapse.void
:AddOutputSynapse
( Synapse
outputSynapse
) Adds the synapse
outputSynapse
as an output synapse.array
:GetInputSynapses
(
) Returns the input synapses.
array
:GetOutputSynapses
(
) Returns the output synapses.
void
:RemoveInputSynapse
( Synapse
inputSynapse
) Removes the input synapse
inputSynapse
.void
:RemoveOutputSynapse
( Synapse
outputSynapse
) Removes the output synapse !inputSynapse!.
void
:ClearInputSynapses
(
) Removes all input synapses.
void
:ClearOutputSynapses
(
) Removes all output synapses.
void
:SetBias
( number
bias
) Sets the node's bias to
bias
.number
:GetBias
(
) Returns the node's bias.
void
:AddBias
( number
biasDelta
) Adds
biasDelta
to the noder's bias.void
:SetLearningRate
( number
learningRate
) Sets the node's learning rate to
learningRate
.number
:GetLearningRate
(
) Returns the node's learning rate.
ActivationFunction
:GetActivationFunction
(
) Returns the node's ActivationFunction object.
void
:AddRandomNoise
( number
min
, number
max
) Adds random noise to the node's bias and input weights with the given minimum
min
and maximum max
.