Class Neuron
java.lang.Object
com.marginallyclever.ro3.node.Node
com.marginallyclever.ro3.node.nodes.neuralnetwork.Neuron
Neuron
is one of the nodes in a Brain
. Neurons have a type, a bias, a sum, and a modulation.
There are several types of neuron. When the activation function is triggered,
- Workers transmit a "normal" signal.
- Exciters change modulation in postsynaptic neurons, increasing firing probability.
- Suppressors change modulation in postsynaptic neurons, decreasing firing probability.
Neurons are connected to other neurons by Synapse
s. Neurons fire signals along synapses when
bias + modulation + sum
triggers the activation function (currently ReLU, aka >0).
The "from" end of a synapse is also known as the pre synaptic neuron. the "to" end is the post synaptic neuron.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
ReLU activation functionvoid
fromJSON
(org.json.JSONObject json) Deserialize this node and its children from a JSON object and its children.double
getBias()
void
getComponents
(List<JPanel> list) Build a Swing Component that represents this Node.getIcon()
Set a custom icon for this node.double
double
getSum()
void
setBias
(double bias) void
setModulation
(double modulation) void
setNeuronType
(Neuron.Type neuronType) void
setSum
(double sum) org.json.JSONObject
toJSON()
Serialize this node and its children to a JSON object and its children.Methods inherited from class com.marginallyclever.ro3.node.Node
addAttachListener, addChild, addChild, addDetachListener, addReadyListener, addRenameListener, findByPath, findChild, findChild, findFirstChild, findFirstSibling, findNodeByID, findParent, findParent, getAbsolutePath, getChildren, getName, getParent, getRootNode, getUniqueID, hasParent, isNameUsedBySibling, removeAttachListener, removeChild, removeDetachListener, removeReadyListener, removeRenameListener, setName, update, witnessProtection
-
Field Details
-
position
-
-
Constructor Details
-
Neuron
public Neuron() -
Neuron
-
-
Method Details
-
toJSON
public org.json.JSONObject toJSON()Description copied from class:Node
Serialize this node and its children to a JSON object and its children. Classes that override this method should call super.toJSON() first, then add to the object returned. -
fromJSON
public void fromJSON(org.json.JSONObject json) Description copied from class:Node
Deserialize this node and its children from a JSON object and its children. Classes that override this method should call super.fromJSON(). When they do it will trigger the creation of child nodes. The child nodes will then call their own fromJSON() methods. -
getIcon
-
getComponents
Description copied from class:Node
Build a Swing Component that represents this Node.- Overrides:
getComponents
in classNode
- Parameters:
list
- the list to add components to.
-
getBias
public double getBias() -
setBias
public void setBias(double bias) -
getSum
public double getSum() -
setSum
public void setSum(double sum) -
getNeuronType
-
setNeuronType
-
getModulation
public double getModulation() -
setModulation
public void setModulation(double modulation) -
activationFunction
public boolean activationFunction()ReLU activation function- Returns:
- true if the neuron should fire.
-