brainmass documentation#

brainmass implements neural mass models with brainstate, enabling whole-brain modeling with differentiable programming and JAX.


Features#

Comprehensive Model Library

13+ neural mass models from phenomenological oscillators to physiological population models, covering EEG, MEG, and fMRI applications

Differentiable Optimization

Fit model parameters to empirical data using gradient-based (JAX) or gradient-free (Nevergrad) optimization

Forward Modeling

Built-in BOLD hemodynamics and EEG/MEG lead-field models for linking neural activity to neuroimaging signals

Unit-Safe Computing

Automatic dimensional analysis with brainunit prevents unit errors in scientific computing


Installation#

pip install -U brainmass[cpu]
pip install -U brainmass[cuda12]
pip install -U brainmass[cuda13]
pip install -U brainmass[tpu]

See Installation for detailed instructions.


Where to Start#

New to brainmass?

Start with the Quickstart Tutorial for a 5-minute introduction

Quickstart
Looking for examples?

Browse the Examples Gallery for practical applications

Examples
Need specific functionality?

Check the API Reference for detailed documentation

API Reference
Want to contribute?

Read the Developer Guide to get started

Developer Guide

Documentation Structure#

Tutorials

Step-by-step guides for common tasks

Tutorials
Examples

Jupyter notebooks with practical applications

Examples
API Reference

Complete API documentation

API Reference
Developer Guide

Contributing and extending brainmass

Developer Guide

BrainX Ecosystem#

brainmass is one part of our brain modeling ecosystem.