API Reference#
This section provides a comprehensive reference for all public APIs in the brainmass package.
The package is organized into several main categories that follow the hierarchical structure
of whole-brain network modeling:
Structural Connectivity (DTI / Structural MRI)
↓
Neural Mass Models (NMMs)
↓
Biophysical Forward Model
↓
Observed Signals (EEG, MEG, fMRI BOLD)
Package Contents#
The brainmass package provides the following components:
Component |
Description |
|---|---|
Neural mass models for phenomenological and physiological brain dynamics |
|
Stochastic noise processes for adding realistic variability |
|
Coupling mechanisms for connecting regions in brain networks |
|
Forward models for mapping neural activity to observed signals (BOLD, EEG/MEG) |
|
Harmonic Oscillator Recurrent Networks (HORN) for sequence learning |
|
Utility functions for common operations |
General API Conventions#
All neural mass models and dynamics classes in brainmass follow these conventions:
Initialization:
model = brainmass.ModelName(in_size=..., **parameters)
model.init_all_states(batch_size=None)
in_size: Shape of the input (number of regions/nodes)Parameters are keyword arguments with default values
init_state()must be called before simulation
Dynamics:
output = model.update(**inputs)
update()advances the model by one time stepReturns observable(s) relevant to the model
Internal states are accessible as
.valueattributes
Units:
All models are unit-aware via brainunit:
Time constants: typically
u.msoru.sFiring rates: typically
u.HzMembrane potentials: typically
u.mVQuantities can be passed as
float(unitless) orbrainunit.Quantity