LIF voltage traces and a recurrent network raster

13th May 2026

A single leaky integrate-and-fire neuron under tonic input, then 200 of them wired together.

The leaky integrate-and-fire (LIF) model is the simplest spiking neuron worth taking seriously. Its membrane voltage decays toward a resting potential and is pushed around by injected current; when the voltage crosses a threshold the neuron emits a spike and resets.

The subthreshold dynamics are

τmdVdt=(VVrest)+RmI,\tau_m \frac{dV}{dt} = -(V - V_\text{rest}) + R_m\, I,

with a spike-and-reset rule

V(t)Vth    spike at t,VVreset.V(t) \geq V_\text{th} \;\Longrightarrow\; \text{spike at } t,\quad V \leftarrow V_\text{reset}.

The code integrates this with forward Euler at Δt=0.1ms\Delta t = 0.1\,\text{ms},

VV+Δtτm ⁣[(VVrest)+RmI],V \leftarrow V + \frac{\Delta t}{\tau_m}\!\left[-(V - V_\text{rest}) + R_m\, I\right],

using τm=10ms\tau_m = 10\,\text{ms}, Vrest=65mVV_\text{rest} = -65\,\text{mV}, Vreset=70mVV_\text{reset} = -70\,\text{mV}, Vth=50mVV_\text{th} = -50\,\text{mV}, Rm=10MΩR_m = 10\,\text{M}\Omega, and tonic input I=2.5nAI = 2.5\,\text{nA}.

With a steady tonic input current above threshold, the neuron fires periodically. Each upward sweep is the membrane charging through its RC time constant; each vertical line is a reset after a spike.

LIF voltage trace

Connect 200 such neurons together with sparse, all-excitatory recurrence and noisy per-neuron bias currents, and the dynamics get more interesting. Each neuron ii obeys the same LIF dynamics, but with a total input current

Ii(t)=Iibias+si(t),IibiasN(μ,σ2),I_i(t) = I_i^\text{bias} + s_i(t), \qquad I_i^\text{bias} \sim \mathcal{N}(\mu, \sigma^2),

with μ=2.2nA\mu = 2.2\,\text{nA} and σ=0.4nA\sigma = 0.4\,\text{nA}. The synaptic current sis_i decays exponentially between spikes and is kicked by incoming spikes,

sisieΔt/τsyn+ ⁣ ⁣jspikedWij,s_i \leftarrow s_i\, e^{-\Delta t / \tau_\text{syn}} + \!\!\sum_{j \,\in\, \text{spiked}} W_{ij},

where τsyn=5ms\tau_\text{syn} = 5\,\text{ms} and the weight matrix is Wij=wCijW_{ij} = w\, C_{ij} with CijBernoulli(pconn)C_{ij} \sim \text{Bernoulli}(p_\text{conn}), w=0.1w = 0.1, pconn=0.1p_\text{conn} = 0.1, and no self-connections. After each spike the neuron is held at VresetV_\text{reset} for a refractory period of 2ms2\,\text{ms}.

The raster below shows every spike from every neuron over half a second of simulated time; the panel underneath tracks the network’s mean total input current (bias plus decaying synaptic input), with the shaded band showing one standard deviation across the population.

Network raster and input current

Both figures were generated by running neuron lif and neuron net and copying the PNGs into this post’s asset directory.

LIF run parameters

ParameterValue
commandlif
current2.5
duration100.0
dt0.1
firing_rate_hz90.0

Network run parameters

ParameterValue
commandnet
n200
duration500.0
dt0.1
seed0
mean_firing_rate_hz104.2
min_firing_rate_hz56.0
max_firing_rate_hz148.0