Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members  

Neuron Class Reference

Virtual base class for all Neurons. More...

#include <amygdala/neuron.h>

Inheritance diagram for Neuron:

AlphaNeuron BasicNeuron FastNeuron List of all members.

Public Types

typedef vector< Synapse
* >::iterator 
iterator
typedef vector< Synapse
* >::const_iterator 
const_iterator
typedef vector< Synapse
* >::reverse_iterator 
reverse_iterator
typedef vector< Synapse
* >::const_reverse_iterator 
const_reverse_iterator

Public Methods

 Neuron (AmIdInt neuronId)
virtual ~Neuron ()
void SetAxonSize (int size)
int GetAxonSize () const
vector< SMPSynapse * >::iterator smpaxon_begin ()
vector< SMPSynapse * >::iterator smpaxon_end ()
AmIdInt GetAxonID (unsigned int index)
float GetAxonWeight (unsigned int index)
float GetAxonDelay (unsigned int index)
void SetParentNet (Network *const ParNet)
AmIdInt GetID ()
LayerType GetLayerType ()
void SetLayerType (LayerType _layerType)
void SetTimeConstants (float synapticConst, float membraneConst)
float GetMembraneConst () const
float GetSynapticConst () const
void SetRefractory (float period)
float GetRefractory () const
void SetLearningConst (float learnConst)
float GetLearningConst () const
void SetRestPotential (float ptnl)
float GetRestPotential () const
void SetThresholdPotential (float ptnl)
float GetThresholdPotential () const
void TrainingOn (bool mode)
bool IsTraining () const
void Inhibitory (bool val)
bool Inhibitory () const
PhysicalPropertiesGetPhysicalProperties ()
virtual const char * ClassId ()=0
virtual float * InitializeLookupTable (int index)=0
virtual float * GetTableParams (int index, int &numParams)=0
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
reverse_iterator rbegin ()
reverse_iterator rend ()
const_reverse_iterator rbegin () const
const_reverse_iterator rend () const

Static Public Methods

void CaptureOutput (OutputMode mode)
void SetSpikeOutput (SpikeOutput *output)
SpikeOutputGetSpikeOutput ()
void EnforceSign (bool enforce)
bool EnforceSign ()
bool GetMPMode ()
void EnableSpikeBatching ()

Protected Methods

virtual void InputSpike (SynapseItr &inSynapse, AmTimeInt inTime, unsigned int numSyn=0)=0
virtual void SetMaxScaledWeight ()
virtual void Train (AmTimeInt &spikeTime)
void SendSMPSpike (AmTimeInt &now)
virtual int SetLookupTables (FunctionLookup *funcRef)=0
void RoundTime (AmTimeInt &time)

Static Protected Methods

void SetMPMode (bool mode)

Protected Attributes

AmIdInt nId
LayerType layerType
bool inhibitory
float memTimeConst
float synTimeConst
float refPeriod
float synPotConst
float synDepConst
float learningMax
float posLearnTimeConst
float negLearnTimeConst
float learningConst
float thresholdPtnl
float restPtnl
float membranePtnl
float maxThreshCrs
float convergeRes
AmTimeInt schedSpikeTime
AmTimeInt spikeTime
AmTimeInt currTime
AmTimeInt inputTime
bool trainingMode
NetworkSNet
int axonSize
int initAxonSize
float maxScaledWeight
vector< Synapse * > axon
vector< SynapseHistsynapseHist
vector< InputHistinputHist
unsigned int histBeginIdx
vector< SMPSynapse * > smpAxon
unsigned int pspLSize
unsigned int pspStepSize
bool usePspLookup
PhysicalProperties physicalProperties

Static Protected Attributes

SpikeOutputspikeOutput
bool defaultOutputObj
bool enforceSign
AmTimeInt simStepSize
bool recordOutput
OutputMode outputMode

Friends

class Network
class MpNetwork
void MpSpikeInput::ReadInputBuffer ()

Detailed Description

Virtual base class for all Neurons.

Neuron provides an interface for the implementation of integrate-and-fire model neurons. Neuron cannot be instantiated as an object itself, but can only be instantiated via a child class. Neuron does not place any restrictions on how child neurons are modeled other than requiring the implementation of a set of functions that will generally be unique to each model. Neuron implementors should also be aware that Amygdala is an event driven simulator and a Neuron will only interact with the rest of the network when it receives a spike or when it is scheduled to spike itself. Methods may be added in a future version to allow stepping simulations in which active Neurons are able to calculate their states for each time step. Neuron does provide a default Hebbian training method, but child classes are able to implement their own training methods if necessary.

