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
with a spike-and-reset rule
The code integrates this with forward Euler at ,
using , , , , , and tonic input .
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.
Connect 200 such neurons together with sparse, all-excitatory recurrence and noisy per-neuron bias currents, and the dynamics get more interesting. Each neuron obeys the same LIF dynamics, but with a total input current
with and . The synaptic current decays exponentially between spikes and is kicked by incoming spikes,
where and the weight matrix is with , , , and no self-connections. After each spike the neuron is held at for a refractory period of .
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.
Both figures were generated by running neuron lif and neuron net and copying the PNGs into this post’s asset directory.
LIF run parameters
| Parameter | Value |
|---|---|
| command | lif |
| current | 2.5 |
| duration | 100.0 |
| dt | 0.1 |
| firing_rate_hz | 90.0 |
Network run parameters
| Parameter | Value |
|---|---|
| command | net |
| n | 200 |
| duration | 500.0 |
| dt | 0.1 |
| seed | 0 |
| mean_firing_rate_hz | 104.2 |
| min_firing_rate_hz | 56.0 |
| max_firing_rate_hz | 148.0 |