LIF Network Playground

Hodgkin–Huxley gave every ion channel a voice; the leaky integrate-and-fire neuron keeps only the vote that matters — threshold and reset — so we can simulate networks, not just neurons.

From ion channels to networks. Hodgkin–Huxley built a spike out of four coupled nonlinear ODEs for V, m, h, and n. The leaky integrate-and-fire (LIF) neuron below throws away the ion-channel machinery and keeps only what a downstream neuron actually "sees": a leaky membrane that integrates current until it crosses a threshold, then resets. That single simplification is what makes networks of hundreds of neurons simulable in real time.
$$\tau_m \frac{dV}{dt} = -(V - E_L) + R\,I(t)$$
…while $V < V_{th}$. The instant $V \ge V_{th}$: emit a spike, set $V \leftarrow V_{reset}$, and hold $V$ fixed for a refractory period $t_{ref}$.

Single-neuron drive

Recurrent network

80% of neurons are excitatory (\(+w\)), 20% inhibitory (\(-4w\)) — the classic 4:1 ratio that balances mean E/I drive (Brunel, 2000). Set \(p = 0\) to isolate single neurons; changing \(N\) or \(p\) regenerates the network.

Run

The scope scrolls at a fixed pace (not wall-clock real time) so spikes stay legible on a projector.

Advanced parameters (\(E_L\), \(V_{reset}\), \(R\), \(\Delta t\)) — all adjustable here too
\(\Delta t = 0.1\) ms, fixed (forward Euler / Euler–Maruyama integration). \(R\) is an arbitrary MΩ-like unit: \(R\,I\) with \(I\) in nA gives mV.

A · Single-neuron membrane trace

V(t)   Vth & spikes (ticks to +40 mV)   Vreset / EL
A reference neuron driven by \(I\) alone — no synaptic input, so it stays regular even while the network (panel C) synchronises.

B · F–I curve

$$ r_\infty = \dfrac{1000}{\,t_{ref} + \tau_m \ln\!\left(\dfrac{E_L + R\,I - V_{reset}}{E_L + R\,I - V_{th}}\right)}\ \text{Hz}, \qquad E_L + R\,I > V_{th} $$
analytic   simulated (batch re-run on parameter change) — dots should sit right on the line when σ = 0, confirming the formula; they scatter around it as noise increases.

C · Population raster & rate (recurrent network)

Synapses are delta-current with no transmission delay — a spike hits its targets in the same step — so recurrent excitation can synchronise the population more sharply than a biological network, where conduction and synaptic delays smear the timing.

D · Challenges

Tune the sim to tick these off automatically.

0 / 9

    Pause & Think

    What does the LIF discard compared to Hodgkin–Huxley? When would that loss matter?