Notes: Neurons must be added to a Network object before they can be connected to other Neurons and used in a simulation. This can be done either directly through the Network::AddNeuron() function, or it can be done by adding a Neuron to a Layer object (via Layer::AddNeuron()) and then adding the Layer to the Network. Neurons are connected to each other using the Network::ConnectNeurons() function. Layer also provides methods for connecting groups of Neurons. Network owns all Neuron pointers once they have been added.

See also:
AlphaNeuron, BasicNeuron, FastNeuron
Author:
Matt Grover


Member Typedef Documentation

typedef vector<Synapse*>::const_iterator Neuron::const_iterator
 

Const iterator for the synapses in the axon

typedef vector<Synapse*>::const_reverse_iterator Neuron::const_reverse_iterator
 

Const reverse iterator for the synapses it the axon

typedef vector<Synapse*>::iterator Neuron::iterator
 

Iterator for the synapses in the axon

typedef vector<Synapse*>::reverse_iterator Neuron::reverse_iterator
 

Reverse iterator for the synapses in the axon


Constructor & Destructor Documentation

Neuron::Neuron AmIdInt    neuronId
 

Parameters:
neuronId  A unique, positive integer that is used to identify the neuron.


Member Function Documentation

const_iterator Neuron::begin   const [inline]
 

Returns:
a const_iterator pointing to the first synapse in the axon

iterator Neuron::begin   [inline]
 

Find the beginning of the axon.

Returns:
An iterator pointing to the first synapse in the axon

void Neuron::CaptureOutput OutputMode    mode [static]
 

Turn output on or off. Turning on will cause output neurons to call SpikeOutput::OutputEvent() every time they spike. NOTE: This function may change in a future version. Enabling and disabling output may be controlled through the SpikeOutput family of classes rather than through this call.

Parameters:
mode  One of OFF, OUTPUT_LAYERS, or ALL. OUTPUT_LAYERS mode causes output neurons to register spikes with SpikeOutput, and ALL causes all neurons to register spikes.
See also:
SpikeOutput::OutputEvent().

virtual const char* Neuron::ClassId   [pure virtual]
 

Get the class name. This is needed for xml tags. This must be implemented in all derived classes.

Returns:
The name of the class.
See also:
NetLoader::Save(), NetLoader::Load().

Implemented in AlphaNeuron.

void Neuron::EnableSpikeBatching   [static]
 

