Nano Brain for Unity v0.1
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Properties | List of all members
NanoBrain.MemoryCell Class Reference

Description

A MemoryCell stored its value for one update.

When the input for a Memory Cell changes, it will output the previous value

Inheritance diagram for NanoBrain.MemoryCell:
NanoBrain.Neuron NanoBrain.Nucleus

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)
 
override Nucleus ShallowCloneTo (Cluster newParent)
 
override void UpdateStateIsolated ()
 
override void UpdateNuclei ()
 Update the state and recursively all Nuclei receiving data from this Nucleus.
 
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 ()
 
void SleepCheck ()
 
override Nucleus Clone (ClusterPrefab prefab)
 Function to clone a nucleus to a Cluster prefab.
 
float3 CombinatorSum ()
 
Vector3 CombinatorSum ()
 
float3 CombinatorProduct ()
 
Vector3 CombinatorProduct ()
 
Vector3 CombinatorMax ()
 
virtual void AddReceiver (Nucleus receiverToAdd, float weight=1)
 
virtual void RemoveReceiver (Nucleus receiverToRemove)
 
virtual void ProcessStimulus (Vector3 inputValue)
 Process an external stimulus.
 
virtual void Initialize ()
 

Static Public Member Functions

static void Delete (Nucleus nucleus)
 

Public Attributes

bool staticMemory = false
 
Vector3 bias = Vector3.zero
 Create a new Neuron in a Cluster Prefab.
 
CombinatorType combinator = CombinatorType.Sum
 The type of combinator used for this Neuron.
 
ActivationType _curvePreset
 
AnimationCurve curve
 
float curveMax = 1.0f
 
Action WhenFiring
 
bool persistOutput = false
 
float lastUpdate = 0
 Toggle for printing debugging trace data.
 
readonly float timeToSleep = 1f
 
string name
 The name of the Nucleus.
 
Cluster parent
 The cluster prefab in which the nucleus is located.
 

Protected Member Functions

virtual void CloneFields (Neuron clone)
 
void CheckSleepingSynapses ()
 
float3 ActivatorLinear (float3 input)
 
Vector3 ActivatorLinear (Vector3 input)
 
float3 ActivatorSqrt (float3 input)
 
Vector3 ActivatorSqrt (Vector3 input)
 
float3 ActivatorPower (float3 input)
 
Vector3 ActivatorPower (Vector3 input)
 
float3 ActivatorReciprocal (float3 input)
 
Vector3 ActivatorReciprocal (Vector3 input)
 
float3 ActivatorTanh (float3 input)
 
float3 ActivatorBinary (float3 input)
 
float3 ActivatorNormalized (float3 input)
 
float3 ActivatorCustom (float3 input)
 
Vector3 ActivatorCustom (Vector3 input)
 

Protected Attributes

float3 _outputValue
 
Vector3 _outputValue
 

Properties

override bool isSleeping [get]
 
List< Synapsesynapses [get]
 The synapses of the nucleus.
 
ActivationType curvePreset [get, set]
 
virtual float3 outputValue [get, set]
 
virtual Vector3 outputValue [get, set]
 
float outputMagnitude [get]
 
float outputSqrMagnitude [get]
 
bool isFiring [get]
 
Func< float3 > Combinator [get]
 
Func< Vector3 > Combinator [get]
 
Func< float3, float3 > Activator [get]
 
Func< Vector3, Vector3 > Activator [get]
 
virtual List< Nucleusreceivers [get, set]
 

Member Enumeration Documentation

◆ CombinatorType

The type of combinators.

A combinator combines the weighted values of the synapses to a single value

Enumerator
Sum 

Add the weighted values together.

Product 

Multiply the weighted values.

Member Function Documentation

◆ UpdateNuclei()

override void NanoBrain.MemoryCell.UpdateNuclei ( )
virtual

Update the state and recursively all Nuclei receiving data from this Nucleus.

Reimplemented from NanoBrain.Nucleus.

◆ AddSynapse()

Synapse NanoBrain.Neuron.AddSynapse ( Neuron  sendingNucleus,
float  weight = 1 
)
inherited

Add a new synapse to this nuclues.

Parameters
sendingNucleusThe nucleus from which the signals may originate
weightThe weight applied to the input. Default value = 1
Returns
The created Synapse

This will add a new input to this nucleus with the given weight.

◆ GetSynapse()

Synapse NanoBrain.Neuron.GetSynapse ( Nucleus  sender)
inherited

Find a synapse.

Parameters
senderThe sender of the input to the Synapse
Returns
The found Synapse or null when the sender has no synapse to this nucleus.

◆ RemoveSynapse()

void NanoBrain.Neuron.RemoveSynapse ( Nucleus  sendingNucleus)
inherited

Remove a synapse from a Nucleus.

Parameters
sendingNucleusRemote the synapse connecting to this Nucleus

◆ SetBias()

virtual void NanoBrain.Neuron.SetBias ( Vector3  inputValue)
virtualinherited

Set the bias, recalculate the output and update all Nuclei receiving from this Nucleus.

Parameters
inputValue

◆ Clone()

override Nucleus NanoBrain.Neuron.Clone ( ClusterPrefab  prefab)
inherited

Function to clone a nucleus to a Cluster prefab.

Parameters
prefab
Returns

◆ ProcessStimulus()

virtual void NanoBrain.Neuron.ProcessStimulus ( Vector3  inputValue)
virtualinherited

Process an external stimulus.

Parameters
inputValueThe value of the stimulus
thingIdThe id of the thing causing the stimulus
thingNameThe name of the thing causing the stimulus

Member Data Documentation

◆ bias

Vector3 NanoBrain.Neuron.bias = Vector3.zero
inherited

Create a new Neuron in a Cluster Prefab.

Parameters
prefabThe Cluster Preafb in which the new Neuron should be created
nameThe name of the new Neuron

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

◆ parent

Cluster NanoBrain.Nucleus.parent
inherited

The cluster prefab in which the nucleus is located.

The cluster instance in which the nucleus is located


The documentation for this class was generated from the following file: