eprop_iaf – Current-based leaky integrate-and-fire neuron model with delta-shaped postsynaptic currents for e-prop plasticity¶
Description¶
eprop_iaf
is an implementation of a leaky integrate-and-fire
neuron model with delta-shaped postsynaptic currents used for eligibility
propagation (e-prop) plasticity.
E-prop plasticity was originally introduced and implemented in TensorFlow in [1].
Note
The neuron dynamics of the eprop_iaf
model (excluding e-prop
plasticity) are similar to the neuron dynamics of the iaf_psc_delta
model,
with minor differences, such as the propagator of the post-synaptic current
and the voltage reset upon a spike.
The membrane voltage time course \(v_j^t\) of the neuron \(j\) is given by:
where \(W_{ji}^\text{rec}\) and \(W_{ji}^\text{in}\) are the recurrent and input synaptic weight matrices, and \(z_i^{t-1}\) is the recurrent presynaptic state variable, while \(x_i^t\) represents the input at time \(t\).
Descriptions of further parameters and variables can be found in the table below.
The spike state variable is expressed by a Heaviside function:
If the membrane voltage crosses the threshold voltage \(v_\text{th}\), a spike is emitted and the membrane voltage is reduced by \(v_\text{th}\) in the next time step. After the time step of the spike emission, the neuron is not able to spike for an absolute refractory period \(t_\text{ref}\).
An additional state variable and the corresponding differential equation represents a piecewise constant external current.
See the documentation on the iaf_psc_delta neuron model for more information on the integration of the subthreshold dynamics.
The change of the synaptic weight is calculated from the gradient \(g^t\) of the loss \(E^t\) with respect to the synaptic weight \(W_{ji}\): \(\frac{ \text{d} E^t }{ \text{d} W_{ij} }\) which depends on the presynaptic spikes \(z_i^{t-2}\), the surrogate gradient or pseudo-derivative of the spike state variable with respect to the postsynaptic membrane voltage \(\psi_j^{t-1}\) (the product of which forms the eligibility trace \(e_{ji}^{t-1}\)), and the learning signal \(L_j^t\) emitted by the readout neurons.
Surrogate gradients help overcome the challenge of the spiking function’s non-differentiability, facilitating the use of gradient-based learning techniques such as e-prop. The non-existent derivative of the spiking variable with respect to the membrane voltage, \(\frac{\partial z^t_j}{ \partial v^t_j}\), can be effectively replaced with a variety of surrogate gradient functions, as detailed in various studies (see, e.g., [3]). NEST currently provides four different surrogate gradient functions:
A piecewise linear function used among others in [1]:
An exponential function used in [4]:
The derivative of a fast sigmoid function used in [5]:
An arctan function used in [6]:
In the interval between two presynaptic spikes, the gradient is calculated at each time step until the cutoff time point. This computation occurs over the time range:
\(t \in \left[ t_\text{spk,prev}, \min \left( t_\text{spk,prev} + \Delta t_\text{c}, t_\text{spk,curr} \right) \right]\).
Here, \(t_\text{spk,prev}\) represents the time of the previous spike that passed the synapse, while \(t_\text{spk,curr}\) is the time of the current spike, which triggers the application of the learning rule and the subsequent synaptic weight update. The cutoff \(\Delta t_\text{c}\) defines the maximum allowable interval for integration between spikes. The expression for the gradient is given by:
The eligibility trace and the presynaptic spike trains are low-pass filtered with the following exponential kernels:
Furthermore, a firing rate regularization mechanism keeps the exponential moving average of the postsynaptic neuron’s firing rate \(f_j^{\text{ema},t}\) close to a target firing rate \(f^\text{target}\). The gradient \(g_\text{reg}^t\) of the regularization loss \(E_\text{reg}^t\) with respect to the synaptic weight \(W_{ji}\) is given by:
where \(c_\text{reg}\) is a constant scaling factor.
The overall gradient is given by the addition of the two gradients.
As a last step for every round in the loop over the time steps \(t\), the new weight is retrieved by feeding the current gradient \(g^t\) to the optimizer (see weight_optimizer for more information on the available optimizers):
After the loop has terminated, the filtered dynamic variables of e-prop are propagated from the end of the cutoff until the next spike:
For more information on e-prop plasticity, see the documentation on the other e-prop models:
Details on the event-based NEST implementation of e-prop can be found in [2].
Parameters¶
The following parameters can be set in the status dictionary.
Neuron parameters |
||||
---|---|---|---|---|
Parameter |
Unit |
Math equivalent |
Default |
Description |
|
pF |
\(C_\text{m}\) |
250.0 |
Capacitance of the membrane |
|
mV |
\(E_\text{L}\) |
-70.0 |
Leak / resting membrane potential |
|
pA |
\(I_\text{e}\) |
0.0 |
Constant external input current |
|
ms |
\(t_\text{ref}\) |
2.0 |
Duration of the refractory period |
|
ms |
\(\tau_\text{m}\) |
10.0 |
Time constant of the membrane |
|
mV |
\(v_\text{min}\) |
negative maximum
value
representable by
a |
Absolute lower bound of the membrane voltage |
|
mV |
\(v_\text{th}\) |
-55.0 |
Spike threshold voltage |
E-prop parameters |
||||
---|---|---|---|---|
Parameter |
Unit |
Math equivalent |
Default |
Description |
|
\(c_\text{reg}\) |
0.0 |
Coefficient of firing rate regularization |
|
|
ms |
\({\Delta t}_\text{c}\) |
maximum value
representable
by a |
Cutoff for integration of e-prop update between two spikes |
|
Hz |
\(f^\text{target}\) |
10.0 |
Target firing rate of rate regularization |
|
\(\kappa\) |
0.97 |
Low-pass filter of the eligibility trace |
|
|
\(\kappa_\text{reg}\) |
0.97 |
Low-pass filter of the firing rate for regularization |
|
|
\(\beta\) |
1.0 |
Width scaling of surrogate gradient / pseudo-derivative of membrane voltage |
|
|
\(\gamma\) |
0.3 |
Height scaling of surrogate gradient / pseudo-derivative of membrane voltage |
|
|
\(\psi\) |
“piecewise_linear” |
Surrogate gradient / pseudo-derivative function [“piecewise_linear”, “exponential”, “fast_sigmoid_derivative” , “arctan”] |
Recordables¶
The following state variables evolve during simulation and can be recorded.
Neuron state variables and recordables |
||||
---|---|---|---|---|
State variable |
Unit |
Math equivalent |
Initial value |
Description |
|
mV |
\(v_j\) |
-70.0 |
Membrane voltage |
E-prop state variables and recordables |
||||
---|---|---|---|---|
State variable |
Unit |
Math equivalent |
Initial value |
Description |
|
pA |
\(L_j\) |
0.0 |
Learning signal |
|
\(\psi_j\) |
0.0 |
Surrogate gradient / pseudo-derivative of membrane voltage |
Usage¶
This model can only be used in combination with the other e-prop models and the network architecture requires specific wiring, input, and output. The usage is demonstrated in several supervised regression and classification tasks reproducing among others the original proof-of-concept tasks in [1].
References¶
Neftci EO, Mostafa H, Zenke F (2019). Surrogate Gradient Learning in Spiking Neural Networks. IEEE Signal Processing Magazine, 36(6), 51-63. https://doi.org/10.1109/MSP.2019.2931595
Shrestha SB, Orchard G (2018). SLAYER: Spike Layer Error Reassignment in Time. Advances in Neural Information Processing Systems, 31:1412-1421. https://proceedings.neurips.cc/paper_files/paper/2018/hash/82.. rubric:: References
Zenke F, Ganguli S (2018). SuperSpike: Supervised Learning in Multilayer Spiking Neural Networks. Neural Computation, 30:1514–1541. https://doi.org/10.1162/neco_a_01086
Fang W, Yu Z, Chen Y, Huang T, Masquelier T, Tian Y (2021). Deep residual learning in spiking neural networks. Advances in Neural Information Processing Systems, 34:21056–21069. https://proceedings.neurips.cc/paper/2021/hash/afe434653a898da20044041262b3ac74-Abstract.html
Sends¶
SpikeEvent
Receives¶
SpikeEvent, CurrentEvent, LearningSignalConnectionEvent, DataLoggingRequest
See also¶
Examples using this model¶
Tutorial on learning to accumulate evidence with e-prop after Bellec et al. (2020)
Tutorial on learning to generate a lemniscate with e-prop after Bellec et al. (2020)
Tutorial on learning to generate handwritten text with e-prop after Bellec et al. (2020)
Tutorial on learning to generate sine waves with e-prop after Bellec et al. (2020)