Auryn simulator  v0.8.1-206-gb56e451
Plastic Spiking Neural Network Simulator
Public Member Functions | Public Attributes | List of all members
auryn::SRM0Group Class Reference

Implements SRM0 neuron model with escape noise. More...

#include <SRM0Group.h>

Inheritance diagram for auryn::SRM0Group:
Inheritance graph
[legend]
Collaboration diagram for auryn::SRM0Group:
Collaboration graph
[legend]

Public Member Functions

 SRM0Group (NeuronID size)
 
virtual ~SRM0Group ()
 
void draw (NeuronID i)
 Redraws random waiting times neuron i. More...
 
void draw_all ()
 Redraws random waiting times for all neurons. More...
 
void set_tau_mem (AurynFloat taum)
 
void clear ()
 
void evolve ()
 
void seed (unsigned int s)
 Seed the random number generator of all SRM0Group instances. More...
 
- Public Member Functions inherited from auryn::NeuronGroup
 NeuronGroup (NeuronID n, NodeDistributionMode mode=AUTO)
 Default constructor. More...
 
 NeuronGroup (NeuronID n, double loadmultiplier, NeuronID total)
 Old default constructor. More...
 
virtual ~NeuronGroup ()
 
void set_state (std::string name, AurynState val)
 Conveniently sets all values in a state vector identified by name in this group. More...
 
void set_state (std::string name, NeuronID i, AurynState val)
 Conveniently sets a single value of element i in a state vector identified by name in this group. More...
 
virtual AurynStateVectorget_default_exc_target ()
 Returns default exc target input. More...
 
virtual AurynStateVectorget_default_inh_target ()
 Returns default inh target input. More...
 
void random_mem (AurynState mean=-60e-3, AurynState sigma=5e-3)
 
virtual void init_state ()
 
void safe_tadd (NeuronID id, AurynWeight amount, TransmitterType t=GLUT)
 
void tadd (NeuronID id, AurynWeight amount, TransmitterType t=GLUT)
 
void tadd (AurynStateVector *state, NeuronID id, AurynWeight amount)
 
- Public Member Functions inherited from auryn::SpikingGroup
void add_state_vector (std::string key, AurynStateVector *state_vector)
 Adds a state vector passed as an argument to the dictinary. More...
 
void remove_state_vector (std::string key)
 Removes a state vector passed as an argument to the dictinary. More...
 
AurynStateVectorfind_state_vector (std::string key)
 Returns existing state vector by name or NULL if it does not exist. More...
 
AurynStateVectorget_state_vector (std::string key)
 Creates a new or returns an existing state vector by name. More...
 
AurynStateVectorget_existing_state_vector (std::string key)
 Returns an existing state with the supplied name. More...
 
AurynStateVectorcreate_state_vector (std::string key)
 Creates a new state vector and throws an exception if a vector with the same name exists. More...
 
AurynStateget_state_variable (std::string key)
 Creates a new group-wide state variable or returns an existing group-wide variable by name then returns a pointer to it. More...
 
void randomize_state_vector_gauss (std::string state_vector_name, AurynState mean, AurynState sigma, int seed=12239)
 Randomizes the content of a state vector with Gaussian random numbers. Seeding is MPI save. More...
 
 SpikingGroup (NeuronID size, NodeDistributionMode mode=AUTO)
 Default constructor. More...
 
virtual ~SpikingGroup ()
 Default destructor. More...
 
virtual void evolve_traces ()
 Evolves traces. More...
 
void set_name (std::string s)
 Set connection name. More...
 
std::string get_name ()
 Retrieves the groups name. More...
 
std::string get_file_name ()
 Extracts the class name of the connection from the file name. More...
 
std::string get_log_name ()
 Returns a string which is the combination of file and connection name for logging. More...
 
void inc_num_spike_attributes (int x)
 Instructs SpikingGroup to increase the number of spike attributes by x. More...
 
int get_num_spike_attributes ()
 
void conditional_evolve ()
 Conditional evolve functino which is called by System. More...
 
unsigned int get_locked_rank ()
 Returns locked rank for SpikingGroups which are not distributed across all ranks. More...
 
unsigned int get_locked_range ()
 Returns locked range of ranks for SpikingGroups which are not distributed across all ranks. More...
 
SpikeContainerget_spikes ()
 Returns pointer to a spike container that contains spikes which arrive in this timestep from all neurons in this group. More...
 
