NEST main@f146f75
Loading...
Searching...
No Matches
iaf_tum_2000.h
Go to the documentation of this file.
1/*
2 * iaf_tum_2000.h
3 *
4 * This file is part of NEST.
5 *
6 * Copyright (C) 2004 The NEST Initiative
7 *
8 * NEST is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * NEST is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with NEST. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
23#ifndef IAF_TUM_2000_H
24#define IAF_TUM_2000_H
25
26// Includes from nestkernel:
27#include "archiving_node.h"
28#include "connection.h"
29#include "event.h"
30#include "nest_types.h"
31#include "recordables_map.h"
32#include "ring_buffer.h"
34
35namespace nest
36{
37
38// clang-format off
39/* BeginUserDocs: neuron, integrate-and-fire, current-based, stp, hard threshold
40
41Short description
42+++++++++++++++++
43
44Leaky integrate-and-fire neuron model with exponential PSCs and integrated short-term plasticity synapse
45
46Description
47+++++++++++
48
49``iaf_tum_2000`` is a leaky integrate-and-fire neuron model with short-term synaptic
50plasticity and exponential shaped postsynaptic currents (PSCs). In particular,
51``iaf_tum_2000`` implements short-term depression and short-term facilitation
52according to :footcite:p:`Tsodyks2000` by solving Eqs. (3) and (4) from that paper in an exact manner.
53
54``iaf_tum_2000`` differs from :doc:`iaf_psc_exp </models/iaf_psc_exp>` by the addition
55of synaptic state variables :math:`x`, :math:`z` and :math:`u`, which together
56with the membrane potential :math:`V_\text{m}` and synaptic current :math:`I_\text{syn}`
57obey the following dynamics:
58
59.. math::
60
61 \frac{dV_\text{m}}{dt} &= -\frac{V_{\text{m}} - E_\text{L}}{\tau_{\text{m}}} + \frac{I_{\text{syn}} + I_\text{e}}{C_{\text{m}}}
62
63 I_{\text{syn}} &= I_\text{syn,ex} + I_\text{syn,in}
64
65 I_\text{syn,X} &= \sum_{j \in \Gamma_X} w_j y_j
66
67 \frac{dx_j}{dt} &= \frac{z_j}{\tau_{\text{rec}}} - u_j x_j \delta(t - t_j)
68
69 \frac{dy_j}{dt} &= -\frac{y_j}{\tau_{\text{syn},X}} + u_j x_j \delta(t - t_j)
70
71 \frac{dz_j}{dt} &= \frac{y_j}{\tau_{\text{syn},X}} - \frac{y_j}{\tau_{\text{rec}}}
72
73 \frac{du_j}{dt} &= -\frac{u}{\tau_{\text{fac}}} + U(1 - u) \delta(t - t_j)
74
75
76where :math:`\Gamma_X` is an index set over either excitatory (:math:`\text{X} = \text{ex}`) or inhibitory (:math:`\text{X} = \text{in}`) presynaptic neurons,
77:math:`k` indexes the spike times of neuron :math:`j`, and :math:`d_j`
78is the delay from neuron :math:`j`.
79
80``iaf_tum_2000`` incorporates the :doc:`tsodyks_synapse </models/tsodyks_synapse>`
81computations directly in the presynaptic neuron, that is, the synaptic state
82variables :math:`x,y,z,u` are integrated in the presynaptic neuron instead of
83the synapse model. For a presynaptic neuron with :math:`K` outgoing connections
84following the ``tsodyks_synapse`` dynamics, ``iaf_tum_2000`` saves :math:`K-1`
85integrations of the synaptic ODEs. This makes ``iaf_tum_2000`` very computationally
86efficient in network simulations. Since the synaptic ODEs are linear, the
87postsynaptic current can be found as the sum of all presynaptic synaptic
88currents computed in the presynaptic neurons.
89
90In order for synaptic depression or facilitation to take effect, both the
91presynaptic and postsynaptic neuron must be of type ``iaf_tum_2000``.
92
93.. note::
94
95 Connections between ``iaf_tum_2000`` neurons must be through ``receptor_type`` 1.
96
97.. warning::
98
99 ``iaf_tum_2000`` does not support :ref:`precise spike timing <sim_precise_spike_times>`.
100 Using precise spike timing will result in incorrect dynamics and must therefore
101 be avoided.
102
103.. note::
104
105 Incoming spikes are routed to the excitatory or inhibitory synapse type by the **sign of the
106 connection weight**. A positive weight targets the excitatory synapse type, a negative weight
107 the inhibitory one, and also sets the direction of the post-synaptic current.
108 ``receptor_type`` selects the input channel rather than the synapse type, and connections from
109 another ``iaf_tum_2000`` must use ``receptor_type`` 1.
110
111 See :ref:`synapse_selection` for the conventions used by other models.
112
113Parameters
114++++++++++
115
116The following parameters can be set in the status dictionary.
117
118=============== ======== =============================== ========================================================================
119**Parameter** **Unit** **Math equivalent** **Description**
120=============== ======== =============================== ========================================================================
121 ``V_m`` mV :math:`V_{\text{m}}` Membrane potential
122 ``E_L`` mV :math:`E_\text{L}` Resting membrane potential
123 ``C_m`` pF :math:`C_{\text{m}}` Capacity of the membrane
124 ``tau_m`` ms :math:`\tau_{\text{m}}` Membrane time constant
125 ``t_ref`` ms :math:`t_{\text{ref}}` Duration of refractory period
126 ``V_th`` mV :math:`V_{\text{th}}` Spike threshold
127 ``V_reset`` mV :math:`V_{\text{reset}}` Reset potential of the membrane
128 ``tau_syn_ex`` ms :math:`\tau_{\text{syn, ex}}` Excitatory synaptic time constant
129 ``tau_syn_in`` ms :math:`\tau_{\text{syn, in}}` Inhibitory synaptic time constant
130 ``U`` real :math:`U` Parameter determining the increase in u with each spike [0,1]
131 ``tau_fac`` ms :math:`\tau_{\text{fac}}` Time constant for facilitation
132 ``tau_rec`` ms :math:`\tau_{\text{rec}}` Time constant for depression
133 ``x`` real :math:`x` Initial fraction of synaptic vesicles in the readily releasable pool [0,1]
134 ``y`` real :math:`y` Initial fraction of synaptic vesicles in the synaptic cleft [0,1]
135 ``u`` real :math:`u` Initial release probability of synaptic vesicles [0,1]
136 ``I_e`` pA :math:`I_\text{e}` Constant input current
137 ``V_min`` mV :math:`V_{\text{min}}` Absolute lower value for the membrane potenial (default :math:`-\infty`)
138=============== ======== =============================== ========================================================================
139
140
141References
142++++++++++
143
144.. footbibliography::
145
146Transmits
147+++++++++
148
149SpikeEvent
150
151See also
152++++++++
153
154iaf_psc_exp, tsodyks_synapse, stdp_synapse, static_synapse
155
156Examples using this model
157+++++++++++++++++++++++++
158
159.. listexamples:: iaf_tum_2000
160
161EndUserDocs */
162// clang-format on
163
164void register_iaf_tum_2000( const std::string& name );
165
167{
168
169public:
170 iaf_tum_2000();
171 iaf_tum_2000( const iaf_tum_2000& );
172
178 using Node::handle;
180
181 size_t send_test_event( Node&, size_t, synindex, bool ) override;
182
183 void handle( SpikeEvent& ) override;
184 void handle( CurrentEvent& ) override;
185 void handle( DataLoggingRequest& ) override;
186
187 size_t handles_test_event( SpikeEvent&, size_t ) override;
188 size_t handles_test_event( CurrentEvent&, size_t ) override;
189 size_t handles_test_event( DataLoggingRequest&, size_t ) override;
190
191 void get_status( Dictionary& ) const override;
192 void set_status( const Dictionary& ) override;
193
194 bool
195 is_off_grid() const override
196 {
197 return true;
198 }
199
200private:
201 void init_buffers_() override;
202 void pre_run_hook() override;
203
204 void update( const Time&, const long, const long ) override;
205
206 // intensity function
207 double phi_() const;
208
209 // The next two classes need to be friends to access the State_ class/member
210 friend class RecordablesMap< iaf_tum_2000 >;
211 friend class UniversalDataLogger< iaf_tum_2000 >;
212
213 // ----------------------------------------------------------------
214
219 {
221 double Tau_;
222
224 double C_;
225
227 double t_ref_;
228
230 double E_L_;
231
233 double I_e_;
234
237 double Theta_;
238
240 double V_reset_;
241
243 double tau_ex_;
244
246 double tau_in_;
247
249 double rho_;
250
252 double delta_;
253
254 double tau_fac_;
255 double tau_psc_;
256 double tau_rec_;
257 double U_;
258
259 Parameters_();
260
261 void get( Dictionary& ) const;
262
266 double set( const Dictionary&, Node* node );
267 };
268
269 // ----------------------------------------------------------------
270
274 struct State_
275 {
276 // state variables
277 double i_0_;
278 double i_1_;
279 double i_syn_ex_;
281 double i_syn_in_;
282 double V_m_;
283 int r_ref_;
284
285 double x_;
286 double y_;
287 double u_;
288
289 State_();
290
291 void get( Dictionary&, const Parameters_& ) const;
292
298 void set( const Dictionary&, const Parameters_&, const double, Node* );
299 };
300
301 // ----------------------------------------------------------------
302
327
328 // ----------------------------------------------------------------
329
334 {
340 // double PSCInitialValue_;
341
342 // time evolution operator
343 double P20_;
344 double P11ex_;
345 double P11in_;
346 double P21ex_;
347 double P21in_;
348 double P22_;
349
352
354
356 };
357
358 // Access functions for UniversalDataLogger -------------------------------
359
361 inline double
362 get_V_m_() const
363 {
364 return S_.V_m_ + P_.E_L_;
365 }
366
367 inline double
369 {
370 return S_.i_syn_ex_;
371 }
372
373 inline double
375 {
376 return S_.i_syn_in_;
377 }
378
379 // ----------------------------------------------------------------
380
392
395};
396
397
398inline size_t
399iaf_tum_2000::send_test_event( Node& target, size_t receptor_type, synindex, bool )
400{
401 if ( target.get_model_id() != this->get_model_id() and target.is_off_grid() )
402 {
403 throw IllegalConnection( "iaf_tum_2000 neurons cannot be connected to precise spiking neurons." );
404 }
405
406 SpikeEvent e;
407 e.set_sender( *this );
408 return target.handles_test_event( e, receptor_type );
409}
410
411inline size_t
413{
414 if ( receptor_type > 1 )
415 {
416 throw UnknownReceptorType( receptor_type, get_name() );
417 }
418 else if ( receptor_type != 1 and e.get_sender().get_model_id() == this->get_model_id() )
419 {
420 throw IllegalConnection( "iaf_tum_2000 neurons must be connected via receptor_type 1." );
421 }
422 return receptor_type;
423}
424
425inline size_t
427{
428 if ( receptor_type == 0 )
429 {
430 return 0;
431 }
432 else if ( receptor_type == 1 )
433 {
434 return 1;
435 }
436 else
437 {
438 throw UnknownReceptorType( receptor_type, get_name() );
439 }
440}
441
442inline size_t
444{
445 if ( receptor_type != 0 )
446 {
447 throw UnknownReceptorType( receptor_type, get_name() );
448 }
449 return B_.logger_.connect_logging_device( dlr, recordablesMap_ );
450}
451
452inline void
454{
455 P_.get( d );
456 S_.get( d, P_ );
458
459 d[ names::recordables ] = recordablesMap_.get_list();
460}
461
462inline void
464{
465 Parameters_ ptmp = P_; // temporary copy in case of errors
466 const double delta_EL = ptmp.set( d, this ); // throws if BadProperty
467 State_ stmp = S_; // temporary copy in case of errors
468 stmp.set( d, ptmp, delta_EL, this ); // throws if BadProperty
469
470 // We now know that (ptmp, stmp) are consistent. We do not
471 // write them back to (P_, S_) before we are also sure that
472 // the properties to be set in the parent class are internally
473 // consistent.
475
476 // if we get here, temporaries contain consistent set of properties
477 P_ = ptmp;
478 S_ = stmp;
479}
480
481} // namespace
482
483#endif // IAF_TUM_2000_H
Dictionary class for interface to Python and C++ API.
Definition dictionary.h:213
ArchivingNode()
Definition archiving_node.cpp:37
void get_status(Dictionary &d) const override
Export properties of the node by setting entries in the status dictionary.
Definition archiving_node.cpp:249
void set_status(const Dictionary &d) override
Change properties of the node according to the entries in the dictionary.
Definition archiving_node.cpp:265
Event for electrical currents.
Definition event.h:608
Request data to be logged/logged data to be sent.
Definition event.h:675
To be thrown if a connection is not possible.
Definition exceptions.h:490
Base class for all NEST network objects.
Definition node.h:99
std::string get_name() const
Return class name.
Definition node.cpp:105
Map names of recordables to data access functions.
Definition recordables_map.h:61
Event for spike information.
Definition event.h:420
Definition nest_time.h:135
Exception to be thrown if the specified receptor type does not exist in the node.
Definition exceptions.h:417
friend class UniversalDataLogger< iaf_tum_2000 >
Definition iaf_tum_2000.h:211
size_t send_test_event(Node &, size_t, synindex, bool) override
Send an event to the receiving_node passed as an argument.
Definition iaf_tum_2000.h:399
friend class RecordablesMap< iaf_tum_2000 >
Definition iaf_tum_2000.h:210
Variables_ V_
Definition iaf_tum_2000.h:389
double get_V_m_() const
Read out the real membrane potential.
Definition iaf_tum_2000.h:362
void handle(SpikeEvent &) override
Handle incoming spike events.
Definition iaf_tum_2000.cpp:446
void get_status(Dictionary &) const override
Export properties of the node by setting entries in the status dictionary.
Definition iaf_tum_2000.h:453
double get_I_syn_in_() const
Definition iaf_tum_2000.h:374
State_ S_
Definition iaf_tum_2000.h:388
Buffers_ B_
Definition iaf_tum_2000.h:390
void update(const Time &, const long, const long) override
Advance the state of the node in time through the given interval.
Definition iaf_tum_2000.cpp:341
bool is_off_grid() const override
Returns true if the node sends/receives off-grid events.
Definition iaf_tum_2000.h:195
static RecordablesMap< iaf_tum_2000 > recordablesMap_
Mapping of recordables names to access functions.
Definition iaf_tum_2000.h:394
void init_buffers_() override
Configure persistent internal data structures.
Definition iaf_tum_2000.cpp:290
double get_I_syn_ex_() const
Definition iaf_tum_2000.h:368
iaf_tum_2000()
Definition iaf_tum_2000.cpp:268
size_t handles_test_event(SpikeEvent &, size_t) override
Check if the node can handle a particular event and receptor type.
Definition iaf_tum_2000.h:412
void pre_run_hook() override
Re-calculate dependent parameters of the node.
Definition iaf_tum_2000.cpp:298
void set_status(const Dictionary &) override
Change properties of the node according to the entries in the dictionary.
Definition iaf_tum_2000.h:463
double phi_() const
Definition iaf_tum_2000.cpp:258
Parameters_ P_
Instances of private data structures for the different types of data pertaining to the model.
Definition iaf_tum_2000.h:387
virtual size_t handles_test_event(SpikeEvent &, size_t receptor_type)
Check if the node can handle a particular event and receptor type.
Definition node.cpp:282
virtual void handle(SpikeEvent &e)
Handle incoming spike events.
Definition node.cpp:271
const std::string recordables("recordables")
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
BaseRandomGenerator * RngPtr
Definition random_generators.h:50
void register_iaf_tum_2000(const std::string &name)
Definition iaf_tum_2000.cpp:50
size_t synindex
For enumerations of synapse types.
Definition nest_types.h:121
Buffers of the model.
Definition iaf_tum_2000.h:307
MultiChannelInputBuffer< NUM_INPUT_CHANNELS > input_buffer_
buffers and sums up incoming spikes/currents
Definition iaf_tum_2000.h:322
UniversalDataLogger< iaf_tum_2000 > logger_
Logger for all analog data.
Definition iaf_tum_2000.h:325
Buffers_(iaf_tum_2000 &)
Definition iaf_tum_2000.cpp:247
@ I0
Definition iaf_tum_2000.h:316
@ NUM_INPUT_CHANNELS
Definition iaf_tum_2000.h:318
@ I1
Definition iaf_tum_2000.h:317
@ SYN_IN
Definition iaf_tum_2000.h:314
@ SYN_EX
Definition iaf_tum_2000.h:315
Independent parameters of the model.
Definition iaf_tum_2000.h:219
double tau_rec_
Definition iaf_tum_2000.h:256
double tau_ex_
Time constant of excitatory synaptic current in ms.
Definition iaf_tum_2000.h:243
double Theta_
Threshold, RELATIVE TO RESTING POTENTAIL(!).
Definition iaf_tum_2000.h:237
double C_
Membrane capacitance in pF.
Definition iaf_tum_2000.h:224
double set(const Dictionary &, Node *node)
Set values from dictionary.
Definition iaf_tum_2000.cpp:128
double tau_fac_
Definition iaf_tum_2000.h:254
void get(Dictionary &) const
Store current values in dictionary.
Definition iaf_tum_2000.cpp:108
double U_
Definition iaf_tum_2000.h:257
double tau_psc_
Definition iaf_tum_2000.h:255
double t_ref_
Refractory period in ms.
Definition iaf_tum_2000.h:227
double Tau_
Membrane time constant in ms.
Definition iaf_tum_2000.h:221
double delta_
Width of threshold region in mV.
Definition iaf_tum_2000.h:252
double E_L_
Resting potential in mV.
Definition iaf_tum_2000.h:230
double I_e_
External current in pA.
Definition iaf_tum_2000.h:233
double rho_
Stochastic firing intensity at threshold in 1/s.
Definition iaf_tum_2000.h:249
double tau_in_
Time constant of inhibitory synaptic current in ms.
Definition iaf_tum_2000.h:246
double V_reset_
reset value of the membrane potential
Definition iaf_tum_2000.h:240
Parameters_()
Sets default parameter values.
Definition iaf_tum_2000.cpp:71
State variables of the model.
Definition iaf_tum_2000.h:275
void set(const Dictionary &, const Parameters_ &, const double, Node *)
Set values from dictionary.
Definition iaf_tum_2000.cpp:214
double i_syn_in_
Postsynaptic current for inhibitory inputs.
Definition iaf_tum_2000.h:281
double i_0_
Stepwise constant input current.
Definition iaf_tum_2000.h:277
double y_
Definition iaf_tum_2000.h:286
State_()
Default initialization.
Definition iaf_tum_2000.cpp:90
double i_1_
Current input that is filtered through the excitatory synapse exponential kernel.
Definition iaf_tum_2000.h:278
void get(Dictionary &, const Parameters_ &) const
Definition iaf_tum_2000.cpp:205
double u_
Definition iaf_tum_2000.h:287
double V_m_
Membrane potential.
Definition iaf_tum_2000.h:282
int r_ref_
Absolute refractory counter (no membrane potential propagation).
Definition iaf_tum_2000.h:283
double x_
Definition iaf_tum_2000.h:285
double i_syn_ex_
Definition iaf_tum_2000.h:279
Internal variables of the model.
Definition iaf_tum_2000.h:334
double P11ex_
Definition iaf_tum_2000.h:344
double P22_
Definition iaf_tum_2000.h:348
double P20_
Amplitude of the synaptic current.
Definition iaf_tum_2000.h:343
double P21ex_
Definition iaf_tum_2000.h:346
int RefractoryCounts_
Definition iaf_tum_2000.h:353
double weighted_spikes_in_
Definition iaf_tum_2000.h:351
double P11in_
Definition iaf_tum_2000.h:345
RngPtr rng_
random number generator of my own thread
Definition iaf_tum_2000.h:355
double weighted_spikes_ex_
Definition iaf_tum_2000.h:350
double P21in_
Definition iaf_tum_2000.h:347