Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor eprop_iaf_psc_delta models #40

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d5b8649
Fix typo
akorgor Sep 17, 2024
5c27760
Relabel `Variables_` to "internal variables"
akorgor Sep 17, 2024
857b7e8
Remove `nest::`
akorgor Sep 17, 2024
74575c5
Rename remaining "prefactor" to "coefficient"
akorgor Sep 18, 2024
f727654
Fix white spaces
akorgor Sep 18, 2024
7113dc3
Group default constructors
akorgor Sep 18, 2024
bef48aa
Rename variables
akorgor Sep 18, 2024
b9b7905
Adapt `iaf_psc_delta` models to recent upstream modifications
akorgor Sep 18, 2024
6c783a1
Refactor `updateValueParam`
akorgor Sep 18, 2024
d148cd4
Rename forgotten "general" to "internal
akorgor Sep 18, 2024
6cd6b29
Add BadProperty for `V_reset` and `V_th`
akorgor Sep 18, 2024
18bf644
Group `updateValueParam` lines
akorgor Sep 18, 2024
1cb50fc
Refactor `pre_run_hook`
akorgor Sep 18, 2024
73e3ac9
Refactor `handle` function of `CurrentEvent`
akorgor Sep 18, 2024
7bb3c58
Swap surrogate gradient computation and spike state variable declarat…
akorgor Sep 18, 2024
71e9c8b
Refactor doxygen and developer documentation
akorgor Sep 18, 2024
0a23380
Rename `c_m` to `C_m` for consistency with `nest::names`
akorgor Sep 18, 2024
13ac0dd
Rename `get_V_m` to `get_v_m` for consistency with variable `v_m`
akorgor Sep 18, 2024
21b0ff4
Remove unused spike state variable `S_.z_`
akorgor Sep 18, 2024
0127b23
Add unit of `learning_signal` where missing in user docs
akorgor Sep 18, 2024
ddc7c5a
Refactor `update` function
akorgor Sep 18, 2024
ce8bc00
Reorder parameters and variables
akorgor Sep 18, 2024
aebbf5d
Fix link to renamed schematic
akorgor Sep 19, 2024
00d229e
Fix format of parameters and strings in user doc tables
akorgor Sep 19, 2024
d072e42
Add missing references
akorgor Sep 19, 2024
91bfc1a
Fix remaining formats of parameters
akorgor Sep 20, 2024
429e6c9
Fix parameter tables for `eprop_iaf_psc_delta` models
akorgor Sep 20, 2024
8ef5fbc
Fix user doc sections except for description for `eprop_iaf_psc_delta…
akorgor Sep 20, 2024
c5d04dd
Unify user doc tables
akorgor Sep 20, 2024
34c1ed8
Copy short and long description to `eprop_iaf_psc_delta` models
akorgor Sep 20, 2024
370e5a7
Adjust description of `eprop_iaf_psc_delta` models
akorgor Sep 20, 2024
9aa705c
Remove `P_z_in` since no longer needed
akorgor Sep 20, 2024
29ec8e4
Express cutoff at `V_min` via `max` for clarity
akorgor Sep 24, 2024
0fb1200
Use the more precise "spike state variable" instead of "spike variable"
akorgor Sep 24, 2024
8f6406f
Clamp spike threshold during refractory period
akorgor Sep 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 63 additions & 58 deletions models/eprop_iaf.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,75 +212,80 @@ The following parameters can be set in the status dictionary.
----------------------------------------------------------------------------------------------------------------
Parameter Unit Math equivalent Default Description
=========================== ======= ======================= ================ ===================================
C_m pF :math:`C_\text{m}` 250.0 Capacitance of the membrane
E_L mV :math:`E_\text{L}` -70.0 Leak / resting membrane potential
I_e pA :math:`I_\text{e}` 0.0 Constant external input current
regular_spike_arrival Boolean True If True, the input spikes arrive at
the end of the time step, if
False at the beginning (determines
PSC scale)
t_ref ms :math:`t_\text{ref}` 2.0 Duration of the refractory period
tau_m ms :math:`\tau_\text{m}` 10.0 Time constant of the membrane
V_min mV :math:`v_\text{min}` negative maximum Absolute lower bound of the
``C_m`` pF :math:`C_\text{m}` 250.0 Capacitance of the membrane
``E_L`` mV :math:`E_\text{L}` -70.0 Leak / resting membrane potential
``I_e`` pA :math:`I_\text{e}` 0.0 Constant external input current
``regular_spike_arrival`` Boolean ``True`` If ``True``, the input spikes
arrive at the end of the time step,
if ``False`` at the beginning
(determines PSC scale)
``t_ref`` ms :math:`t_\text{ref}` 2.0 Duration of the refractory period
``tau_m`` ms :math:`\tau_\text{m}` 10.0 Time constant of the membrane
``V_min`` mV :math:`v_\text{min}` negative maximum Absolute lower bound of the
value membrane voltage
representable
by a ``double``
representable by
a ``double``
type in C++
V_th mV :math:`v_\text{th}` -55.0 Spike threshold voltage
``V_th`` mV :math:`v_\text{th}` -55.0 Spike threshold voltage
=========================== ======= ======================= ================ ===================================

=========================== ==== =========================== ================ ==================================
=============================== ======= =========================== ================== =========================
**E-prop parameters**
----------------------------------------------------------------------------------------------------------------
Parameter Unit Math equivalent Default Description
=========================== ==== =========================== ================ ==================================
c_reg :math:`c_\text{reg}` 0.0 Coefficient of firing rate
regularization
eprop_isi_trace_cutoff ms :math:`{\Delta t}_\text{c}` maximum value Cutoff for integration of
representable e-prop update between two
by a ``long`` spikes
type in C++
f_target Hz :math:`f^\text{target}` 10.0 Target firing rate of rate
regularization
kappa :math:`\kappa` 0.97 Low-pass filter of the
eligibility trace
kappa_reg :math:`\kappa_\text{reg}` 0.97 Low-pass filter of the
the firing rate for regularization
beta :math:`\beta` 1.0 Width scaling of surrogate
gradient / pseudo-derivative of
membrane voltage
gamma :math:`\gamma` 0.3 Height scaling of surrogate
gradient / pseudo-derivative of
membrane voltage
surrogate_gradient_function :math:`\psi` piecewise_linear Surrogate gradient /
pseudo-derivative function
["piecewise_linear",
"exponential",
"fast_sigmoid_derivative",
"arctan"]
=========================== ==== =========================== ================ ==================================
Parameter Unit Math equivalent Default Description
=============================== ======= =========================== ================== =========================
``c_reg`` :math:`c_\text{reg}` 0.0 Coefficient of firing
rate regularization
``eprop_isi_trace_cutoff`` ms :math:`{\Delta t}_\text{c}` maximum value Cutoff for integration of
representable e-prop update between two
by a ``long`` spikes
type in C++
``f_target`` Hz :math:`f^\text{target}` 10.0 Target firing rate of
rate regularization
``kappa`` :math:`\kappa` 0.97 Low-pass filter of the
eligibility trace
``kappa_reg`` :math:`\kappa_\text{reg}` 0.97 Low-pass filter of the
firing rate for
regularization
``beta`` :math:`\beta` 1.0 Width scaling of
surrogate gradient /
pseudo-derivative of
membrane voltage
``gamma`` :math:`\gamma` 0.3 Height scaling of
surrogate gradient /
pseudo-derivative of
membrane voltage
``surrogate_gradient_function`` :math:`\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
================== ==== =============== ============= ==========================================================
V_m mV :math:`v_j` -70.0 Membrane voltage
================== ==== =============== ============= ==========================================================
================== ==== =============== ============= ========================
``V_m`` mV :math:`v_j` -70.0 Membrane voltage
================== ==== =============== ============= ========================

================== ==== =============== ============= ==========================================================
====================== ==== =============== ============= =========================================
**E-prop state variables and recordables**
----------------------------------------------------------------------------------------------------------------
State variable Unit Math equivalent Initial value Description
================== ==== =============== ============= ==========================================================
learning_signal pA :math:`L_j` 0.0 Learning signal
surrogate_gradient :math:`\psi_j` 0.0 Surrogate gradient / pseudo-derivative of membrane voltage
================== ==== =============== ============= ==========================================================
---------------------------------------------------------------------------------------------------
State variable Unit Math equivalent Initial value Description
====================== ==== =============== ============= =========================================
``learning_signal`` pA :math:`L_j` 0.0 Learning signal
``surrogate_gradient`` :math:`\psi_j` 0.0 Surrogate gradient / pseudo-derivative of
membrane voltage
====================== ==== =============== ============= =========================================

Usage
+++++
Expand Down Expand Up @@ -491,10 +496,10 @@ class eprop_iaf : public EpropArchivingNodeRecurrent
//! Membrane voltage relative to the leak membrane potential (mV).
double v_m_;

//! Binary spike variable - 1.0 if the neuron has spiked in the previous time step and 0.0 otherwise.
//! Binary spike state variable - 1.0 if the neuron has spiked in the previous time step and 0.0 otherwise.
double z_;

//! Binary input spike variables - 1.0 if the neuron has spiked in the previous time step and 0.0 otherwise.
//! Binary input spike state variable - 1.0 if the neuron has spiked in the previous time step and 0.0 otherwise.
double z_in_;

//! Default constructor.
Expand Down Expand Up @@ -526,13 +531,13 @@ class eprop_iaf : public EpropArchivingNodeRecurrent
UniversalDataLogger< eprop_iaf > logger_;
};

//! Structure of general variables.
//! Structure of internal variables.
struct Variables_
{
//! Propagator matrix entry for evolving the membrane voltage (mathematical symbol "alpha" in user documentation).
double P_v_m_;

//! Propagator matrix entry for evolving the incoming spike variables (mathematical symbol "zeta" in user
//! Propagator matrix entry for evolving the incoming spike state variables (mathematical symbol "zeta" in user
//! documentation).
double P_z_in_;

Expand Down Expand Up @@ -575,7 +580,7 @@ class eprop_iaf : public EpropArchivingNodeRecurrent
//! Structure of state variables.
State_ S_;

//! Structure of general variables.
//! Structure of internal variables.
Variables_ V_;

//! Structure of buffers.
Expand Down
Loading
Loading