SpikeContainerget_spikes_immediate ()
 Returns pointer to SpikeContainer of spikes generated during the last evolve() step. More...
 
AttributeContainerget_attributes ()
 Returns pointer to Attributecontainer for usage in propagating Connection objects. Same as get_spikes_immediate(), however might be overwritten to contain Spikes that have been delayed. More...
 
AttributeContainerget_attributes_immediate ()
 Returns pointer to Attributecontainer of spikes generated during the last evolve() step. More...
 
NeuronID get_size ()
 Returns the size of the group. More...
 
NeuronID get_pre_size ()
 Returns the size of the group. More...
 
NeuronID calculate_rank_size (int rank=-1)
 Determines rank size and stores it in local variable. More...
 
NeuronID get_rank_size ()
 Returns the size on this rank. More...
 
NeuronID get_post_size ()
 Returns the size on this rank. More...
 
void set_clock_ptr (AurynTime *clock)
 
bool evolve_locally ()
 Returns true if the calling instance has units which are integrated on the current rank. More...
 
NeuronID get_uid ()
 Get the unique ID of the class. More...
 
Traceget_pre_trace (AurynFloat x)
 Returns a pre trace with time constant x. More...
 
void add_pre_trace (Trace *tr)
 Adds trace to pretrace stack of a connection. More...
 
Traceget_post_trace (AurynFloat x)
 Returns a post trace with time constant x. More...
 
void add_post_trace (Trace *tr)
 Adds trace to posttrace stack of a connection. More...
 
void push_spike (NeuronID spike)
 Pushes a local NeuronID as spike into the axonal SpikeDelay buffer. More...
 
void push_attribute (AurynFloat attrib)
 Pushes a spike attribute into the axonal SpikeDelay buffer. More...
 
void clear_spikes ()
 Clears all spikes stored in the delays which is useful to reset a network during runtime. More...
 
Traceget_post_state_trace (std::string state_name="mem", AurynFloat tau=10e-3, AurynFloat b=0.0)
 Returns a post trace of a neuronal state variable e.g. the membrane potential with time constant tau. More...
 
Traceget_post_state_trace (AurynStateVector *state, AurynFloat tau=10e-3, AurynFloat b=0.0)
 Returns a post trace of a neuronal state variable specified by pointer. More...
 
void set_delay (int d)
 Sets axonal delay for this SpikingGroup. More...
 
virtual bool write_to_file (const char *filename)
 Writes current states of SpikingGroup to human-readible textfile if implemented in derived class. More...
 
virtual bool load_from_file (const char *filename)
 Reads current states of SpikingGroup to human-readible textfile if implemented in derived class. More...
 
NeuronID ranksize ()
 Returns size (num of neurons) on the current rank. More...
 
NeuronID global2rank (NeuronID i)
 Converts global NeuronID within the SpikingGroup to the local NeuronID on this rank. More...
 
NeuronID rank2global (NeuronID i)
 Converts local NeuronID from the local rank to a global NeuronID. More...
 
bool localrank (NeuronID i)
 Checks if the global NeuronID i is integrated on this MPI rank. More...
 
NeuronID get_vector_size ()
 Rank size but rounded up to multiples of 4 (or potentially some other and larger number in future versions) for SSE compatibility. More...
 

Public Attributes

AurynFloat rho0
 Mean firing rate rate at threshold. More...
 
AurynFloat delta_u
 Spike sharpness parameter delta u. More...
 
- Public Attributes inherited from auryn::NeuronGroup
AurynStateVectormem
 
AurynStateVectorg_ampa
 
AurynStateVectorg_gaba
 
AurynStateVectorg_nmda
 
AurynStateVectorthr
 
- Public Attributes inherited from auryn::SpikingGroup
SpikeDelaydelay
 
bool active
 Toggles group active. More...
 
std::map< std::string, AurynStateVector * > state_vectors
 
std::map< std::string, AurynStatestate_variables
 

Additional Inherited Members

- Protected Member Functions inherited from auryn::NeuronGroup
void init ()
 
void free ()
 
- Protected Member Functions inherited from auryn::SpikingGroup
virtual void load_input_line (NeuronID i, const char *buf)
 
virtual std::string get_output_line (NeuronID i)
 
virtual void virtual_serialize (boost::archive::binary_oarchive &ar, const unsigned int version)
 Implementatinon of serialize function for writing. More...
 
