![]() |
Nano Brain for Unity v0.1
|
A MemoryCell stored its value for one update.
When the input for a Memory Cell changes, it will output the previous value
Public Types | |
| enum | CombinatorType { Sum , Product } |
| The type of combinators. More... | |
| enum | ActivationType { Linear , Power , Sqrt , Reciprocal , Tanh , Binary , Normalized , Custom } |
| The type of. | |
| enum | Type { None , Neuron , MemoryCell , Cluster } |
| The types of Nucleus. | |
Public Member Functions | |
| MemoryCell (Cluster parent, string name) | |
| Create a new memory cell. | |
| override Nucleus | ShallowCloneTo (Cluster parent) |
| Function to make a partial clone of this nucleus. | |
| override void | UpdateStateIsolated () |
| Update the state without updating other Nuclei. | |
| Synapse | AddSynapse (Neuron sendingNucleus, float weight=1) |
| Add a new synapse to this nuclues. | |
| Synapse | GetSynapse (Nucleus sender) |
| Find a synapse. | |
| void | RemoveSynapse (Nucleus sendingNucleus) |
| Remove a synapse from a Nucleus. | |
| virtual void | SetBias (Vector3 inputValue) |
| Set the bias, recalculate the output and update all Nuclei receiving from this Nucleus. | |
| AnimationCurve | GenerateCurve () |
| Generate the curve for the current activation function. | |
| void | SleepCheck () |
| Check if the neuron is sleeping. | |
| float3 | CombinatorSum () |
| Sum the synapse outputs together. | |
| Vector3 | CombinatorSum () |
| Sum the synapse outputs together. | |
| float3 | CombinatorProduct () |
| Multiply the synapse outputs together. | |
| Vector3 | CombinatorProduct () |
| Multiply the synapse outputs together. | |
| virtual void | AddReceiver (Nucleus receiverToAdd, float weight=1) |
| Add a new receiver to this neuron. | |
| virtual void | RemoveReceiver (Nucleus receiverToRemove) |
| Remove a receiver to this neuron. | |
| virtual void | ProcessStimulus (Vector3 inputValue) |
| Process an external stimulus. | |
Static Public Member Functions | |
| static void | Delete (Nucleus nucleus) |
| Delete the give neuron. | |
Public Attributes | |
| Vector3 | bias = Vector3.zero |
| The bias. | |
| CombinatorType | combinator = CombinatorType.Sum |
| The type of combinator used for this Neuron. | |
| ActivationType | _activator |
| The activation function. | |
| AnimationCurve | curve |
| The curve representing the activation function. | |
| float | curveMax = 1.0f |
| The maximum value of the curve. | |
| Action | WhenFiring |
| An action which is called every time the neuron is updated and is firing. | |
| bool | persistOutput = false |
| When true, the value will not be reset after timeToSleep. | |
| float | lastUpdate = 0 |
| The time at which the last update has been done. | |
| readonly float | timeToSleep = 1f |
| Time in seconds after the last update the neuron can go to sleep. | |
| string | name |
| The name of the Nucleus. | |
| Cluster | parent |
| The cluster instance in which the nucleus is located. | |
Protected Member Functions | |
| virtual void | CloneFields (Neuron clone) |
| Copy relevant fields of this neuron to the given neuron. | |
| float3 | ActivatorLinear (float3 input) |
| Linear activation function. | |
| Vector3 | ActivatorLinear (Vector3 input) |
| Linear activation function. | |
| float3 | ActivatorSqrt (float3 input) |
| Square root activation function. | |
| Vector3 | ActivatorSqrt (Vector3 input) |
| Square root activation function. | |
| float3 | ActivatorPower (float3 input) |
| Power activation function. | |
| Vector3 | ActivatorPower (Vector3 input) |
| Power activation function. | |
| float3 | ActivatorReciprocal (float3 input) |
| Reciprocal activation function. | |
| Vector3 | ActivatorReciprocal (Vector3 input) |
| Reciprocal activation function. | |
| float3 | ActivatorTanh (float3 input) |
| Tanh activation function. | |
| float3 | ActivatorBinary (float3 input) |
| Binary activation function. | |
| float3 | ActivatorNormalized (float3 input) |
| Normalize activation function. | |
Protected Attributes | |
| float3 | _outputValue |
| The output value of the neuron. | |
| Vector3 | _outputValue |
| The output value of the neuron. | |
Properties | |
| List< Synapse > | synapses [get] |
| The synapses of the nucleus. | |
| ActivationType | activator [get, set] |
| The activation funtion. | |
| virtual float3 | outputValue [get, set] |
| The output value of the neuron. | |
| virtual Vector3 | outputValue [get, set] |
| The output value of the neuron. | |
| float | outputMagnitude [get] |
| The magnitude of the neuron output. | |
| float | outputSqrMagnitude [get] |
| The squared magnitude of the neuron output. | |
| bool | isFiring [get] |
| True if the neuron have a positive value with magnitude > 0.5. | |
| virtual bool | isSleeping [get] |
| True when the neuron is not persisting and has not be updated for timeToSleep seconds. | |
| Func< float3 > | Combinator [get] |
| The combinator which combines the values from all synapses. | |
| Func< Vector3 > | Combinator [get] |
| The combinator which combines the values from all synapses. | |
| virtual List< Nucleus > | receivers [get, set] |
| The nuclei which have a synapse to this neuron. | |
|
inherited |
| MemoryCell | ( | Cluster | parent, |
| string | name | ||
| ) |
Create a new memory cell.
| parent | The cluster in which the memorycell shoud be created |
| name | The name of the memory cell |
Function to make a partial clone of this nucleus.
| parent | The cluster in which the cloned nucleus should be placed |
| override void UpdateStateIsolated | ( | ) |
Update the state without updating other Nuclei.
Add a new synapse to this nuclues.
| sendingNucleus | The nucleus from which the signals may originate |
| weight | The weight applied to the input. Default value = 1 |
This will add a new input to this nucleus with the given weight.
Find a synapse.
| sender | The sender of the input to the Synapse |
|
inherited |
Remove a synapse from a Nucleus.
| sendingNucleus | Remote the synapse connecting to this Nucleus |
|
virtualinherited |
Set the bias, recalculate the output and update all Nuclei receiving from this Nucleus.
| inputValue |
|
inherited |
Generate the curve for the current activation function.
|
inherited |
Check if the neuron is sleeping.
This will reset the output value if it is sleeping
|
protectedvirtualinherited |
Copy relevant fields of this neuron to the given neuron.
| clone |
|
staticinherited |
Delete the give neuron.
| nucleus | The neuron to delete |
|
inherited |
Sum the synapse outputs together.
|
inherited |
Sum the synapse outputs together.
|
inherited |
Multiply the synapse outputs together.
|
inherited |
Multiply the synapse outputs together.
|
protectedinherited |
Linear activation function.
| input | Input value |
|
protectedinherited |
Linear activation function.
| input | Input value |
|
protectedinherited |
Square root activation function.
| input | Input value |
|
protectedinherited |
Square root activation function.
| input | Input value |
|
protectedinherited |
Power activation function.
| input | Input value |
|
protectedinherited |
Power activation function.
| input | Input value |
|
protectedinherited |
Reciprocal activation function.
| input | Input value |
|
protectedinherited |
Reciprocal activation function.
| input | Input value |
|
protectedinherited |
Tanh activation function.
| input | Input value |
|
protectedinherited |
Binary activation function.
| input | Input value |
|
protectedinherited |
Normalize activation function.
| input | Input value |
|
virtualinherited |
Add a new receiver to this neuron.
| receiverToAdd | The receiver to add |
| weight | The weight to use for the synapse to his neuron |
|
virtualinherited |
Remove a receiver to this neuron.
| receiverToRemove | The receiver to remove |
|
virtualinherited |
Process an external stimulus.
| inputValue | The value of the stimulus |
|
inherited |
The bias.
The bias which a value which is always added to the combined value of the neuron It does not have a synapse and therefore no weight of source nucleus