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 Synapses. 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 TypeMethodDescriptionbooleanReLU activation functionvoidfromJSON(org.json.JSONObject json) Deserialize this node and its children from a JSON object and its children.doublegetBias()voidgetComponents(List<JPanel> list) Build a Swing Component that represents this Node.getIcon()Set a custom icon for this node.doubledoublegetSum()voidsetBias(double bias) voidsetModulation(double modulation) voidsetNeuronType(Neuron.Type neuronType) voidsetSum(double sum) org.json.JSONObjecttoJSON()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:NodeSerialize 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:NodeDeserialize 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:NodeBuild a Swing Component that represents this Node.- Overrides:
getComponentsin 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.
-