Visualizations
313 / 500

313 · Machine learning

Spiking Raster

A thousand Izhikevich neurons learn by spike timing and ripple with travelling waves.

A thousand Izhikevich model neurons, 800 regular-spiking excitatory cells and 200 fast-spiking interneurons, are wired on a ring after Izhikevich's 2006 polychronization model: each sends 100 synapses, mostly to its neighbours, with conduction delays of 1 to 20 ms that grow with distance. Synapses learn by spike-timing-dependent plasticity, strengthening when a spike arrives just before its target fires and weakening when it arrives just after, while a sliding depression threshold keeps the mean rate near 10 Hz. The opening seconds fast-forward through 30 simulated seconds of development; the weights split into the bimodal distribution STDP is known for, and activity organises into travelling waves and rhythmic population bursts with power in the gamma band. The raster scrolls like an EEG strip beside a ring where each strong synapse is a chord, spikes travel along those chords at their real delays, and the chords brighten and fade as learning continues.

Try it. Click or drag on the ring (or on a row of the raster) to stimulate that region and launch a wave; the electrode trace follows the stimulated cell. STDP toggles learning (P), Slower and Faster change the clock (arrow keys), Rewire builds a fresh network (R), and Space stimulates a random spot.

  • Izhikevich neurons
  • Spike-timing-dependent plasticity
  • Conduction delays
  • Spectral analysis

View the source · one module, plus a small shared runtime for sizing, the animation loop and input

Build your own

Paste this into Claude Code, Codex or any coding agent to get a simple version running, then take it wherever you like.

Build a spiking neural network simulation with JavaScript and the HTML canvas element. Put everything in a single index.html file with no libraries or build step, so I can open it directly in a browser.

Start simple:
- Make a canvas that fills the window, stays sharp on high-DPI screens (scale by devicePixelRatio), and resizes with the window. Use a near-black background.
- Simulate 1,000 Izhikevich neurons: 800 excitatory (a = 0.02, d = 8) and 200 inhibitory (a = 0.1, d = 2), all with b = 0.2 and reset c = -65. Each simulated millisecond, update v += 0.04v^2 + 5v + 140 - u + I (as two half steps) and u += a(bv - u). When v reaches 30, record a spike, set v = c and add d to u.
- Give every neuron 100 random outgoing synapses: excitatory weight 6, inhibitory weight -5. A spike adds its weight to the target's input on the next millisecond. Add noise by giving one random neuron an input of 20 each millisecond.
- Draw a spike raster: time scrolls from right to left, one row per neuron, a dot for each spike, excitatory in amber and inhibitory in blue. Run a few simulated milliseconds per animation frame.

Once that works, make it beautiful:
- Place the neurons on a ring, connect them mostly to neighbours, and give each synapse a delay of 1 to 20 ms proportional to distance (keep a circular buffer of future inputs). Order the raster rows by ring position so travelling waves show up as diagonal streaks.
- Draw the ring beside the raster, flashing each neuron when it fires, and let me click a spot on the ring to stimulate that region.
- Plot the population firing rate under the raster like an EEG trace, with a soft glow.

Explain the key ideas in short code comments. When you're done, tell me how to open it and suggest three directions I could take it next, such as spike-timing-dependent plasticity with a weight histogram, a power spectrum that reveals gamma rhythms, or drawing the strongest synapses as chords across the ring.
PreviousPseudo 3D RoadA sunset coastal highway faked the 80s arcade way, from flat segments and sprites. NextParticle TypeWords made of thousands of particles that scatter and regroup.

Related visualizations

  • Neuron GrowthNature A Golgi-stained circuit grows its dendrites and axons, wires up, then fires.
  • Action PotentialNature Hodgkin-Huxley spikes race down an axon while every ion channel opens and shuts.
  • Lateral InhibitionIllusions Four brightness illusions, each predicted live by a model of retinal ganglion cells.
  • Echo State OracleMachine learning A never-trained random reservoir forecasts chaos on a green phosphor oscilloscope.
  • Hopfield MemoryMachine learning A lamp panel of 400 neurons that repairs scribbled glyphs, until it stores too many.
  • GrokkingMachine learning A tiny network memorizes modular addition, then suddenly understands it.
  • Growing Neural CellsMachine learning Cells running one tiny learned rule grow a gecko from a single seed and heal its wounds.
  • Elastic Net TSPAlgorithms A rubber band of neurons wriggles through a map of cities until it becomes a tour.
  • Waterfall IllusionIllusions Stare for twenty seconds, then watch a frozen picture drift the other way.

Use ← and → to move between demos. While the canvas has focus, keys go to the demo instead.

← More from Emergent Mind Labs