Skip to main content

Enabling Scalable Online Learning for Brain Dynamics.

Project description

BrainTrace

Eligibility Trace-based Online Learning for Brain Dynamics

Header image of braintrace.

Supported Python Version LICENSE Documentation PyPI version Continuous Integration Code Coverage

braintrace provides online learning algorithms for biological neural networks. It has been integrated into our establishing brain modeling ecosystem.

Installation

braintrace can run on Python 3.10+ installed on Linux, MacOS, and Windows. You can install braintrace via pip:

pip install braintrace --upgrade

Alternatively, you can install BrainX, which bundles braintrace with other compatible packages for a comprehensive brain modeling ecosystem:

pip install BrainX -U

Documentation

The official documentation is hosted on Read the Docs: https://brainx.chaobrain.com/braintrace

Citation

If you use this package in your research, please cite:

@Article{Wang2026,
  author={Wang, Chaoming
          and Dong, Xingsi
          and Ji, Zilong
          and Xiao, Mingqing
          and Jiang, Jiedong
          and Liu, Xiao
          and Huan, Yuxiang
          and Wu, Si},
  title={Model-agnostic linear-memory online learning in spiking neural networks},
  journal={Nature Communications},
  year={2026},
  month={Jan},
  day={19},
  abstract={Spiking neural networks (SNNs) offer a promising paradigm for modeling brain dynamics and developing neuromorphic intelligence, yet an online learning system capable of training rich spiking dynamics over long horizons with low memory footprints has been missing. Existing online approaches either incur quadratic memory growth, sacrifice biological fidelity through oversimplified models, or lack end-to-end automated tooling. Here, we introduce BrainTrace, a model-agnostic, linear-memory, and automated online learning system for spiking neural networks. BrainTrace standardizes model specification to encompass diverse neuronal and synaptic dynamics; implements a linear-memory online learning rule by exploiting intrinsic properties of spiking dynamics; and provides a compiler that automatically generates optimized online-learning code for arbitrary user-defined models. Across diverse dynamics and tasks, BrainTrace achieves strong learning performance with a low memory footprint and high computational throughput. Critically, these properties enable online fitting of a whole-brain-scale Drosophila SNN that recapitulates region-level functional activity. By reconciling generality, efficiency, and usability, BrainTrace establishes a foundation for spiking network modeling at scale.},
  issn={2041-1723},
  doi={10.1038/s41467-026-68453-w},
  url={https://doi.org/10.1038/s41467-026-68453-w},
  publisher={Nature Publishing Group UK London}
}

See also the ecosystem

braintrace is one part of our brain simulation ecosystem: https://brainx.chaobrain.com/

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

braintrace-0.2.2.tar.gz (309.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

braintrace-0.2.2-py3-none-any.whl (403.2 kB view details)

Uploaded Python 3

File details

Details for the file braintrace-0.2.2.tar.gz.

File metadata

  • Download URL: braintrace-0.2.2.tar.gz
  • Upload date:
  • Size: 309.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for braintrace-0.2.2.tar.gz
Algorithm Hash digest
SHA256 1c551a71e0d4c8975ff27b325e3adfb0f46ff01f10259d9cf61bdf049c92b771
MD5 b641bd75e122bb35183d4c8dccb21335
BLAKE2b-256 d504008b64a9554e7ad5f42c860665d752f419db9878b2930b6df9e8e9931fe4

See more details on using hashes here.

File details

Details for the file braintrace-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: braintrace-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 403.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for braintrace-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 526b3439da4f13c4071459ffa62261af12bf1c3fa003a50cf342db7a5f667d01
MD5 dd1cfadc5572435714337604942f58c8
BLAKE2b-256 c85a7f23da2ae5764443c56a6f4ead2f148bad1c8d1c4488a297e116e86e4949

See more details on using hashes here.

Supported by

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