NEST main@caf0ae8
 
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
103Parameters
104++++++++++
105
106The following parameters can be set in the status dictionary.
107
108=============== ======== =============================== ========================================================================
109**Parameter** **Unit** **Math equivalent** **Description**
110=============== ======== =============================== ========================================================================
111 ``V_m`` mV :math:`V_{\text{m}}` Membrane potential
112 ``E_L`` mV :math:`E_\text{L}` Resting membrane potential
113 ``C_m`` pF :math:`C_{\text{m}}` Capacity of the membrane
114 ``tau_m`` ms :math:`\tau_{\text{m}}` Membrane time constant
115 ``t_ref`` ms :math:`t_{\text{ref}}` Duration of refractory period
116 ``V_th`` mV :math:`V_{\text{th}}` Spike threshold
117 ``V_reset`` mV :math:`V_{\text{reset}}` Reset potential of the membrane
118 ``tau_syn_ex`` ms :math:`\tau_{\text{syn, ex}}` Excitatory synaptic time constant
119 ``tau_syn_in`` ms :math:`\tau_{\text{syn, in}}` Inhibitory synaptic time constant
120 ``U`` real :math:`U` Parameter determining the increase in u with each spike [0,1]
121 ``tau_fac`` ms :math:`\tau_{\text{fac}}` Time constant for facilitation
122 ``tau_rec`` ms :math:`\tau_{\text{rec}}` Time constant for depression
123 ``x`` real :math:`x` Initial fraction of synaptic vesicles in the readily releasable pool [0,1]
124 ``y`` real :math:`y` Initial fraction of synaptic vesicles in the synaptic cleft [0,1]
125 ``u`` real :math:`u` Initial release probability of synaptic vesicles [0,1]
126 ``I_e`` pA :math:`I_\text{e}` Constant input current
127 ``V_min`` mV :math:`V_{\text{min}}` Absolute lower value for the membrane potenial (default :math:`-\infty`)
128=============== ======== =============================== ========================================================================
129
130
131References
132++++++++++
133
134.. footbibliography::
135
136Transmits
137+++++++++
138
139SpikeEvent
140
141See also
142++++++++
143
144iaf_psc_exp, tsodyks_synapse, stdp_synapse, static_synapse
145
146Examples using this model
147+++++++++++++++++++++++++
148
149.. listexamples:: iaf_tum_2000
150
151EndUserDocs */
152// clang-format on
153
154void register_iaf_tum_2000( const std::string& name );
155
157{
158
159public:
160 iaf_tum_2000();
161 iaf_tum_2000( const iaf_tum_2000& );
162
168 using Node::handle;
170
171 size_t send_test_event( Node&, size_t, synindex, bool ) override;
172
173 void handle( SpikeEvent& ) override;
174 void handle( CurrentEvent& ) override;
175 void handle( DataLoggingRequest& ) override;
176
177 size_t handles_test_event( SpikeEvent&, size_t ) override;
178 size_t handles_test_event( CurrentEvent&, size_t ) override;
179 size_t handles_test_event( DataLoggingRequest&, size_t ) override;
180
181 void get_status( Dictionary& ) const override;
182 void set_status( const Dictionary& ) override;
183
184 bool
185 is_off_grid() const override
186 {
187 return true;
188 }
189
190private:
191 void init_buffers_() override;
192 void pre_run_hook() override;
193
194 void update( const Time&, const long, const long ) override;
195
196 // intensity function
197 double phi_() const;
198
199 // The next two classes need to be friends to access the State_ class/member
200 friend class RecordablesMap< iaf_tum_2000 >;
201 friend class UniversalDataLogger< iaf_tum_2000 >;
202
203 // ----------------------------------------------------------------
204
209 {
211 double Tau_;
212
214 double C_;
215
217 double t_ref_;
218
220 double E_L_;
221
223 double I_e_;
224
227 double Theta_;
228
230 double V_reset_;
231
233 double tau_ex_;
234
236 double tau_in_;
237
239 double rho_;
240
242 double delta_;
243
244 double tau_fac_;
245 double tau_psc_;
246 double tau_rec_;
247 double U_;
248
249 Parameters_();
250
251 void get( Dictionary& ) const;
252
256 double set( const Dictionary&, Node* node );
257 };
258
259 // ----------------------------------------------------------------
260
264 struct State_
265 {
266 // state variables
267 double i_0_;
268 double i_1_;
269 double i_syn_ex_;
271 double i_syn_in_;
272 double V_m_;
273 int r_ref_;
274
275 double x_;
276 double y_;
277 double u_;
278
279 State_();
280
281 void get( Dictionary&, const Parameters_& ) const;
282
288 void set( const Dictionary&, const Parameters_&, const double, Node* );
289 };
290
291 // ----------------------------------------------------------------
292
317
318 // ----------------------------------------------------------------
319
324 {
330 // double PSCInitialValue_;
331
332 // time evolution operator
333 double P20_;
334 double P11ex_;
335 double P11in_;
336 double P21ex_;
337 double P21in_;
338 double P22_;
339
342
344
346 };
347
348 // Access functions for UniversalDataLogger -------------------------------
349
351 inline double
352 get_V_m_() const
353 {
354 return S_.V_m_ + P_.E_L_;
355 }
356
357 inline double
359 {
360 return S_.i_syn_ex_;
361 }
362
363 inline double
365 {
366 return S_.i_syn_in_;
367 }
368
369 // ----------------------------------------------------------------
370
385};
386
387
388inline size_t
389iaf_tum_2000::send_test_event( Node& target, size_t receptor_type, synindex, bool )
390{
391 if ( target.get_model_id() != this->get_model_id() and target.is_off_grid() )
392 {
393 throw IllegalConnection( "iaf_tum_2000 neurons cannot be connected to precise spiking neurons." );
394 }
395
396 SpikeEvent e;
397 e.set_sender( *this );
398 return target.handles_test_event( e, receptor_type );
399}
400
401inline size_t
403{
404 if ( receptor_type > 1 )
405 {
406 throw UnknownReceptorType( receptor_type, get_name() );
407 }
408 else if ( receptor_type != 1 and e.get_sender().get_model_id() == this->get_model_id() )
409 {
410 throw IllegalConnection( "iaf_tum_2000 neurons must be connected via receptor_type 1." );
411 }
412 return receptor_type;
413}
414
415inline size_t
417{
418 if ( receptor_type == 0 )
419 {
420 return 0;
421 }
422 else if ( receptor_type == 1 )
423 {
424 return 1;
425 }
426 else
427 {
428 throw UnknownReceptorType( receptor_type, get_name() );
429 }
430}
431
432inline size_t
434{
435 if ( receptor_type != 0 )
436 {
437 throw UnknownReceptorType( receptor_type, get_name() );
438 }
439 return B_.logger_.connect_logging_device( dlr, recordablesMap_ );
440}
441
442inline void
444{
445 P_.get( d );
446 S_.get( d, P_ );
448
449 d[ names::recordables ] = recordablesMap_.get_list();
450}
451
452inline void
454{
455 Parameters_ ptmp = P_; // temporary copy in case of errors
456 const double delta_EL = ptmp.set( d, this ); // throws if BadProperty
457 State_ stmp = S_; // temporary copy in case of errors
458 stmp.set( d, ptmp, delta_EL, this ); // throws if BadProperty
459
460 // We now know that (ptmp, stmp) are consistent. We do not
461 // write them back to (P_, S_) before we are also sure that
462 // the properties to be set in the parent class are internally
463 // consistent.
465
466 // if we get here, temporaries contain consistent set of properties
467 P_ = ptmp;
468 S_ = stmp;
469}
470
471} // namespace
472
473#endif // IAF_TUM_2000_H
Dictionary class for interface to Python and C++ API.
Definition dictionary.h:213
A node which archives spike history for the purposes of spike-timing dependent plasticity (STDP)
Definition archiving_node.h:49
void get_status(Dictionary &d) const override
Export properties of the node by setting entries in the status dictionary.
Definition archiving_node.cpp:220
void set_status(const Dictionary &d) override
Change properties of the node according to the entries in the dictionary.
Definition archiving_node.cpp:236
Base class for RNG engine wrappers.
Definition random_generators.h:67
Event for electrical currents.
Definition event.h:569
Request data to be logged/logged data to be sent.
Definition event.h:636
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:418
Definition nest_time.h:135
Exception to be thrown if the specified receptor type does not exist in the node.
Definition exceptions.h:417
Definition iaf_tum_2000.h:157
friend class UniversalDataLogger< iaf_tum_2000 >
Definition iaf_tum_2000.h:201
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:389
Variables_ V_
Definition iaf_tum_2000.h:379
double get_V_m_() const
Read out the real membrane potential.
Definition iaf_tum_2000.h:352
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:443
double get_I_syn_in_() const
Definition iaf_tum_2000.h:364
State_ S_
Definition iaf_tum_2000.h:378
Buffers_ B_
Definition iaf_tum_2000.h:380
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:185
static RecordablesMap< iaf_tum_2000 > recordablesMap_
Mapping of recordables names to access functions.
Definition iaf_tum_2000.h:384
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:358
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:402
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:453
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:377
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:271
virtual void handle(SpikeEvent &e)
Handle incoming spike events.
Definition node.cpp:265
const std::string recordables("recordables")
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
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:115
Buffers of the model.
Definition iaf_tum_2000.h:297
MultiChannelInputBuffer< NUM_INPUT_CHANNELS > input_buffer_
buffers and sums up incoming spikes/currents
Definition iaf_tum_2000.h:312
UniversalDataLogger< iaf_tum_2000 > logger_
Logger for all analog data.
Definition iaf_tum_2000.h:315
@ I0
Definition iaf_tum_2000.h:306
@ NUM_INPUT_CHANNELS
Definition iaf_tum_2000.h:308
@ I1
Definition iaf_tum_2000.h:307
@ SYN_IN
Definition iaf_tum_2000.h:304
@ SYN_EX
Definition iaf_tum_2000.h:305
Independent parameters of the model.
Definition iaf_tum_2000.h:209
double tau_rec_
Definition iaf_tum_2000.h:246
double tau_ex_
Time constant of excitatory synaptic current in ms.
Definition iaf_tum_2000.h:233
double Theta_
Threshold, RELATIVE TO RESTING POTENTAIL(!).
Definition iaf_tum_2000.h:227
double C_
Membrane capacitance in pF.
Definition iaf_tum_2000.h:214
double set(const Dictionary &, Node *node)
Set values from dictionary.
Definition iaf_tum_2000.cpp:128
double tau_fac_
Definition iaf_tum_2000.h:244
void get(Dictionary &) const
Store current values in dictionary.
Definition iaf_tum_2000.cpp:108
double U_
Definition iaf_tum_2000.h:247
double tau_psc_
Definition iaf_tum_2000.h:245
double t_ref_
Refractory period in ms.
Definition iaf_tum_2000.h:217
double Tau_
Membrane time constant in ms.
Definition iaf_tum_2000.h:211
double delta_
Width of threshold region in mV.
Definition iaf_tum_2000.h:242
double E_L_
Resting potential in mV.
Definition iaf_tum_2000.h:220
double I_e_
External current in pA.
Definition iaf_tum_2000.h:223
double rho_
Stochastic firing intensity at threshold in 1/s.
Definition iaf_tum_2000.h:239
double tau_in_
Time constant of inhibitory synaptic current in ms.
Definition iaf_tum_2000.h:236
double V_reset_
reset value of the membrane potential
Definition iaf_tum_2000.h:230
Parameters_()
Sets default parameter values.
Definition iaf_tum_2000.cpp:71
State variables of the model.
Definition iaf_tum_2000.h:265
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:271
double i_0_
Stepwise constant input current.
Definition iaf_tum_2000.h:267
double y_
Definition iaf_tum_2000.h:276
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:268
void get(Dictionary &, const Parameters_ &) const
Definition iaf_tum_2000.cpp:205
double u_
Definition iaf_tum_2000.h:277
double V_m_
Membrane potential.
Definition iaf_tum_2000.h:272
int r_ref_
Absolute refractory counter (no membrane potential propagation)
Definition iaf_tum_2000.h:273
double x_
Definition iaf_tum_2000.h:275
double i_syn_ex_
Postsynaptic current for excitatory inputs (includes contribution from current input on receptor type...
Definition iaf_tum_2000.h:269
Internal variables of the model.
Definition iaf_tum_2000.h:324
double P11ex_
Definition iaf_tum_2000.h:334
double P22_
Definition iaf_tum_2000.h:338
double P20_
Amplitude of the synaptic current.
Definition iaf_tum_2000.h:333
double P21ex_
Definition iaf_tum_2000.h:336
int RefractoryCounts_
Definition iaf_tum_2000.h:343
double weighted_spikes_in_
Definition iaf_tum_2000.h:341
double P11in_
Definition iaf_tum_2000.h:335
RngPtr rng_
random number generator of my own thread
Definition iaf_tum_2000.h:345
double weighted_spikes_ex_
Definition iaf_tum_2000.h:340
double P21in_
Definition iaf_tum_2000.h:337