Skip to main content

BrainPy: Brain Dynamics Programming in Python

Project description

Logo

LICENSE Documentation PyPI version Build Status

:clap::clap: CHEERS: A new version of BrainPy (>=2.0.0) has been released! :clap::clap:

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). Core functions provided in BrainPy includes

  • JIT compilation for functions and class objects.
  • Numerical solvers for ODEs, SDEs, 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, and linearization analysis.
  • Seamless integration with deep learning models.
  • And more ......

BrainPy is designed to effectively satisfy your basic requirements:

  • Pythonic: BrainPy is based on Python language and has a Pythonic coding style.
  • 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 cods. Almost every part of BrainPy system can be extended to be customized.
  • Efficient: All codes in BrainPy can be just-in-time compiled (based on JAX) to run on CPU, GPU or TPU 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
  • jax >= 0.2.10
  • sympy >= 1.6
  • matplotlib >= 3.4

The installation details please see documentation: Quickstart/Installation

Method 1: install BrainPy by using pip:

To install the stable release of BrainPy, please use

> pip install -U brain-py

Method 2: install BrainPy from source:

> pip install git+https://github.com/PKU-NIP-Lab/BrainPy
>
> # or
>
> git clone https://github.com/PKU-NIP-Lab/BrainPy
> cd BrainPy
> python setup.py install

Step 2: useful links

Step 3: inspirational examples

Here we list several examples of BrainPy. More detailed examples and tutorials please see BrainModels or BrainPy-Examples.

Neuron models

See brainmodels.neurons to find more.

Synapse models

See brainmodels.synapses to find more.

Network models

Dynamics learning

Low-dimensional dynamics analysis

High-dimensional dynamics analysis

BrainPy V1

If you are using brainpy==1.x, you can find documentations, examples, and models though the following links:

The changes from brainpy==1.x to brainpy==2.x can be inspected through API documentation: release notes.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

brain-py-2.0.0rc3.tar.gz (275.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page