Skip to main content

A toolbox for brain network modeling on GPUs

Project description

https://raw.githubusercontent.com/amnsbr/cubnm/main/docs/_static/logo_text.png https://zenodo.org/badge/DOI/10.5281/zenodo.12097797.svg https://img.shields.io/pypi/v/cubnm https://img.shields.io/readthedocs/cubnm https://img.shields.io/badge/docker-amnsbr/cubnm-blue.svg?logo=docker https://app.codacy.com/project/badge/Grade/e1af99e878bc4dbf9525d8eb610e0026 https://img.shields.io/github/license/amnsbr/cubnm

cuBNM toolbox is designed for efficient brain network modeling on GPUs.

Overview

cuBNM toolbox uses GPUs to efficiently run simulations of brain network models consisting of nodes (neural mass models) which are connected through a connectome, and fit them to empirical neuroimaging data through integrated optimization algorithms.

GPU parallelization enables massive scaling of the simulations into higher number of simulations and nodes. Below you can see how computing time varies as a funciton of number of simulations and nodes on GPUs versus CPUs. For example, running 32,768 simulations (duration: 60s, nodes: 100) would take 4 days on a single CPU thread, but only 5 minutes on Nvidia A100 GPU, and 22 minutes on Nvidia GeForce RTX 4080 Super:

Scaling plots

GPU usage is the primary focus of the toolbox but it also supports running the simulations on single or multiple cores of CPU. CPUs will be used if no GPUs are detected or if requested by the user.

Several commonly used models (e.g., reduced Wong-Wang, Jansen-Rit, Kuramoto, Wilson-Cowan) are implemented, and new models can be added via YAML definition files. A guide is included on the structure of model definition YAML fiels to help users implement their own models.

The simulated activity of model neurons is fed into the Balloon-Windkessel model to calculate simulated BOLD signal. Functional connectivity (FC) and functional connectivity dynamics (FCD) from the simulated BOLD signal are calculated efficiently on GPUs/CPUs and compared to FC and FCD matrices derived from empirical BOLD signals to assess similarity (goodness-of-fit) of the simulated to empirical BOLD signal. The toolbox supports parameter optimization algorithms including grid search and evolutionary optimizers (via pymoo), such as the covariance matrix adaptation-evolution strategy (CMA-ES). Parallelization within the grid or the iterations of evolutionary optimization is done at the level of simulations (across the GPU ‘blocks’), and nodes (across each block’s ‘threads’). The models can incorporate global or regional free parameters that are fit to empirical data using the provided optimization algorithms. Regional parameters can be homogeneous or vary across nodes based on a parameterized combination of fixed maps or independent free parameters for each node or group of nodes.

At its core the toolbox runs highly parallelized simulations using C++/CUDA, while the user interface is written in Python and allows for user control over simulation configurations:

Flowchart of the cuBNM program

Documentation

Please find the documentations on installation, usage examples and API at https://cubnm.readthedocs.io.

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

cubnm-0.1.0rc1.tar.gz (4.4 MB view details)

Uploaded Source

Built Distributions

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

cubnm-0.1.0rc1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

cubnm-0.1.0rc1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

cubnm-0.1.0rc1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

cubnm-0.1.0rc1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.6 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

cubnm-0.1.0rc1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.6 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

cubnm-0.1.0rc1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.7 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

File details

Details for the file cubnm-0.1.0rc1.tar.gz.

File metadata

  • Download URL: cubnm-0.1.0rc1.tar.gz
  • Upload date:
  • Size: 4.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.5

File hashes

Hashes for cubnm-0.1.0rc1.tar.gz
Algorithm Hash digest
SHA256 1ca4bfdc5b9ef374ad0c769b86733b38dc73fe1869734c8f7ebf5c3d9c63c74d
MD5 a6c143d2a15f68717e608409d6aff98b
BLAKE2b-256 29f438536d75058c2116cce28014182a3e4a83d475c53a4f1e3b60a7c58d6a45

See more details on using hashes here.

File details

Details for the file cubnm-0.1.0rc1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cubnm-0.1.0rc1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5cbf0c116c157a8dc3cd0cbb28a988c985502db03198b201b5e409d752b7308c
MD5 f092f03c8c62b551bb814e418418c587
BLAKE2b-256 580435fbb0a7a58d87959985f403957b5a12bf4757bab69d56cfa188480b6f4f

See more details on using hashes here.

File details

Details for the file cubnm-0.1.0rc1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cubnm-0.1.0rc1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a024c1c29aff6073419f40c7a296c4fe357b5e2b9da65bcd7cf78d30180502ca
MD5 2cf6f3e23cbb4e1bff3a7060e32e72e6
BLAKE2b-256 c37e881da0ccca65d6e1751919a5796776a4b917d10c1dc4dd62afe5d17a098a

See more details on using hashes here.

File details

Details for the file cubnm-0.1.0rc1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cubnm-0.1.0rc1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f5872b42795fb0ed9426a2f3d836a48ee1fc06ef1926e602defea5f4b58c55a0
MD5 0e458fcff7a804715ff4824f31b8bae0
BLAKE2b-256 41e8460060fac12e120d917b131fc337ab6f91a75875caa18684a7b7915f9076

See more details on using hashes here.

File details

Details for the file cubnm-0.1.0rc1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cubnm-0.1.0rc1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 80140f90daebb647226f17904ca64690dccb7543aa33059a4ae8119d329dab81
MD5 3a3ada989bb92e2602ce4e8de38b6783
BLAKE2b-256 80c952fa04496eaf293d83a9c9cade75b7d1d3fe1474b14b13951178aa1c3aa2

See more details on using hashes here.

File details

Details for the file cubnm-0.1.0rc1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cubnm-0.1.0rc1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7c023a67d581ddb4a92854bee0e69685a4c890ae37a7d4bfb66e5dca60316c82
MD5 13705321555776908fcd64476885acf7
BLAKE2b-256 9f13fe72ef453e4e1987dfc6a773c2b629f148afc83325e7947a2f962e7f6c2c

See more details on using hashes here.

File details

Details for the file cubnm-0.1.0rc1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cubnm-0.1.0rc1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 59d2d56598fa1257601c70cdea5d56c487c666b488e81267138b0b01cac19c74
MD5 22b001588de3f449cfd24935ae2ba16b
BLAKE2b-256 dc3da100928f94511eda4f54e2c2f65858bf8885522bc5e7864cde923ad96a36

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