NEST main@caf0ae8
 
Loading...
Searching...
No Matches
eprop_iaf_psc_delta_adapt.h
Go to the documentation of this file.
1/*
2 * eprop_iaf_psc_delta_adapt.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 EPROP_IAF_PSC_DELTA_ADAPT_H
24#define EPROP_IAF_PSC_DELTA_ADAPT_H
25
26// nestkernel
27#include "connection.h"
30#include "eprop_synapse.h"
31#include "event.h"
32#include "nest_types.h"
33#include "ring_buffer.h"
35
36namespace nest
37{
38
39/* BeginUserDocs: neuron, e-prop plasticity, current-based, integrate-and-fire, adaptive threshold, Bellec
40
41Short description
42+++++++++++++++++
43
44Current-based leaky integrate-and-fire neuron model with delta-shaped
45postsynaptic currents and threshold adaptation for e-prop plasticity
46
47Description
48+++++++++++
49
50``eprop_iaf_psc_delta_adapt`` is an implementation of a leaky integrate-and-fire
51neuron model with delta-shaped postsynaptic currents and threshold adaptation
52used for eligibility propagation (e-prop) plasticity.
53
54E-prop plasticity was originally introduced and implemented in TensorFlow in :footcite:p:`Bellec2020`.
55
56 .. note::
57 The neuron dynamics of the ``eprop_iaf_psc_delta_adapt`` model (excluding
58 e-prop plasticity and the threshold adaptation) are similar to the neuron
59 dynamics of the ``iaf_psc_delta`` model, with minor differences, such as the
60 propagator of the post-synaptic current and the voltage reset upon a spike.
61
62The membrane voltage time course :math:`v_j^t` of the neuron :math:`j` is given by:
63
64.. math::
65 v_j^t &= \alpha v_j^{t-1} + \sum_{i \neq j} W_{ji}^\text{rec} z_i^{t-1}
66 + \sum_i W_{ji}^\text{in} x_i^t \,, \\
67 \alpha &= e^{ -\frac{ \Delta t }{ \tau_\text{m} } } \,, \\
68
69where :math:`W_{ji}^\text{rec}` and :math:`W_{ji}^\text{in}` are the recurrent and
70input synaptic weight matrices, and :math:`z_i^{t-1}` is the recurrent presynaptic
71state variable, while :math:`x_i^t` represents the input at time :math:`t`.
72
73Descriptions of further parameters and variables can be found in the table below.
74
75The threshold adaptation is given by:
76
77.. math::
78 A_j^t &= v_\text{th} + \beta a_j^t \,, \\
79 a_j^t &= \rho a_j^{t-1} + z_j^{t-1} \,, \\
80 \rho &= e^{-\frac{ \Delta t }{ \tau_\text{a} }} \,. \\
81
82The spike state variable is expressed by a Heaviside function:
83
84.. math::
85 z_j^t = H \left( v_j^t - A_j^t \right) \,. \\
86
87If the membrane voltage crosses the adaptive threshold voltage :math:`A_j^t`, a spike is
88emitted and the membrane voltage is reset to :math:`v_\text{reset}`. After the time step
89of the spike emission, the neuron is not able to spike for an absolute refractory period
90:math:`t_\text{ref}` during which the membrane potential stays clamped to the reset voltage
91:math:`v_\text{reset}`, thus
92
93.. math::
94 v_m = v_\text{reset} \quad \text{for} \quad t_\text{spk} \leq t \leq t_\text{spk} + t_\text{ref} \,.
95
96Spikes arriving while the neuron is refractory are discarded by default. However,
97if ``refractory_input`` is set to ``True`` they are damped for each time step
98until the end of the refractory period and then added to the membrane voltage.
99
100An additional state variable and the corresponding differential equation
101represents a piecewise constant external current.
102
103See the documentation on the :doc:`iaf_psc_delta<../models/iaf_psc_delta/>` neuron model
104for more information on the integration of the subthreshold dynamics.
105
106The change of the synaptic weight is calculated from the gradient :math:`g^t` of
107the loss :math:`E^t` with respect to the synaptic weight :math:`W_{ji}`:
108:math:`\frac{ \text{d} E^t }{ \text{d} W_{ij} }`
109which depends on the presynaptic
110spikes :math:`z_i^{t-2}`, the surrogate gradient or pseudo-derivative
111of the spike state variable with respect to the postsynaptic membrane
112voltage :math:`\psi_j^{t-1}` (the product of which forms the eligibility
113trace :math:`e_{ji}^{t-1}`), and the learning signal :math:`L_j^t` emitted
114by the readout neurons.
115
116Surrogate gradients help overcome the challenge of the spiking function's
117non-differentiability, facilitating the use of gradient-based learning
118techniques such as e-prop. The non-existent derivative of the spiking
119variable with respect to the membrane voltage,
120:math:`\frac{\partial z^t_j}{ \partial v^t_j}`, can be effectively
121replaced with a variety of surrogate gradient functions, as detailed in
122various studies (see, e.g., :footcite:p:`Neftci2019`). NEST currently provides four
123different surrogate gradient functions:
124
1251. A piecewise linear function used among others in :footcite:p:`Bellec2020`:
126
127.. math::
128 \psi_j^t = \frac{ \gamma }{ v_\text{th} } \text{max}
129 \left( 0, 1-\beta \left| \frac{ v_j^t - v_\text{th} }{ v_\text{th} }\right| \right) \,. \\
130
1312. An exponential function used in :footcite:p:`Shrestha2018`:
132
133.. math::
134 \psi_j^t = \gamma \exp \left( -\beta \left| v_j^t - v_\text{th} \right| \right) \,. \\
135
1363. The derivative of a fast sigmoid function used in :footcite:p:`Zenke2018`:
137
138.. math::
139 \psi_j^t = \gamma \left( 1 + \beta \left| v_j^t - v_\text{th} \right| \right)^2 \,. \\
140
1414. The derivative of an arctan function used in :footcite:p:`Fang2021`:
142
143.. math::
144 \psi_j^t = \frac{\gamma}{\pi} \frac{1}{ 1 + \left( \beta \pi \left( v_j^t - v_\text{th} \right) \right)^2 } \,. \\
145
146In the interval between two presynaptic spikes, the gradient is calculated
147at each time step until the cutoff time point. This computation occurs over
148the time range:
149
150:math:`t \in \left[ t_\text{spk,prev}, \min \left( t_\text{spk,prev} + \Delta t_\text{c}, t_\text{spk,curr} \right)
151\right]`.
152
153Here, :math:`t_\text{spk,prev}` represents the time of the previous spike that
154passed the synapse, while :math:`t_\text{spk,curr}` is the time of the
155current spike, which triggers the application of the learning rule and the
156subsequent synaptic weight update. The cutoff :math:`\Delta t_\text{c}`
157defines the maximum allowable interval for integration between spikes.
158The expression for the gradient is given by:
159
160.. math::
161 \frac{ \text{d} E^t }{ \text{d} W_{ji} } &= L_j^t \bar{e}_{ji}^{t-1} \,, \\
162 e_{ji}^{t-1} &= \psi_j^{t-1} \left( \bar{z}_i^{t-2} - \beta \epsilon_{ji,a}^{t-2} \right) \,, \\
163 \epsilon^{t-2}_{ji,\text{a}} &= e_{ji}^{t-1} + \rho \epsilon_{ji,a}^{t-3} \,. \\
164
165The eligibility trace and the presynaptic spike trains are low-pass filtered
166with the following exponential kernels:
167
168.. math::
169 \bar{e}_{ji}^t &= \mathcal{F}_\kappa \left( e_{ji}^t \right)
170 = \kappa \bar{e}_{ji}^{t-1} + \left( 1 - \kappa \right) e_{ji}^t \,, \\
171 \bar{z}_i^t &= \mathcal{F}_\alpha \left( z_{i}^t \right)= \alpha \bar{z}_i^{t-1} + z_i^t \,. \\
172
173Furthermore, a firing rate regularization mechanism keeps the exponential moving average of the postsynaptic
174neuron's firing rate :math:`f_j^{\text{ema},t}` close to a target firing rate
175:math:`f^\text{target}`. The gradient :math:`g_\text{reg}^t` of the regularization loss :math:`E_\text{reg}^t`
176with respect to the synaptic weight :math:`W_{ji}` is given by:
177
178.. math::
179 \frac{ \text{d} E_\text{reg}^t }{ \text{d} W_{ji}}
180 &\approx c_\text{reg} \left( f^{\text{ema},t}_j - f^\text{target} \right) \bar{e}_{ji}^t \,, \\
181 f^{\text{ema},t}_j &= \mathcal{F}_{\kappa_\text{reg}} \left( \frac{z_j^t}{\Delta t} \right)
182 = \kappa_\text{reg} f^{\text{ema},t-1}_j + \left( 1 - \kappa_\text{reg} \right) \frac{z_j^t}{\Delta t} \,, \\
183
184where :math:`c_\text{reg}` is a constant scaling factor.
185
186The overall gradient is given by the addition of the two gradients.
187
188As a last step for every round in the loop over the time steps :math:`t`, the new weight is retrieved by feeding the
189current gradient :math:`g^t` to the optimizer (see :doc:`weight_optimizer<../models/weight_optimizer/>`
190for more information on the available optimizers):
191
192.. math::
193 w^t = \text{optimizer} \left( t, g^t, w^{t-1} \right) \,. \\
194
195After the loop has terminated, the filtered dynamic variables of e-prop are propagated from the end of the cutoff until
196the next spike:
197
198.. math::
199 p &= \text{max} \left( 0, t_\text{s}^{t} - \left( t_\text{s}^{t-1} + {\Delta t}_\text{c} \right) \right) \,, \\
200 \bar{e}_{ji}^{t+p} &= \bar{e}_{ji}^t \kappa^p \,, \\
201 \bar{z}_i^{t+p} &= \bar{z}_i^t \alpha^p \,, \\
202 \epsilon^{t+p} &= \epsilon^t \rho^p \,. \\
203
204For more information on the implementation details of the neuron model, see :footcite:p:`Rotter1999` and
205:footcite:p:`Diesmann2001`.
206
207For more information on e-prop plasticity, see the documentation on the other e-prop models:
208
209 * :doc:`eprop_iaf_psc_delta<../models/eprop_iaf_psc_delta/>`
210 * :doc:`eprop_readout<../models/eprop_readout/>`
211 * :doc:`eprop_synapse<../models/eprop_synapse/>`
212 * :doc:`eprop_learning_signal_connection<../models/eprop_learning_signal_connection/>`
213
214Details on the event-based NEST implementation of e-prop can be found in :footcite:p:`KorcsakGorzo2025`.
215
216Parameters
217++++++++++
218
219The following parameters can be set in the status dictionary.
220
221=========================== ======= ======================= ================ ===================================
222**Neuron parameters**
223----------------------------------------------------------------------------------------------------------------
224Parameter Unit Math equivalent Default Description
225=========================== ======= ======================= ================ ===================================
226``C_m`` pF :math:`C_\text{m}` 250.0 Capacitance of the membrane
227``E_L`` mV :math:`E_\text{L}` -70.0 Leak / resting membrane potential
228``I_e`` pA :math:`I_\text{e}` 0.0 Constant external input current
229``t_ref`` ms :math:`t_\text{ref}` 2.0 Duration of the refractory period
230``tau_m`` ms :math:`\tau_\text{m}` 10.0 Time constant of the membrane
231``V_min`` mV :math:`v_\text{min}` negative maximum Absolute lower bound of the
232 value membrane voltage
233 representable
234 by ``double``
235 type in C++
236``V_th`` mV :math:`v_\text{th}` -55.0 Spike threshold voltage
237``V_reset`` mV :math:`v_\text{reset}` -70.0 Reset voltage
238``refractory_input`` Boolean ``False`` If ``True``, spikes arriving during
239 the refractory period are damped
240 until it ends and then added to the
241 membrane voltage
242``adapt_beta`` :math:`\beta` 1.0 Prefactor of the threshold
243 adaptation
244``adapt_tau`` ms :math:`\tau_\text{a}` 10.0 Time constant of the threshold
245 adaptation
246=========================== ======= ======================= ================ ===================================
247
248=============================== ======= =========================== ================== =========================
249**E-prop parameters**
250----------------------------------------------------------------------------------------------------------------
251Parameter Unit Math equivalent Default Description
252=============================== ======= =========================== ================== =========================
253``flush_event_send_interval`` ms maximum value Interval since previous
254 representable by event after which a flush
255 ``double`` type in event is sent
256 C++
257``c_reg`` :math:`c_\text{reg}` 0.0 Coefficient of firing
258 rate regularization
259``eprop_isi_trace_cutoff`` ms :math:`{\Delta t}_\text{c}` maximum value Cutoff for integration of
260 representable e-prop update between two
261 by ``double`` spikes
262 type in C++
263``f_target`` Hz :math:`f^\text{target}` 10.0 Target firing rate of
264 rate regularization
265``kappa`` :math:`\kappa` 0.97 Low-pass filter of the
266 eligibility trace
267``kappa_reg`` :math:`\kappa_\text{reg}` 0.97 Low-pass filter of the
268 firing rate for
269 regularization
270``surrogate_gradient_function`` :math:`\psi` "piecewise_linear" Surrogate gradient /
271 pseudo-derivative
272 function
273 ["piecewise_linear",
274 "exponential",
275 "fast_sigmoid_derivative"
276 , "arctan_derivative"]
277``surrogate_gradient_height`` :math:`\gamma` 0.3 Height scaling of
278 surrogate gradient /
279 pseudo-derivative of
280 membrane voltage
281``surrogate_gradient_width`` :math:`1/\beta` 1.0 Width scaling of
282 surrogate gradient /
283 pseudo-derivative of
284 membrane voltage
285
286=============================== ======= =========================== ================== =========================
287
288Recordables
289+++++++++++
290
291The following state variables evolve during simulation and can be recorded.
292
293================== ==== =============== ============= ========================
294**Neuron state variables and recordables**
295------------------------------------------------------------------------------
296State variable Unit Math equivalent Initial value Description
297================== ==== =============== ============= ========================
298``adaptation`` :math:`a_j` 0.0 Adaptation variable
299``V_m`` mV :math:`v_j` -70.0 Membrane voltage
300``V_th_adapt`` mV :math:`A_j` -55.0 Adapting spike threshold
301================== ==== =============== ============= ========================
302
303====================== ==== =============== ============= =========================================
304**E-prop state variables and recordables**
305---------------------------------------------------------------------------------------------------
306State variable Unit Math equivalent Initial value Description
307====================== ==== =============== ============= =========================================
308``learning_signal`` pA :math:`L_j` 0.0 Learning signal
309``surrogate_gradient`` :math:`\psi_j` 0.0 Surrogate gradient / pseudo-derivative of
310 membrane voltage
311====================== ==== =============== ============= =========================================
312
313Usage
314+++++
315
316This model can only be used in combination with the other e-prop models
317and the network architecture requires specific wiring, input, and output.
318The usage is demonstrated in several
319:doc:`supervised regression and classification tasks <../auto_examples/eprop_plasticity/index>`
320reproducing among others the original proof-of-concept tasks in :footcite:p:`Bellec2020`.
321
322References
323++++++++++
324
325.. footbibliography::
326
327Sends
328+++++
329
330SpikeEvent
331
332Receives
333++++++++
334
335SpikeEvent, CurrentEvent, LearningSignalConnectionEvent, DataLoggingRequest
336
337See also
338++++++++
339
340Examples using this model
341+++++++++++++++++++++++++
342
343.. listexamples:: eprop_iaf_psc_delta_adapt
344
345EndUserDocs */
346
347void register_eprop_iaf_psc_delta_adapt( const std::string& name );
348
357{
358
359public:
362
365
366 using Node::handle;
368
369 size_t send_test_event( Node&, size_t, synindex, bool ) override;
370
371 void handle( SpikeEvent& ) override;
372 void handle( CurrentEvent& ) override;
373 void handle( LearningSignalConnectionEvent& ) override;
374 void handle( DataLoggingRequest& ) override;
375
376 size_t handles_test_event( SpikeEvent&, size_t ) override;
377 size_t handles_test_event( CurrentEvent&, size_t ) override;
378 size_t handles_test_event( LearningSignalConnectionEvent&, size_t ) override;
379 size_t handles_test_event( DataLoggingRequest&, size_t ) override;
380
381 void get_status( Dictionary& ) const override;
382 void set_status( const Dictionary& ) override;
383
384private:
385 void init_buffers_() override;
386 void pre_run_hook() override;
387
388 void update( Time const&, const long, const long ) override;
389
390 void compute_gradient( const long,
391 const long,
392 double&,
393 double&,
394 double&,
395 double&,
396 double&,
397 double&,
400 const bool,
401 const bool,
402 double&,
403 long&,
404 long& ) override;
405
406 long get_shift() const override;
407 bool is_eprop_recurrent_node() const override;
408
411
413 friend class UniversalDataLogger< eprop_iaf_psc_delta_adapt >;
414
417 {
419 double tau_m_;
420
422 double C_m_;
423
425 double t_ref_;
426
428 double E_L_;
429
431 double I_e_;
432
434 double V_th_;
435
437 double V_min_;
438
440 double V_reset_;
441
444
447
450
452 double c_reg_;
453
455 double f_target_;
456
460
463
466
468 double kappa_;
469
472
474 Parameters_();
475
477 void get( Dictionary& ) const;
478
480 double set( const Dictionary&, Node* );
481 };
482
484 struct State_
485 {
487 double i_in_;
488
490 double v_m_;
491
493 long r_;
494
497
499 double z_;
500
502 double adapt_;
503
506
509
512
514 State_();
515
517 void get( Dictionary&, const Parameters_& ) const;
518
520 void set( const Dictionary&, const Parameters_&, double, Node* );
521 };
522
541
544 {
546 double P_v_m_;
547
549 double P_i_in_;
550
552 double P_adapt_;
553
556 };
557
559 double
560 get_v_m_() const
561 {
562 return S_.v_m_ + P_.E_L_;
563 }
564
566 double
568 {
569 return S_.surrogate_gradient_;
570 }
571
573 double
575 {
576 return S_.learning_signal_;
577 }
578
580 double
582 {
583 return S_.v_th_adapt_ + P_.E_L_;
584 }
585
587 double
589 {
590 return S_.adapt_;
591 }
592
593 // the order in which the structure instances are defined is important for speed
594
597
600
603
606
609};
610
611inline long
616
617inline bool
619{
620 return true;
621}
622
623inline size_t
624eprop_iaf_psc_delta_adapt::send_test_event( Node& target, size_t receptor_type, synindex, bool )
625{
626 SpikeEvent e;
627 e.set_sender( *this );
628 return target.handles_test_event( e, receptor_type );
629}
630
631inline size_t
633{
634 if ( receptor_type != 0 )
635 {
636 throw UnknownReceptorType( receptor_type, get_name() );
637 }
638
639 return 0;
640}
641
642inline size_t
644{
645 if ( receptor_type != 0 )
646 {
647 throw UnknownReceptorType( receptor_type, get_name() );
648 }
649
650 return 0;
651}
652
653inline size_t
655{
656 if ( receptor_type != 0 )
657 {
658 throw UnknownReceptorType( receptor_type, get_name() );
659 }
660
661 return 0;
662}
663
664inline size_t
666{
667 if ( receptor_type != 0 )
668 {
669 throw UnknownReceptorType( receptor_type, get_name() );
670 }
671
672 return B_.logger_.connect_logging_device( dlr, recordablesMap_ );
673}
674
675inline void
683
684inline void
686{
688 // temporary copies in case of errors
689 Parameters_ ptmp = P_;
690 State_ stmp = S_;
691
692 // make sure that ptmp and stmp consistent - throw BadProperty if not
693 const double delta_EL = ptmp.set( d, this );
694 stmp.set( d, ptmp, delta_EL, this );
695
696 P_ = ptmp;
697 S_ = stmp;
698}
699
700} // namespace nest
701
702#endif // EPROP_IAF_PSC_DELTA_ADAPT_H
Dictionary class for interface to Python and C++ API.
Definition dictionary.h:213
Class containing the common properties for all connections of a certain type.
Definition common_synapse_properties.h:50
Event for electrical currents.
Definition event.h:569
Request data to be logged/logged data to be sent.
Definition event.h:636
Class implementing an intermediate archiving node model for recurrent node models supporting e-prop p...
Definition eprop_archiving_node_recurrent.h:43
void set_status(const Dictionary &d) override
Change properties of the node according to the entries in the dictionary.
Definition eprop_archiving_node_recurrent.h:286
void get_status(Dictionary &d) const override
Export properties of the node by setting entries in the status dictionary.
Definition eprop_archiving_node_recurrent.h:273
const long delay_in_rec_
Transmission delay from input to recurrent neurons.
Definition eprop_archiving_node.h:171
const long offset_gen_
Offset since generator signals start from time step 1.
Definition eprop_archiving_node.h:168
Event for learning signal connections.
Definition secondary_event.h:384
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
Buffer Layout.
Definition ring_buffer.h:83
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
Base class implementing a weight optimizer model.
Definition weight_optimizer.h:238
Class implementing an adaptive LIF neuron model for e-prop plasticity with additional biological feat...
Definition eprop_iaf_psc_delta_adapt.h:357
eprop_iaf_psc_delta_adapt()
Default constructor.
Definition eprop_iaf_psc_delta_adapt.cpp:284
void compute_gradient(const long, const long, double &, double &, double &, double &, double &, double &, const CommonSynapseProperties &, WeightOptimizer *, const bool, const bool, double &, long &, long &) override
Compute gradient change for eprop synapses.
Definition eprop_iaf_psc_delta_adapt.cpp:450
long get_shift() const override
Retrieves the temporal shift of the signal.
Definition eprop_iaf_psc_delta_adapt.h:612
void handle(SpikeEvent &) override
Handle incoming spike events.
Definition eprop_iaf_psc_delta_adapt.cpp:412
Parameters_ P_
Structure of parameters.
Definition eprop_iaf_psc_delta_adapt.h:596
State_ S_
Structure of state variables.
Definition eprop_iaf_psc_delta_adapt.h:599
void init_buffers_() override
Configure persistent internal data structures.
Definition eprop_iaf_psc_delta_adapt.cpp:306
bool is_eprop_recurrent_node() const override
Checks if the node is part of the recurrent network and thus not a readout neuron.
Definition eprop_iaf_psc_delta_adapt.h:618
friend class UniversalDataLogger< eprop_iaf_psc_delta_adapt >
Logger for universal data supporting the data logging request / reply mechanism. Populated with a rec...
Definition eprop_iaf_psc_delta_adapt.h:413
void get_status(Dictionary &) const override
Export properties of the node by setting entries in the status dictionary.
Definition eprop_iaf_psc_delta_adapt.h:676
void set_status(const Dictionary &) override
Change properties of the node according to the entries in the dictionary.
Definition eprop_iaf_psc_delta_adapt.h:685
double get_surrogate_gradient_() const
Get the current value of the surrogate gradient.
Definition eprop_iaf_psc_delta_adapt.h:567
double get_v_m_() const
Get the current value of the membrane voltage.
Definition eprop_iaf_psc_delta_adapt.h:560
double get_learning_signal_() const
Get the current value of the learning signal.
Definition eprop_iaf_psc_delta_adapt.h:574
double get_adaptation_() const
Get the current value of the adaptation.
Definition eprop_iaf_psc_delta_adapt.h:588
static RecordablesMap< eprop_iaf_psc_delta_adapt > recordablesMap_
Map storing a static set of recordables.
Definition eprop_iaf_psc_delta_adapt.h:608
size_t handles_test_event(SpikeEvent &, size_t) override
Check if the node can handle a particular event and receptor type.
Definition eprop_iaf_psc_delta_adapt.h:632
void update(Time const &, const long, const long) override
Advance the state of the node in time through the given interval.
Definition eprop_iaf_psc_delta_adapt.cpp:336
double get_v_th_adapt_() const
Get the current value of the adapting threshold.
Definition eprop_iaf_psc_delta_adapt.h:581
size_t send_test_event(Node &, size_t, synindex, bool) override
Send an event to the receiving_node passed as an argument.
Definition eprop_iaf_psc_delta_adapt.h:624
Variables_ V_
Structure of internal variables.
Definition eprop_iaf_psc_delta_adapt.h:602
void pre_run_hook() override
Re-calculate dependent parameters of the node.
Definition eprop_iaf_psc_delta_adapt.cpp:314
Buffers_ B_
Structure of buffers.
Definition eprop_iaf_psc_delta_adapt.h:605
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_eprop_iaf_psc_delta_adapt(const std::string &name)
Definition eprop_iaf_psc_delta_adapt.cpp:44
size_t synindex
For enumerations of synapse types.
Definition nest_types.h:115
Structure of buffers.
Definition eprop_iaf_psc_delta_adapt.h:525
UniversalDataLogger< eprop_iaf_psc_delta_adapt > logger_
Logger for universal data.
Definition eprop_iaf_psc_delta_adapt.h:539
RingBuffer currents_
Buffer for incoming currents.
Definition eprop_iaf_psc_delta_adapt.h:536
RingBuffer spikes_
Buffer for incoming spikes.
Definition eprop_iaf_psc_delta_adapt.h:533
Structure of parameters.
Definition eprop_iaf_psc_delta_adapt.h:417
double adapt_tau_
Time constant of the threshold adaptation (ms).
Definition eprop_iaf_psc_delta_adapt.h:449
double tau_m_
Time constant of the membrane (ms).
Definition eprop_iaf_psc_delta_adapt.h:419
double kappa_reg_
Low-pass filter of the firing rate for regularization.
Definition eprop_iaf_psc_delta_adapt.h:471
double set(const Dictionary &, Node *)
Set the parameters and throw errors in case of invalid values.
Definition eprop_iaf_psc_delta_adapt.cpp:144
double V_min_
Absolute lower bound of the membrane voltage relative to the leak membrane potential (mV).
Definition eprop_iaf_psc_delta_adapt.h:437
double V_reset_
Reset voltage relative to the leak membrane potential (mV).
Definition eprop_iaf_psc_delta_adapt.h:440
void get(Dictionary &) const
Get the parameters and their values.
Definition eprop_iaf_psc_delta_adapt.cpp:121
double I_e_
Constant external input current (pA).
Definition eprop_iaf_psc_delta_adapt.h:431
double E_L_
Leak / resting membrane potential (mV).
Definition eprop_iaf_psc_delta_adapt.h:428
double adapt_beta_
Prefactor of the threshold adaptation.
Definition eprop_iaf_psc_delta_adapt.h:446
double surrogate_gradient_width_
Width scaling of surrogate gradient / pseudo-derivative of membrane voltage.
Definition eprop_iaf_psc_delta_adapt.h:465
double f_target_
Target firing rate of rate regularization (spikes/s).
Definition eprop_iaf_psc_delta_adapt.h:455
double C_m_
Capacitance of the membrane (pF).
Definition eprop_iaf_psc_delta_adapt.h:422
double kappa_
Low-pass filter of the eligibility trace.
Definition eprop_iaf_psc_delta_adapt.h:468
double t_ref_
Duration of the refractory period (ms).
Definition eprop_iaf_psc_delta_adapt.h:425
double c_reg_
Coefficient of firing rate regularization.
Definition eprop_iaf_psc_delta_adapt.h:452
bool with_refr_input_
If True, count spikes arriving during the refractory period.
Definition eprop_iaf_psc_delta_adapt.h:443
std::string surrogate_gradient_function_
Surrogate gradient / pseudo-derivative function of the membrane voltage ["piecewise_linear",...
Definition eprop_iaf_psc_delta_adapt.h:459
double surrogate_gradient_height_
Height scaling of surrogate gradient / pseudo-derivative of membrane voltage.
Definition eprop_iaf_psc_delta_adapt.h:462
Parameters_()
Default constructor.
Definition eprop_iaf_psc_delta_adapt.cpp:71
double V_th_
Spike threshold voltage relative to the leak membrane potential (mV).
Definition eprop_iaf_psc_delta_adapt.h:434
Structure of state variables.
Definition eprop_iaf_psc_delta_adapt.h:485
void set(const Dictionary &, const Parameters_ &, double, Node *)
Set the state variables.
Definition eprop_iaf_psc_delta_adapt.cpp:263
void get(Dictionary &, const Parameters_ &) const
Get the state variables and their values.
Definition eprop_iaf_psc_delta_adapt.cpp:253
double z_
Binary spike state variable - 1.0 if the neuron has spiked in the previous time step and 0....
Definition eprop_iaf_psc_delta_adapt.h:499
double surrogate_gradient_
Surrogate gradient / pseudo-derivative of the membrane voltage.
Definition eprop_iaf_psc_delta_adapt.h:511
double v_th_adapt_
Adapting spike threshold voltage.
Definition eprop_iaf_psc_delta_adapt.h:505
double adapt_
Adaptation variable.
Definition eprop_iaf_psc_delta_adapt.h:502
double learning_signal_
Learning signal. Sum of weighted error signals coming from the readout neurons.
Definition eprop_iaf_psc_delta_adapt.h:508
long r_
Number of remaining refractory steps.
Definition eprop_iaf_psc_delta_adapt.h:493
double v_m_
Membrane voltage relative to the leak membrane potential (mV).
Definition eprop_iaf_psc_delta_adapt.h:490
double refr_spikes_buffer_
Count of spikes arriving during refractory period discounted for decay until end of refractory period...
Definition eprop_iaf_psc_delta_adapt.h:496
State_()
Default constructor.
Definition eprop_iaf_psc_delta_adapt.cpp:93
double i_in_
Input current (pA).
Definition eprop_iaf_psc_delta_adapt.h:487
Structure of internal variables.
Definition eprop_iaf_psc_delta_adapt.h:544
long RefractoryCounts_
Total refractory steps.
Definition eprop_iaf_psc_delta_adapt.h:555
double P_v_m_
Propagator matrix entry for evolving the membrane voltage (mathematical symbol "alpha" in user docume...
Definition eprop_iaf_psc_delta_adapt.h:546
double P_adapt_
Propagator matrix entry for evolving the adaptation (mathematical symbol "rho" in user documentation)...
Definition eprop_iaf_psc_delta_adapt.h:552
double P_i_in_
Propagator matrix entry for evolving the incoming currents.
Definition eprop_iaf_psc_delta_adapt.h:549