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

Conductance based Adaptive Exponential neuron model - Brette and Gerstner (2005). More...

#include <AdExGroup.h>

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

Public Member Functions

 AdExGroup (NeuronID size)
 
virtual ~AdExGroup ()
 
void set_refractory_period (AurynDouble t)
 
void set_delta_t (AurynFloat d)
 Set value of slope factor deltat (default 2mV) More...
 
void set_g_leak (AurynFloat g)
 Sets the leak conductance (default 30nS) More...
 
void set_c_mem (AurynFloat cm)
 Sets the membrane capacitance (default 281pF) More...
 
void set_a (AurynFloat _a)
 Set value of a in units S ( default 4nS ) More...
 
void set_b (AurynFloat _b)
 Set value of b in units of A ( default 0.0805nA ) More...
 
void set_e_reset (AurynFloat ereset)
 
void set_e_rest (AurynFloat erest)
 
void set_e_thr (AurynFloat ethr)
 
void set_tau_w (AurynFloat tauw)
 
void set_tau_ampa (AurynFloat tau)
 
AurynFloat get_tau_ampa ()
 
void set_tau_gaba (AurynFloat tau)
 
AurynFloat get_tau_gaba ()
 
void clear ()
 
void evolve ()
 
- 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...
 

Additional Inherited Members

- 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
 
- Protected Member Functions inherited from auryn::NeuronGroup
void init ()
 
void free ()
 
- Protected Member Functions inherited from auryn::SpikingGroup
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

Conductance based Adaptive Exponential neuron model - Brette and Gerstner (2005).

This implements a NeuronGroup of AdEx neurons with default parameters from Brette, R., and Gerstner, W. (2005). Adaptive Exponential Integrate-and-Fire Model as an Effective Description of Neuronal Activity. J Neurophysiol 94, 3637–3642.

Constructor & Destructor Documentation

◆ AdExGroup()

AdExGroup::AdExGroup ( NeuronID  size)

The default constructor of this NeuronGroup

30  : NeuronGroup(size)
31 {
33  if ( evolve_locally() ) init();
34 }
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:

◆ ~AdExGroup()

AdExGroup::~AdExGroup ( )
virtual
99 {
100  if ( !evolve_locally() ) return;
101 
103 }
void auryn_vector_ushort_free(auryn_vector_ushort *v)
Definition: auryn_definitions.cpp:144
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 AdExGroup::clear ( )
virtual

Resets all neurons to defined and identical initial state.

Implements auryn::NeuronGroup.

87 {
88  clear_spikes();
89 
90  mem->set_all(e_rest);
91  g_ampa->set_zero();
92  g_gaba->set_zero();
93  w->set_zero();
94  ref->set_zero();
95 }
void set_all(const T v)
Set all elements to value v.
Definition: AurynVector.h:232
void set_zero()
Set all elements to zero.
Definition: AurynVector.h:240
AurynStateVector * g_ampa
Definition: NeuronGroup.h:66
void clear_spikes()
Clears all spikes stored in the delays which is useful to reset a network during runtime.
Definition: SpikingGroup.cpp:339
AurynStateVector * g_gaba
Definition: NeuronGroup.h:68
AurynStateVector * mem
Definition: NeuronGroup.h:64
Here is the call graph for this function:

◆ evolve()

void AdExGroup::evolve ( )
virtual

The evolve method internally used by System.

Implements auryn::SpikingGroup.

107 {
108 
109  // Compute
110  // t_mem[i] += scale_mem * (
111  // e_rest-t_mem[i]
112  // + deltat * exp((t_mem[i]-e_thr)/deltat)
113  // - t_g_ampa[i] * (t_mem[i]-e_rev_ampa)
114  // - t_g_gaba[i] * (t_mem[i]-e_rev_gaba)
115  // -t_w[i] ) ;
116  // as vectorized code
117 
118  // Compute currents
119  I_leak->diff(e_rest,mem);
120 
121  I_exc->diff(e_rev_ampa, mem);
122  I_exc->mul(g_ampa);
123 
124  I_inh->diff(e_rev_gaba, mem);
125  I_inh->mul(g_gaba);
126 
127  // compute spike generating current
128  temp->diff(mem,e_thr);
129  temp->scale(1.0/deltat);
130  temp->fast_exp();
131  temp->scale(deltat);
132 
133  // sum up all the currents
134  temp->add(I_leak);
135  temp->add(I_exc);
136  temp->add(I_inh);
137  temp->sub(w); // adaptation current
138 
139  // Euler update membrane
140  mem->saxpy(scale_mem, temp);
141  mem->clip(e_rev_gaba, 20e-3); // needs to be larger than 0.0
142 
143  // check thresholds
144  for (NeuronID i = 0 ; i < get_rank_size() ; ++i ) {
145  if (t_ref[i]==0) {
146  if (t_mem[i]>0.0) {
147  push_spike(i);
148  t_mem[i] = e_reset;
149  t_w[i] += b;
150  t_ref[i] += refractory_time ;
151  }
152  } else {
153  t_ref[i]-- ;
154  t_mem[i] = e_rest ;
155  }
156  }
157 
158  // computes
159  // dw = scale_w * (a * (t_mem[i]-e_rest) - t_w[i]);
160  // in vector lingo
161  temp->diff(mem,e_rest);
162  temp->scale(a);
163  temp->sub(w);
164  // Euler upgrade adaptation variable
165  w->saxpy(scale_w,temp);
166 
167 
168  g_ampa->scale(scale_ampa);
169  g_gaba->scale(scale_gaba);
170 }
NeuronID get_rank_size()
Returns the size on this rank.
Definition: SpikingGroup.h:450
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
AurynStateVector * g_ampa
Definition: NeuronGroup.h:66
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
void clip(const float min, const float max)
Definition: AurynVector.cpp:123
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 * g_gaba
Definition: NeuronGroup.h:68
AurynStateVector * mem
Definition: NeuronGroup.h:64
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:

