COBANet in tools/snnsim/models.py implements the built-in --model ping network. This page explains the minimal input→E→I→E motif; optional E→E, I→I, direct drives, adaptation, and trainable leak extend it. Read exp004 — Parameters & Units alongside these equations.
| Code | Responsibility |
exp_synapse | Decay the previous conductance, then add the current spike kick. |
lif_step_expeuler | Integrate voltage under fixed conductances, then apply clamps, refractory gating, spike detection, and reset. |
COBANet._step_body | Schedule population updates, recurrence, and readout. |
set_sim_dt in config.py | Set timestep, duration, and derived step count for legacy execution. |
Reuse the execution interface rather than changing model globals around a live network. A small forward command is given in exp003 — SNNSIM API Reference.
The membrane is a capacitor () pierced by ion channels in parallel. Conservation of charge (Kirchhoff) balances the capacitive current against the total ionic current:
Each channel passes an ohmic current — its conductance times the driving force , the distance of from the reversal potential (where the channel’s net current vanishes, set by the Nernst equilibrium):
Because , the current’s sign lives entirely in the driving force. Summing a leak (, ) and synaptic conductances — excitatory (, ), inhibitory (, ) — gives the general conductance-based (COBA) neuron:
In the minimal PING motif, E receives excitation and inhibition, while I receives excitation only. These equations omit the optional I→I pathway:
After integration, a neuron outside its refractory period spikes at threshold and resets to . A refractory neuron cannot emit a spike:
Here is the integrated candidate voltage and is 1 when the refractory counter permits a spike, otherwise 0. Thresholding follows the voltage update, not the previous step’s voltage.
Each synaptic conductance is an exponential trace driven by presynaptic spikes — each spike adds its full weight as an instantaneous jump, then the conductance decays with the channel time constant; this minimal motif has no E→E connection:
(7) is E’s excitation from the input ; (8) its inhibition from I via ; (9) the I population’s excitation from E via .
The conductances (7)–(9) and membrane equations (4)–(5) are continuous ODEs. The implementation places spike kicks on the timestep grid. Between kicks each conductance decays by , and the supplied spike adds its full event conductance at the update boundary — the decay-then-add recurrence (with the pathway-specific , and spike train of each of (7)–(9)). The membrane is integrated by exponential Euler — the same algebra for both populations (the I neuron drops ).
Collecting on makes it linear, with total conductance :
Dividing by gives decay-to-steady-state form, naming (shorter than when synapses are open) and the steady-state voltage (the conductance-weighted mean of the reversals):
A zero-order hold freezes the conductances over one step , leaving (11) constant-coefficient with exact solution
Per population — I has no , so its and drop those terms:
with step (12) for each population : .
Equation (12) is exact only while those conductances are held fixed. In a passive interval without threshold events or clamps, subdividing that same fixed-conductance interval preserves the solution in exact arithmetic. It does not establish timestep invariance of a spiking network: conductance updates, threshold crossings, refractory counters, and recurrent scheduling still depend on the grid. Measure timestep sensitivity for the intended protocol rather than assuming firing rates or gamma frequency are invariant. The alternative lif_step uses forward Euler and is selected through COBA_INTEGRATOR.
For each population update, conductances advance first, then the membrane integrates, then spike and reset are evaluated. This ordering defines the frozen-conductance interval. Recurrent inputs use the stored spikes supplied by COBANet._step_body; do not substitute a different same-step schedule while claiming equivalent dynamics.
exp_synapse computes g * decay + spikes @ W; (g + spikes @ W) * decay attenuates every new kick and changes the model.--v-grad-dampen modifies autograd through the increment; its local effect is described in exp015 — Gradient Stabilisation.Source reference: tools/snnsim/models.py, tools/snnsim/config.py, and tools/snnsim/tests/test_models.py.