Skip to content

Fix the IF_cond_exp_gsfa_grr model on all backends - #862

Merged
apdavison merged 1 commit into
NeuralEnsemble:masterfrom
apdavison:fix-gsfa-grr-state
Nov 18, 2026
Merged

apdavison merged 1 commit into
NeuralEnsemble:masterfrom
apdavison:fix-gsfa-grr-state

Conversation

@apdavison

Copy link
Copy Markdown
Member

Currently, the IF_cond_exp_gsfa_grr is broken in several ways:

  • NEST: uses the wrong variable names for what should be g_r and g_s on the PyNN side, and scales them wrongly (PyNN's default is µS for conductances, but for some reason this model uses nS in most places, µS in others),
  • NEURON and Arbor: the g_r and g_s state variables cannot be recorded (NEURON only), and their initial values are ignored, since the mechanisms' INITIAL blocks set them to zero.
  • Brian2:
    • g_r and g_s are reported in µS instead of nS.
    • The reset adds q_r and q_s scaled by 1e9.
    • The threshold, reset and refractory period use the first cell's values for the whole population, and setting v_reset afterwards removes the conductance increments from the reset.
    • The model has alpha-shaped synapses instead of exponential ones, and g_r and g_s stay constant during the refractory period, whereas they decay on the other backends.

Here, we make all four backends follow the standard model, which declares g_r, g_s, q_rr and q_sfa in nS:

  • NEST: the variable map uses the PyNN names, with no scaling.
  • NEURON and Arbor: the NMODL mechanisms take initial values through new g_s_init/g_r_init parameters, and NEURON can now record g_s and g_r.
  • Brian2:
    • v_thresh, v_reset, q_r and q_s are per-cell variables used by name in the threshold and reset code, so they can differ between cells and be changed between runs.
    • The refractory period is handled as for the other Brian2 models.
    • The synapses are exponential, and g_r/g_s decay during the refractory period.

Note that nS is an exception to the PyNN convention of µS for conductances. Changing this would be a breaking API change, so it is left for a separate PR.

test_IF_cond_exp_gsfa_grr_adaptation now runs on all four backends, not just NEURON and Arbor, and also checks the time of the second spike, the first one affected by g_s and g_r. The backends agree to within 0.02 ms. The new test test_IF_cond_exp_gsfa_grr_initial_conductances checks, on all four backends, the units, initial values and decay of g_s and g_r.

`g_r`/`g_s` were unknown on NEST, not recordable and with ignored initial values on NEURON and Arbor, and in µS on Brian2, whose reset also added q_r/q_s scaled by 1e9. The Brian2 version also used alpha synapses and froze g_r/g_s during refractoriness. The adaptation scenario test therefore now runs on NEST and Brian2 too; the second spike time agrees to within 0.02 ms across backends.
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 74.219% (+0.08%) from 74.143% — apdavison:fix-gsfa-grr-state into NeuralEnsemble:master

@apdavison
apdavison merged commit 952558d into NeuralEnsemble:master Nov 18, 2026
13 of 18 checks passed
@apdavison
apdavison deleted the fix-gsfa-grr-state branch November 18, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants