Brain Modeling Ecosystem
Overview
Brain Modeling Ecosystem is a comprehensive framework for computational neuroscience and brain simulation. It provides tools and libraries for researchers to model, simulate, train, and analyze neural systems at different scales.
For complete documentation, please see Brain Modeling Ecosystem.
Core components in this ecosystem includes:
-
BrainUnit: Comprehensive physical units and unit-aware mathematical system for brain dynamics.
-
BrainCell: Intuitive, parallel, and efficient simulation for biologically detailed brain cell modeling.
-
BrainState: State-based IR compilation for efficient simulation of brain models on CPUs, GPUs, and TPUs.
-
BrainTaichi: The first-generation framework for customizing event-driven operators based on Taichi Lang syntax.
-
BrainEvent: Enabling event-driven computations in brain dynamics.
-
BrainScale: Enabling scalable online learning for brain dynamics: $O(N)$ complexity for SNNs, and $O(N^2)$ for RNN computations.
-
BrainTools: Commonly used tools for brain dynamics programming, for example checkpointing.
Installation
The ecosystem can be installed with the following command:
pip install brainmodeling
This pins particular versions of component projects which are known to work correctly together via the integration tests in this repository.
Quick Start
import braintools
import brainstate
import brainunit as u
class EINet(brainstate.nn.Module):
def __init__(self):
super().__init__()
self.n_exc = 3200
self.n_inh = 800
self.num = self.n_exc + self.n_inh
self.N = brainstate.nn.LIFRef(
self.num, V_rest=-60. * u.mV, V_th=-50. * u.mV, V_reset=-60. * u.mV,
tau=20. * u.ms, tau_ref=5. * u.ms,
V_initializer=brainstate.init.Normal(-55., 2., unit=u.mV)
)
self.E = brainstate.nn.AlignPostProj(
comm=brainstate.nn.EventFixedProb(self.n_exc, self.num, 0.02, 0.6 * u.mS),
syn=brainstate.nn.Expon.desc(self.num, tau=5. * u.ms),
out=brainstate.nn.COBA.desc(E=0. * u.mV),
post=self.N
)
self.I = brainstate.nn.AlignPostProj(
comm=brainstate.nn.EventFixedProb(self.n_inh, self.num, 0.02, 6.7 * u.mS),
syn=brainstate.nn.Expon.desc(self.num, tau=10. * u.ms),
out=brainstate.nn.COBA.desc(E=-80. * u.mV),
post=self.N
)
def update(self, t, inp):
with brainstate.environ.context(t=t):
spk = self.N.get_spike() != 0.
self.E(spk[:self.n_exc])
self.I(spk[self.n_exc:])
self.N(inp)
return self.N.get_spike()
def save_checkpoint(self):
braintools.file.msgpack_save('states.msgpack', self.states())
Documentation
For detailed documentation, tutorials, and examples, visit our Documentation Portal.
Contributing
We welcome contributions from the community! Please see our Contributing Guidelines for more information on how to get involved.
License
This project is licensed under the Apache License v2.0.
Citation
If you use the Brain Modeling Ecosystem in your research, please use the following link: https://brainmodeling.readthedocs.io/citation.html
Support
For questions and support, please open an issue or email to us: chao.brain@qq.com
Metadata
Release files for brainmodeling 2025.5.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| brainmodeling-2025.5.4-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for brainmodeling-2025.5.4-py2.py3-none-any.whl |
Release files / brainmodeling-2025.5.4-py2.py3-none-any.whl
| Download URL | brainmodeling-2025.5.4-py2.py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
0b464dffac2350008eb063da86a01d11e168744804a25d9f0a2fdc283689e063
|
|
BLAKE2b-256 checksum How to use checksums |
2a528d34dce1887cd34ac5a45b55748f45c8e6b9302f87092ded15be5eeb856e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.11
|
Security for brainmodeling 2025.5.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.