BrainPy-style Examples#
Complete, runnable examples built with the native brainpy.state API:
composable neurons, synapses, AlignPre/AlignPost projections, and
surrogate-gradient training. Every script lives in the examples/brainpy_like/
directory of the repository.
Each card is tagged along two axes:
How to read the tags
World — Simulation reproduces neuroscience dynamics; Training learns weights by gradient descent through the spiking model.
Difficulty — beginner (single mechanism, short), intermediate (a full network or training loop), advanced (multi-mechanism models or paper-scale reproductions).
These tags describe scope, not stability — every example is production-ready.
If you are new here, start with 5-minute tour and the Tutorial 1 · Your first neuron tutorial track, then come back to adapt one of these.
Balanced & E/I networks#
The canonical excitatory-inhibitory balanced networks — the natural home of the AlignPost projection (see AlignPre / AlignPost — the keystone).
Two populations, random fixed-indegree COBA wiring, built with the
imperative Builder API — the flagship Network-API example.
Simulation · beginner
Vogels-Abbott conductance-based E/I network with AlignPostProj +
Expon + COBA. The reference simulation pattern.
Simulation · beginner
The current-based variant of Vogels-Abbott — simpler and faster than COBA.
Simulation · beginner
A second construction of the CUBA network showing an alternative wiring style.
Simulation · intermediate
Van Vreeswijk & Sompolinsky balanced network exhibiting chaotic asynchronous-irregular firing.
Simulation · intermediate
The COBA benchmark rebuilt on biophysically detailed Hodgkin-Huxley cells.
Simulation · intermediate
Oscillations & rhythms#
Network rhythms — gamma generation, synchrony, and fast oscillations.
Wang & Buzsaki inhibition-based gamma (30-80 Hz) in a hippocampal interneuron network.
Simulation · intermediate
Diesmann et al. reliable propagation of synchronous spike volleys through a feedforward chain.
Simulation · intermediate
Brunel & Hakim fast (>100 Hz) global oscillations in sparsely-connected inhibitory networks with low firing rates.
Simulation · intermediate
Susin & Destexhe asynchronous-irregular background state (no rhythm).
Simulation · advanced
Susin & Destexhe coherent high-frequency inhibition-based gamma.
Simulation · advanced
Susin & Destexhe pure-inhibitory (ING) gamma generation.
Simulation · advanced
Susin & Destexhe pyramidal-interneuron (PING) gamma — the E-I loop.
Simulation · advanced
The combined Susin & Destexhe model exploring all four gamma regimes in one script.
Simulation · advanced
Reproductions & large models#
Paper-scale simulations and signal-propagation studies.
A multi-layer cortical column model with layer-specific LIF populations and connectivity.
Simulation · advanced
Joglekar et al. graded vs all-or-none signal propagation across a connectome-constrained network of cortical areas.
Simulation · advanced
Training spiking networks#
Gradient-based training through the spiking model with surrogate gradients (see Differentiability).
Train a small spiking network on a synthetic task with surrogate gradients (the spytorch tutorial 1 reproduction).
Training · beginner
A multi-layer spiking network classifying Fashion-MNIST end to end (spytorch tutorials 2 & 3).
Training · intermediate
MNIST classification with a LeakyRateReadout decoding spikes into class
scores.
Training · intermediate
See Also#
NEST-Compatible Examples — the NEST-compatible example gallery.
BrainPy-style Modeling — tutorials and task-oriented how-to guides.
AlignPre / AlignPost — the keystone — the projection design behind the network examples.