You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.
BrainPy 64f96d6bc5 Merge pull request 'Support multi-scale modeling in NumPy jit mode' (#19) from V1.1.0rc1 into master 1 week ago
brainpy update tests and README 1 week ago
docs support multi-scale modeling in NumPy jit 1 week ago
tests update tests and README 1 week ago
.gitignore support multi-scale modeling in NumPy jit 1 week ago
.travis.yml Add Travis CI 4 months ago
LICENSE GPL v3 LICENSE 11 months ago Update installation 8 months ago update tests and README 1 week ago support multi-scale modeling in NumPy jit 1 week ago
changelog.rst update docs 1 week ago
requirements-dev.txt update README and requirements 2 months ago
requirements-doc.txt update README 2 weeks ago
requirements.txt Add systematical documents 5 months ago update README 2 weeks ago


LICENSE Documentation PyPI version Build Status

Why to use BrainPy

BrainPy is an integrative framework for computational neuroscience and brain-inspired computation based on Just-In-Time (JIT) compilation (built on the top of JAX and Numba). Core functions provided in BrainPy includes

  • JIT compilation for class objects.
  • Numerical solvers for ODEs, SDEs, DDEs, FDEs, and others.
  • Dynamics simulation tools for various brain objects, like neurons, synapses, networks, soma, dendrites, channels, and even more.
  • Dynamics analysis tools for differential equations, including phase plane analysis and bifurcation analysis, continuation analysis and sensitive analysis.
  • Seamless integration with deep learning models, and has the speed benefit on JIT compilation.
  • And more ......

BrainPy is designed to effectively satisfy your basic requirements:

  • Easy to learn and use: BrainPy is only based on Python language and has little dependency requirements.
  • Flexible and transparent: BrainPy endows the users with the fully data/logic flow control. Users can code any logic they want with BrainPy.
  • Extensible: BrainPy allow users to extend new functionality just based on Python coding. For example, we extend the numerical integration with the ability to do numerical analysis. In such a way, the same code in BrainPy can not only be used for simulation, but also for dynamics analysis.
  • Efficient: All codes in BrainPy can be just-in-time compiled (based on JAX and Numba) to run on CPU or GPU devices, thus guaranteeing its running efficiency.

How to use BrainPy

Step 1: installation

BrainPy is based on Python (>=3.6), and the following packages are required to be installed to use BrainPy:

  • NumPy >= 1.15
  • Matplotlib >= 3.3

The installation details please see documentation: Quickstart/Installation

Method 1: install BrainPy by using pip:

To install the stable release of BrainPy (V1.0.3), please use

> pip install -U brain-py

To install the latest pre-release version of BrainPy (V1.1.0), please use

> pip install -U brain-py --pre

If you have installed the previous version of BrainPy, please uninstall the older one first

> pip uninstall brainpy-simulator

# Then install the latest version of BrainPy
> pip install -U brain-py --pre

Method 2: install BrainPy from source:

> pip install git+
> # or
> pip install git+
> # or
> pip install -e git://

Other dependencies: you want to get the full supports by BrainPy, please install the following packages:

  • JAX >= 0.2.10, needed for “jax” backend and “dnn” module
  • Numba >= 0.52, needed for JIT compilation on “numpy” backend
  • SymPy >= 1.4, needed for dynamics “analysis” module and Exponential Euler method

Step 3: inspirational examples

Here list several examples of BrainPy. More detailed examples and tutorials please see BrainModels.

Neuron models

See brainmodels.neurons to find more.

Synapse models

See brainmodels.synapses to find more.

Network models

Low-dimension dynamics analysis

Learning through back-propagation


A flexible and extensible framework for brain modeling


Python Markdown reStructuredText