virtual void virtual_serialize (boost::archive::binary_iarchive &ar, const unsigned int version)
 Implementatinon of serialize function for reading. More...
 
void free ()
 Frees potentially allocated memory. More...
 
- Protected Attributes inherited from auryn::NeuronGroup
AurynStateVectordefault_exc_target_state
 
AurynStateVectordefault_inh_target_state
 
- Protected Attributes inherited from auryn::SpikingGroup
std::vector< Trace * > pretraces
 Pretraces. More...
 
std::vector< Trace * > posttraces
 Posttraces. More...
 
std::vector< Trace * > post_state_traces
 Post state traces. More...
 
std::vector< AurynFloatpost_state_traces_spike_biases
 
std::vector< AurynStateVector * > post_state_traces_states
 
std::string group_name
 Identifying name for object. More...
 
NeuronID size
 Stores the size of the group. More...
 
NeuronID rank_size
 Stores the size of the group on this rank. More...
 
SpikeContainerspikes
 SpikeContainers to store spikes produced during one step of evolve. More...
 
AttributeContainerattribs
 
- Static Protected Attributes inherited from auryn::SpikingGroup
static AurynTimeclock_ptr = NULL
 

Detailed Description

Implements SRM0 neuron model with escape noise.

For a detailed introduction to the SRM and SRM0 neuron models see Gerstner, W., Kistler, W.M., Naud, R., and Paninski, L. (2014). Neuronal dynamics: from single neurons to networks and models of cognition (Cambridge: Cambridge University Press).

Constructor & Destructor Documentation

◆ SRM0Group()

SRM0Group::SRM0Group ( NeuronID  size)

The default constructor of this NeuronGroup

32  : NeuronGroup(size)
33 {
35  if ( evolve_locally() ) init();
36 }
NeuronGroup(NeuronID n, NodeDistributionMode mode=AUTO)
Default constructor.
Definition: NeuronGroup.cpp:36
bool evolve_locally()
Returns true if the calling instance has units which are integrated on the current rank...
Definition: SpikingGroup.cpp:323
System * sys
Global pointer to instance of System which needs to be initialized in every simulation main program...
Definition: auryn_global.cpp:37
void register_spiking_group(SpikingGroup *spiking_group)
Registers an instance of SpikingGroup to the spiking_groups vector.
Definition: System.cpp:261
NeuronID size
Stores the size of the group.
Definition: SpikingGroup.h:119
Here is the call graph for this function:

◆ ~SRM0Group()

SRM0Group::~SRM0Group ( )
virtual
93 {
94  if ( !evolve_locally() ) return;
95 
96  delete dist;
97  delete die;
98 }
bool evolve_locally()
Returns true if the calling instance has units which are integrated on the current rank...
Definition: SpikingGroup.cpp:323
Here is the call graph for this function:

Member Function Documentation

◆ clear()

void SRM0Group::clear ( )
virtual

Resets all neurons to defined and identical initial state.

Implements auryn::NeuronGroup.

85 {
86  clear_spikes();
87  mem->set_all( e_rest);
88  draw_all();
89 }
void draw_all()
Redraws random waiting times for all neurons.
Definition: SRM0Group.cpp:77
void set_all(const T v)
Set all elements to value v.
Definition: AurynVector.h:232
void clear_spikes()
Clears all spikes stored in the delays which is useful to reset a network during runtime.
Definition: SpikingGroup.cpp:339
AurynStateVector * mem
Definition: NeuronGroup.h:64
Here is the call graph for this function:

◆ draw()

void SRM0Group::draw ( NeuronID  i)

Redraws random waiting times neuron i.

72 {
73  const AurynDouble r = (*die)();
74  warped_lifetime->set(i,r);
75 }
r
Definition: mkpat.py:9
double AurynDouble
Higher precision floating point datatype.
Definition: auryn_definitions.h:158
void set(IndexType i, T value)
Sets element i in vector to value.
Definition: AurynVector.h:224
Here is the call graph for this function:

◆ draw_all()

void SRM0Group::draw_all ( )

Redraws random waiting times for all neurons.