Enable spike batching mode. Simply calling this function enables spike batching and it cannot be turned off once it has been enabled. Off by default. If spike batching is enabled, then spike events are queued up until the end of the time step and then each Neuron receives all of its incoming spikes in one batch. This can sometimes result in more efficient processing (depending on how the child Neuron implements Neuron::InputSpike(). Under normal operation, Neuron::InputSpike() is called every time a spike is sent. Spike batching is always enabled if spike delays are being used.

See also:
Neuron::InputSpike(), Neuron::SendSpike().

const_iterator Neuron::end   const [inline]
 

Returns:
a const_iterator pointing to the last synapse in the axon

iterator Neuron::end   [inline]
 

Returns:
an iterator pointing to the last synapse in the axon

bool Neuron::EnforceSign   [inline, static]
 

Get the sign enforcement mode.

Returns:
True if neuron sign is being enforced, meaning that Neurons can only form inhibitory or excitatory output connections, but not both at the same time. False by default.

void Neuron::EnforceSign bool    enforce [inline, static]
 

Allow the network to force neurons to be either inhibitory or excitatory. If false, Neurons can form both inhibitory and excitatory output connections.

Parameters:
enforce  True if neuron sign should be enforced. False by default.
See also:
Neuron::Inhibitory().

float Neuron::GetAxonDelay unsigned int    index [inline]
 

Note: Axon delays are implemented as a delay between the spike time and the time that the output neuron receives the spike. This value can only be set when a connection is formed through the Network::ConnectNeurons() call, so no Set method is provided in Neuron.

Parameters:
index  Index number of a synapse on the axon. Synaptic indexes are always sequential to enable parsing.
Returns:
Spike transmission time for a synapse.

AmIdInt Neuron::GetAxonID unsigned int    index [inline]
 

Parameters:
index  Index number of a synapse on the axon. Synaptic indexes are always sequential for parsing. The index has no meaningful relationship to the neuron ID and is not guaranteed to remain constant if the network is reconstructed or reloaded from a file. This will be supplemented or replaced by an iterator in a future version.
Returns:
Neuron ID of an output neuron.

int Neuron::GetAxonSize   const [inline]
 

Returns:
Number of output synapses.

float Neuron::GetAxonWeight unsigned int    index [inline]
 

Parameters:
index  Index number of a synapse on the axon. Synaptic indexes are always sequential to allow parsing.
Returns:
Normalized weight of a connection with an output neuron.

AmIdInt Neuron::GetID   [inline]
 

Returns:
The neuron ID.

LayerType Neuron::GetLayerType   [inline]
 

Note: This will change to GetLayerRole() in a future version.

Returns:
The type of layer that the neuron belongs to (input, hidden, or output).

float Neuron::GetLearningConst   const [inline]
 

Returns:
The value of the learning constant.

float Neuron::GetMembraneConst   const [inline]
 

Returns:
The membrane time constant in ms.
See also:
Neuron::SetTimeConstants().

bool Neuron::GetMPMode   [inline, static]
 

Get the multi-processing mode.

Returns:
The run-mode of an Amygdala simulation. Returns True if multi-processing mode (multi-threaded) is in use.
See also:
Neuron::SetMPMode().

PhysicalProperties* Neuron::GetPhysicalProperties  
 

Returns:
A pointer to the physical properties of this neuron

float Neuron::GetRefractory   const [inline]
 

Returns:
The size of the refractory period in milliseconds.

float Neuron::GetRestPotential   const [inline]
 

Get the value of the rest potential in mV.

Returns:
Value of the rest potential in mV.
See also:
Neuron::SetRestPotential().

SpikeOutput* Neuron::GetSpikeOutput   [inline, static]
 

Get a pointer to a SpikeOutput object.

Returns:
A pointer to the instance of SpikeOutput currently in use.
See also:
Neuron::SetSpikeOutut().

float Neuron::GetSynapticConst   const [inline]
 

Returns:
The synaptic time constant in ms.
See also:
Neuron::SetTimeConstants().

virtual float* Neuron::GetTableParams int    index,
int &    numParams
[pure virtual]
 

This is an internal function and should only be called by FunctionLookup. This function will be either removed or made private for Amygdala 0.4.

Returns:
An array containing any values used to generate the lookup tables that were set at runtime.
Parameters:
index 
numParams  Number of unique parameters (variables) needed to generate the lookup table associated with index.

Implemented in AlphaNeuron.

float Neuron::GetThresholdPotential   const [inline]
 

Returns:
The threshold potential in mV.

bool Neuron::Inhibitory   const [inline]
 

Get the neuron sign.

Returns:
True for inhibitory neurons, false otherwise. This value has no real meaning if neuron sign is not being enforced.
See also:
Neuron::EnforceSign().

void Neuron::Inhibitory bool    val [inline]
 

Set this to true if this is is an inhibitory neuron. This function has no effect if neuron signs (positive or negative) are not being enforced.

Parameters:
val  Inhibitory status. If true, all outgoing connections will have negative weights.
See also:
Neuron::EnforceSign().

virtual float* Neuron::InitializeLookupTable int    index [pure virtual]
 

Fill a lookup table and return a pointer to the first element. Neuron::SetTableDimensions() should be called first. This is an internal function and should only be called by FunctionLookup. This function will be made private or removed completely for Amygdala 0.4.

Parameters:
index  The index of the table to be initialized.
Returns:
A pointer to the lookup table (an array of floats).

Implemented in AlphaNeuron.

virtual void Neuron::InputSpike SynapseItr &    inSynapse,
AmTimeInt    inTime,
unsigned int    numSyn = 0
[protected, pure virtual]
 

Send a spike to this Neuron. When spikes are grouped, this function will only be called once per step, but it can be called multiple times otherwise. This should only be called from other Neurons or the Network.

Parameters:
inSynapse  The synapses that the incoming spikes are crossing. (locations of the weights).
inTime  Time of input (microseconds).
numSyn  Number of synapses that are receiving input during the current time step. The default value of 0 indicates that spikes are not being grouped together and only a single spike is being passed.
See also:
Neuron::SendSpike(), Network::SendDelayedSpikes().

Implemented in AlphaNeuron.

bool Neuron::IsTraining   const [inline]
 

Returns:
Training mode
See also:
Neuron::TrainingOn().

const_reverse_iterator Neuron::rbegin   const [inline]
 

Returns:
A reverse const_iterator pointing to the first synapse in the axon

reverse_iterator Neuron::rbegin   [inline]
 

Returns:
A reverse iterator pointing to the first synapse in the axon.

const_reverse_iterator Neuron::rend   const [inline]
 

Returns:
A reverse const_iterator pointing to the last synapse in the axon

reverse_iterator Neuron::rend   [inline]
 

Returns:
A reverse iterator pointing to the last synapse in the axon.

void Neuron::RoundTime AmTimeInt &    time [inline, protected]
 

Round time to nearest simulation time step. This is done to make sure that the calculated neuron spiking times coincide with the simulation time steps.

Parameters:
time  A time value that requires rounding.

void Neuron::SendSMPSpike AmTimeInt &    now [protected]
 

Extend the Neuron::SendSpike() function. First, all local neurons receive the spike as usual. Then, the spike is sent to all other instances. TODO: Revise this note.

Parameters:
now  The current time.
See also:
Neuron::SendSpike().

void Neuron::SetAxonSize int    size
 

Set the number of output connections that will be added, if known. This should only be done BEFORE AddAxonSyn() has been called. Setting the number of outputs before adding them will often result in more efficient memory usage, but this is not required if the size is unknown.

Parameters:
size  Expected size of the axon (number of outputs).

void Neuron::SetLayerType LayerType    _layerType [inline]
 

Set the layer type for this neuron. This will change to SetNeuronRole in a future version.

Parameters:
_layerType  One of INPUTLAYER, HIDDENLAYER, OUTPUTLAYER or IOLAYER.

void Neuron::SetLearningConst float    learnConst [inline]
 

Set the learning constant.

Parameters:
learnConst  Value of the learning constant. Typical values are around 1e-5.

virtual int Neuron::SetLookupTables FunctionLookup   funcRef [protected, pure virtual]
 

Query funcRef to see if a lookup table has already been generated for an identical neuron and retrieve a pointer to the table if it has. This is an internal function and should not be called by library users.

Parameters:
funcRef  Pointer to a FunctionLookup object.

Implemented in AlphaNeuron.

virtual void Neuron::SetMaxScaledWeight   [protected, virtual]
 

Determine the maximum value of a weight for this neuron and set maxScaledWeight to this value. This will be used as the multiplication factor to convert to and from the normalized weight values that are used in the public interface.

NOTE: This function will be deprecated in version 0.4 if favor of normalizing PSP curves rather than recalculating normalized weights.

Reimplemented in AlphaNeuron.

void Neuron::SetMPMode bool    mode [inline, static, protected]
 

Turn multi-processing mode on or off. Multi-processing mode includes both multi-threaded and clustered processing. Off by default.

Parameters:
mode  Boolean value of the desired MP mode.

void Neuron::SetParentNet Network *const    ParNet [inline]
 

Set a pointer to the parent network.

Parameters:
ParNet  The Network that contains this Neuron.

void Neuron::SetRefractory float    period [inline]
 

Set the length of the refractory period. Defaults to 2 ms if not set explicitely.

Parameters:
period  Refractory period in milliseconds.

void Neuron::SetRestPotential float    ptnl [inline]
 

Set the value of the rest potential.

Parameters:
ptnl  Value of the rest potential in mV.

void Neuron::SetSpikeOutput SpikeOutput   output [static]
 

Set a pointer to a new output object. Neuron uses an instance of AmygSimpleOutput by default (until set by SetAmygOutput). Users are responsible for deleting any SpikeOutput objects that they instantiate and pass to Neuron.

Parameters:
output  Pointer to a SpikeOutput object.
See also:
Neuron::CaputureOutput(), Neuron::GetSpikeOutput, SpikeOutput::OutputEvent().

void Neuron::SetThresholdPotential float    ptnl [inline]
 

Set the threshold potential.

Parameters:
ptnl  Value of the threshold potential in mV.

void Neuron::SetTimeConstants float    synapticConst,
float    membraneConst
 

Set the synaptic and membrane time constants. Default values may vary between child classes and some child classes may not use both constants.

Parameters:
synapticConst  The synaptic time constant in milliseconds.
membraneConst  The membrane time constant in milliseconds.
See also:
Neuron::GetSynapticConst(), Neuron::GetMembraneConst().

vector<SMPSynapse*>::iterator Neuron::smpaxon_begin   [inline]
 

Returns:
an iterator for the SMP Axon

vector<SMPSynapse*>::iterator Neuron::smpaxon_end   [inline]
 

Returns:
an iterator for the SMP Axon

virtual void Neuron::Train AmTimeInt &    spikeTime [protected, virtual]
 

Train the network after firing. This assumes that some sort of Hebbian learning will be used, but children of this class should be able to either overload this to do nothing (or turn training off) and provide alternative training methods with little consequence to the rest of the neuron code. This is generally called from SendSpike().

Parameters:
spikeTime  Time of the last spike or the current time if called from SendSpike().

void Neuron::TrainingOn bool    mode [inline]
 

Set the training mode.

Parameters:
mode  Training mode, can be either true (training on) or false.
See also:
Neuron::IsTraining().


Member Data Documentation

LayerType Neuron::layerType [protected]
 

Input, Hidden, or Output layer. Will change to neuronRole in the future.

AmIdInt Neuron::nId [protected]
 

Neuron ID -- unique in network

vector<SMPSynapse*> Neuron::smpAxon [protected]
 

represents synaptic connections to Neurons on Instances on other nodes The smpAxon vector contains only the instance Ids of the target Instance. The remote Instance needs to resolve which neurons get the spike based on our InstanceID and our neuron Id.


The documentation for this class was generated from the following file:
Generated on Wed Sep 4 02:30:37 2002 for Amygdala by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002