◆ get_tau_ampa()

AurynFloat AdExGroup::get_tau_ampa ( )

Gets the exponential time constant for the AMPA channel

255 {
256  return tau_ampa;
257 }

◆ get_tau_gaba()

AurynFloat AdExGroup::get_tau_gaba ( )

Gets the exponential time constant for the GABA channel

266 {
267  return tau_gaba;
268 }

◆ set_a()

void AdExGroup::set_a ( AurynFloat  _a)

Set value of a in units S ( default 4nS )

Internally this is value s converted to natural units of g_leak for numerical stability. Thus, make sure you set g_leak first!

195 {
196  a = _a/g_leak;
197 }

◆ set_b()

void AdExGroup::set_b ( AurynFloat  _b)

Set value of b in units of A ( default 0.0805nA )

Internally this is value s converted to natural units of g_leak for numerical stability. Thus, make sure you set g_leak first!

200 {
201  b = _b/g_leak;
202 }

◆ set_c_mem()

void AdExGroup::set_c_mem ( AurynFloat  cm)

Sets the membrane capacitance (default 281pF)

Because these units are used to derive internal numerical values, they need to be set first!

217 {
218  c_mem = cm;
219  tau_mem = c_mem/g_leak;
220  calculate_scale_constants();
221 }
Here is the call graph for this function:

◆ set_delta_t()

void AdExGroup::set_delta_t ( AurynFloat  d)

Set value of slope factor deltat (default 2mV)

205 {
206  deltat = d/g_leak;
207 }

◆ set_e_reset()

void AdExGroup::set_e_reset ( AurynFloat  ereset)

Set value of V_r (default -70.6mV)

179 {
180  e_reset = ereset;
181 }

◆ set_e_rest()

void AdExGroup::set_e_rest ( AurynFloat  erest)

Set value of E_l (default -70.6mV)

188 {
189  e_rest = erest;
190  for (NeuronID i = 0; i < get_rank_size(); i++)
191  auryn_vector_float_set (mem, i, e_rest);
192 }
NeuronID get_rank_size()
Returns the size on this rank.
Definition: SpikingGroup.h:450
AurynStateVector * mem
Definition: NeuronGroup.h:64
unsigned int NeuronID
NeuronID is an unsigned integeger type used to index neurons in Auryn.
Definition: auryn_definitions.h:151
void auryn_vector_float_set(auryn_vector_float *v, const NeuronID i, AurynFloat x)
Definition: auryn_definitions.cpp:131
Here is the call graph for this function:

◆ set_e_thr()

void AdExGroup::set_e_thr ( AurynFloat  ethr)

Set value of V_t (default -50.4mV)

184 {
185  e_thr = ethr;
186 }

◆ set_g_leak()

void AdExGroup::set_g_leak ( AurynFloat  g)

Sets the leak conductance (default 30nS)

Because these units are used to derive internal numerical values, they need to be set first!

210 {
211  g_leak = g;
212  tau_mem = c_mem/g_leak;
213  calculate_scale_constants();
214 }

◆ set_refractory_period()

void AdExGroup::set_refractory_period ( AurynDouble  t)

Setter for refractory time [s]

271 {
272  refractory_time = (unsigned short) (t/auryn_timestep);
273 }
double auryn_timestep
Simulation timestep in seconds.
Definition: auryn_definitions.cpp:31
Here is the call graph for this function:

◆ set_tau_ampa()

void AdExGroup::set_tau_ampa ( AurynFloat  tau)

Sets the exponential time constant for the AMPA channel (default 5ms)

249 {
250  tau_ampa = taum;
251  calculate_scale_constants();
252 }

◆ set_tau_gaba()

void AdExGroup::set_tau_gaba ( AurynFloat  tau)

Sets the exponential time constant for the GABA channel (default 10ms)

260 {
261  tau_gaba = taum;
262  calculate_scale_constants();
263 }

◆ set_tau_w()

void AdExGroup::set_tau_w ( AurynFloat  tauw)

Sets the w time constant (default 144ms)

173 {
174  tau_w = tauw;
175  calculate_scale_constants();
176 }

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