78 {
79  for ( NeuronID i = 0 ; i < get_post_size() ; ++i ) {
80  draw(i);
81  }
82 }
void draw(NeuronID i)
Redraws random waiting times neuron i.
Definition: SRM0Group.cpp:71
NeuronID get_post_size()
Returns the size on this rank.
Definition: SpikingGroup.cpp:314
unsigned int NeuronID
NeuronID is an unsigned integeger type used to index neurons in Auryn.
Definition: auryn_definitions.h:151
Here is the call graph for this function:

◆ evolve()

void SRM0Group::evolve ( )
virtual

The evolve method internally used by System.

Implements auryn::SpikingGroup.

102 {
103  // integrate membrane
104  // compute current
105  temp->diff(e_rest, mem); // leak current
106  temp->add(syn_current); // syn_current
107 
108  // membrane dynamics
109  mem->saxpy(scale_mem,temp);
110 
111  // lifetime decrement
112  // compute instantaneous firing rate
113  temp->diff(mem,thr);
114  temp->mul(1.0/delta_u);
115  temp->fast_exp();
116  // temp->set_all(1.0); // for testing at fixed voltage values
117  temp->mul(auryn_timestep*rho0);
118 
119 
120  // decrease ttls by warped time
121  warped_lifetime->sub(temp);
122 
123  // hard refractory time (clamped to zero)
124  for (NeuronID i = 0 ; i < get_rank_size() ; ++i ) {
125  // stochastic spike generation TODO
126  if (warped_lifetime->get(i)<0.0) {
127  push_spike(i);
128  draw(i);
129  mem->set(i, e_rest);
130  }
131  }
132 
133  syn_current->scale(scale_syn);
134 }
NeuronID get_rank_size()
Returns the size on this rank.
Definition: SpikingGroup.h:450
AurynFloat rho0
Mean firing rate rate at threshold.
Definition: SRM0Group.h:77
void sub(const T c)
Subtract constant c to each vector element.
Definition: AurynVector.h:288
void diff(AurynVectorFloat *a, AurynVectorFloat *b)
Definition: AurynVector.cpp:262
void mul(const float a)
Definition: AurynVector.h:819
void set(IndexType i, T value)
Sets element i in vector to value.
Definition: AurynVector.h:224
void fast_exp()
Computes an approximation of exp(x) for each vector element.
Definition: AurynVector.h:416
void scale(const float a)
Definition: AurynVector.cpp:74
T get(IndexType i)
Gets element i from vector.
Definition: AurynVector.h:207
void draw(NeuronID i)
Redraws random waiting times neuron i.
Definition: SRM0Group.cpp:71
double auryn_timestep
Simulation timestep in seconds.
Definition: auryn_definitions.cpp:31
void push_spike(NeuronID spike)
Pushes a local NeuronID as spike into the axonal SpikeDelay buffer.
Definition: SpikingGroup.cpp:270
void add(const float c)
Definition: AurynVector.cpp:180
void saxpy(const float a, AurynVectorFloat *x)
Definition: AurynVector.cpp:96
AurynStateVector * mem
Definition: NeuronGroup.h:64
AurynFloat delta_u
Spike sharpness parameter delta u.
Definition: SRM0Group.h:80
unsigned int NeuronID
NeuronID is an unsigned integeger type used to index neurons in Auryn.
Definition: auryn_definitions.h:151
Here is the call graph for this function:

◆ seed()

void SRM0Group::seed ( unsigned int  s)

Seed the random number generator of all SRM0Group instances.

143 {
144  std::stringstream oss;
145  oss << "SRM0Group:: Seeding with " << s
146  << " and " << salt << " salt";
147  auryn::logger->msg(oss.str(),NOTIFICATION);
148 
149  gen.seed( s + salt );
150 }
Definition: Logger.h:41
Logger * logger
Global pointer to instance of Logger which needs to be initialized in every simulation main program...
Definition: auryn_global.cpp:36
void msg(std::string text, LogMessageType type=NOTIFICATION, bool global=false, int line=-1, std::string srcfile="")
Definition: Logger.cpp:74
Here is the call graph for this function:

◆ set_tau_mem()

void SRM0Group::set_tau_mem ( AurynFloat  taum)

Sets the membrane time constant (default 20ms)

137 {
138  tau_mem = taum;
139  calculate_scale_constants();
140 }

Member Data Documentation

◆ delta_u

AurynFloat auryn::SRM0Group::delta_u

Spike sharpness parameter delta u.

◆ rho0

AurynFloat auryn::SRM0Group::rho0

Mean firing rate rate at threshold.


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