Skip to content

Tutorials

Learn jaxfne by working through progressively detailed examples. Each tutorial builds on the previous one.

Notebook standard

All tutorials follow the Colab notebook standard. This standard ensures tutorials are:

  • Reproducible in fresh Colab environments with minimal dependencies
  • CPU-safe with optional GPU acceleration
  • Portable across platforms (nbconvert-compatible)
  • Properly cleared and version-verified before commit

Start with the notebook standard to understand the structure and validation guidelines used in all tutorials.

Tutorial stack

The tutorial progression teaches the source-to-field/readout workflow, from single-neuron models to multi-area laminar circuits:

Number Topic Type Focus Version
Suite 1 Computational Biophysics Interactive Colab 4-part course: models → circuits → readouts → optimization v0.3.3+
Suite 2 Corticospectrolaminar Motif Runnable Notebook Compact V1/PFC spectrolaminar motif and visual analysis v0.3.4+
Suite 3 Low-Frequency Scaling Runnable Notebook Scale-dependent low-frequency proxy readouts and boundary validation v0.3.9+
09 EEG/MEG/EMM Proxy Bundle Runnable Notebook Separate sensor pathways for scalp potential, magnetic field, and metabolic proxy v0.3.10+
10 Sensory Omission & Oddball Runnable Notebook Expected sensory stimuli, unexpected deviants, and sensory omissions v0.3.13+
06 Chainable Configuration (100-neuron E/I) Runnable notebook New Configuration API: method chaining, E/I population dynamics v0.3.6+
07 v0.3.7 Source Bookkeeping Interactive HTML 3D visualization of source/field/probe workflow v0.3.7+
08 v0.3.8 LFP/CSD Readout Runnable notebook Laminar contact projection, Gaussian kernels, CSD-proxy v0.3.8+
01 Single-neuron Multimodal Runnable notebook Izhikevich emitter, spikes, voltage, field readouts v0.2.8+
02 Two-neuron E/I Runnable notebook Coupling, recurrent dynamics v0.2.9+
03 100-neuron Network Runnable notebook Population dynamics, stability v0.2.10+
04 V1 Six-layer Column Documentation guide Laminar anatomy, depth-specific readouts v0.2.11+
05 V1-PFC Dual Column Documentation guide Cross-area interaction, traveling waves v0.2.14+

Computational Biophysics (interactive Colab)

A comprehensive 4-part course covering: - Part 1: Single-neuron models and biophysics - Part 2: Vectorized circuits and connectivity - Part 3: Laminar cortical columns with readout operators (LFP-proxy, CSD-proxy, spectral analysis) - Part 4: Hypothesis tuning via optimization

22 figures, export metrics, and immutable scope fields throughout. CPU-safe, runs in 2–3 minutes on Colab.

Open in Colab


Corticospectrolaminar Motif (interactive notebook)

A comprehensive tutorial covering: - Part 1: Declaring cortical column anatomy and multi-column loops - Part 2: Vectorized JAX-first population simulations - Part 3: Sampling multimodal sensor proxies (MUA, LFP, CSD, EEG, MEG, EMM) - Part 4: High-resolution spectrolaminar visualizations - Part 5: Evoked responses and baseline spectrolaminar heatmaps - Part 6: CPU-safe parameter search and tuning trajectories

13 figures, strict JSON evidence manifests, and JAX-based vis tools.

Open in Colab


Scale-Dependent Low-Frequency Structure in Proxy Field Readouts (interactive notebook)

A comprehensive tutorial covering: - Part 1: Declaring scale-dependent proxy configurations - Part 2: Vectorized population simulations across varied sizes - Part 3: Computing relative power spectral densities (PSD) and bandpower metrics - Part 4: Investigating synchrony and Fano proxies by scale - Part 5: Exporting strict validation JSON manifests and reports

Five figures, strict verification constraints, and low-frequency scaling diagnostics.

Open in Colab


Multimodal Sensor Projections and EEG/MEG/EMM Proxy Bundle (interactive notebook)

A comprehensive tutorial covering: - Part 1: Declarative setup and population simulation (100 neurons) - Part 2: Scalp potential projections via EEG-proxy operators - Part 3: Oriented magnetic field projections via MEG-proxy operators - Part 4: Energy cost timeline projections via metabolic EMM-proxy operators - Part 5: Validation receipt and independent panel figures

Three panel figures and structured validation manifest exports.

Open in Colab


Sensory Omission & Oddball Detection Paradigm (interactive notebook)

A comprehensive tutorial covering: - Part 1: Declarative expected sensory stimuli and unexpected deviant tone setups - Part 2: Configuring sensory omission conditions (expected silence) - Part 3: Running stimulus-locked trials with windowed time segmentation - Part 4: Comparing expected vs deviant vs omission population activity and LFP/CSD proxy readouts - Part 5: Exporting JSON-safe paradigm reports and validation manifests

Five plots and structured validation manifests.

Open in Colab


100-Neuron Excitatory-Inhibitory Population (interactive notebook)

Introduces the new fluent Configuration API (method chaining) for streamlined model composition:

cfg = (jtfne.Configuration()
    .runtime(seed=42, dtype="float32", duration_ms=1000.0, dt_ms=0.1)
    .column(name="L2/3_column", layers=["L2/3"], n=100)
    .cell_types({"E": 0.75, "I": 0.25})
    .connectivity()
    .set_emitter(family="izhikevich", preset="cortical_eig")
    .probes(["SPK", "Vm", "source", "LFP-proxy", "CSD-proxy"]))

A comprehensive tutorial covering: - Part 1: Biological question (balanced E/I coupling) - Part 2: Configuration via method chaining - Part 3: Simulation and population readouts - Part 4: Manifest with scope metadata - Part 5: Five figures - Part 6: Scope boundaries and limitations

Intermediate difficulty, CPU-safe, runs in ~1–2 minutes on Colab.

Open in Colab


Beginner tutorials

Single-neuron Multimodal

Start here. Build, simulate, and inspect a single Izhikevich neuron with spikes, voltage, and readout operators.

Two-neuron E/I

Excitatory and inhibitory neurons connected. Observe recurrent dynamics and coupling effects.

Intermediate tutorials

100-neuron Network

A balanced network of excitatory and inhibitory neurons. Explore local population activity and stability.

V1 Six-layer Column

A laminar model inspired by primate V1 with six layers (L1, L2/3, L4, L5, L6) and depth-specific readouts.

Advanced tutorial

V1-PFC Dual Column

Two cortical columns (V1 and PFC) with inter-areal connections. Explore cross-area interaction and traveling-wave dynamics.

Running tutorials

Tutorials are available as Jupyter notebooks in the .legacy/notebooks/ directory:

jupyter notebook .legacy/notebooks/01_single_neuron_multimodal.ipynb

Or run directly with nbconvert:

nbconvert --execute .legacy/notebooks/01_single_neuron_multimodal.ipynb

Quick example: Single-neuron primer

import jaxfne as jtfne

# Configure
cfg = (
    jtfne.configuration()
    .network(n=1)
    .emitter(family="izhikevich", preset="regular_spiking")
    .field(domain="point")
    .probe(name="single", modes=["spikes", "V_m"])
)

# Build and simulate
model = jtfne.construct(cfg)
signals = model.simulate(jtfne.simulation(duration_ms=100.0))

# Inspect
print(f"Spike count: {signals.spikes.sum()}")
print(f"Voltage shape: {signals.V_m.shape}")

Next steps

After tutorials: