BrainPy is a flexible, efficient, and extensible framework for computational neuroscience and brain-inspired computation based on the Just-In-Time (JIT) compilation. It provides an integrative ecosystem for brain dynamics programming, including brain dynamics building, simulation, training, analysis, etc.
- Website (documentation and APIs): https://brainpy.readthedocs.io/
- Source: https://github.com/brainpy/BrainPy
- Bug reports: https://github.com/brainpy/BrainPy/issues
- Ecosystem: https://brainmodeling.readthedocs.io/
BrainPy is rewritten based on brainstate since August 2025, please learn brainstate documentation for the latest updates.
BrainPy is based on Python (>=3.10) and can be installed on Linux (Ubuntu 16.04 or later), macOS (10.12 or later), and Windows platforms.
We provide a docker image for BrainPy. You can use the following command to pull the image:
$ docker pull brainpy/brainpy:latest
Then, you can run the image with the following command:
$ docker run -it --platform linux/amd64 brainpy/brainpy:latest
We provide a Binder environment for BrainPy. You can use the following button to launch the environment:
- BrainPy: The solution for the general-purpose brain dynamics programming.
- brainpy-examples: Comprehensive examples of BrainPy computation.
- brain modeling ecosystem: A collection of tools and libraries for brain modeling and simulation.
- 《神经计算建模实战》 (Neural Modeling in Action)
- 第一届神经计算建模与编程培训班 (First Training Course on Neural Modeling and Programming)
- 第二届神经计算建模与编程培训班 (Second Training Course on Neural Modeling and Programming)
If you are using brainpy
, please consider citing the corresponding paper:
@article {10.7554/eLife.86365,
article_type = {journal},
title = {BrainPy, a flexible, integrative, efficient, and extensible framework for general-purpose brain dynamics programming},
author = {Wang, Chaoming and Zhang, Tianqiu and Chen, Xiaoyu and He, Sichao and Li, Shangyang and Wu, Si},
editor = {Stimberg, Marcel},
volume = 12,
year = 2023,
month = {dec},
pub_date = {2023-12-22},
pages = {e86365},
citation = {eLife 2023;12:e86365},
doi = {10.7554/eLife.86365},
url = {https://doi.org/10.7554/eLife.86365},
abstract = {Elucidating the intricate neural mechanisms underlying brain functions requires integrative brain dynamics modeling. To facilitate this process, it is crucial to develop a general-purpose programming framework that allows users to freely define neural models across multiple scales, efficiently simulate, train, and analyze model dynamics, and conveniently incorporate new modeling approaches. In response to this need, we present BrainPy. BrainPy leverages the advanced just-in-time (JIT) compilation capabilities of JAX and XLA to provide a powerful infrastructure tailored for brain dynamics programming. It offers an integrated platform for building, simulating, training, and analyzing brain dynamics models. Models defined in BrainPy can be JIT compiled into binary instructions for various devices, including Central Processing Unit (CPU), Graphics Processing Unit (GPU), and Tensor Processing Unit (TPU), which ensures high running performance comparable to native C or CUDA. Additionally, BrainPy features an extensible architecture that allows for easy expansion of new infrastructure, utilities, and machine-learning approaches. This flexibility enables researchers to incorporate cutting-edge techniques and adapt the framework to their specific needs},
journal = {eLife},
issn = {2050-084X},
publisher = {eLife Sciences Publications, Ltd},
}