Jaxley


NameJaxley JSON
Version 0.5.0 PyPI version JSON
download
home_pageNone
SummaryDifferentiable neuron simulations.
upload_time2024-11-25 10:55:09
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords neuroscience biophysics simulator jax
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
  <img src="https://raw.githubusercontent.com/jaxleyverse/jaxley/main/docs/logo.png" width="360">
</p>

<h1 align="center">Differentiable neuron simulations on CPU, GPU, or TPU</h1>

[![PyPI version](https://badge.fury.io/py/jaxley.svg)](https://badge.fury.io/py/jaxley)
[![Contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/jaxleyverse/jaxley/blob/main/CONTRIBUTING.md)
[![Tests](https://github.com/jaxleyverse/jaxley/workflows/Tests/badge.svg?branch=main)](https://github.com/jaxleyverse/jaxley/actions)
[![GitHub license](https://img.shields.io/github/license/jaxleyverse/jaxley)](https://github.com/jaxleyverse/jaxley/blob/main/LICENSE)

[**Documentation**](https://jaxley.readthedocs.io/en/latest/)
 | [**Getting Started**](https://jaxley.readthedocs.io/en/latest/tutorials/01_morph_neurons.html)
 | [**Install guide**](https://jaxley.readthedocs.io/en/latest/installation.html)
 | [**Reference docs**](https://jaxley.readthedocs.io/en/latest/jaxley.html)
 | [**FAQ**](https://jaxley.readthedocs.io/en/latest/faq.html)


## What is Jaxley?

`Jaxley` is a differentiable simulator for [biophysical neuron models](https://jaxley.readthedocs.io/en/latest/faq/question_03.html), written in the Python library [JAX](https://github.com/google/jax). Its key features are:

- automatic differentiation, allowing gradient-based optimization of thousands of parameters  
- support for CPU, GPU, or TPU without any changes to the code  
- `jit`-compilation, making it as fast as other packages while being fully written in python  
- support for multicompartment neurons  
- elegant mechanisms for parameter sharing  


## Getting started

`Jaxley` allows to simulate biophysical neuron models on CPU, GPU, or TPU:
```python
import matplotlib.pyplot as plt
from jax import config

import jaxley as jx
from jaxley.channels import HH

config.update("jax_platform_name", "cpu")  # Or "gpu" / "tpu".

cell = jx.Cell()  # Define cell.
cell.insert(HH())  # Insert channels.

current = jx.step_current(i_delay=1.0, i_dur=1.0, i_amp=0.1, delta_t=0.025, t_max=10.0)
cell.stimulate(current)  # Stimulate with step current.
cell.record("v")  # Record voltage.

v = jx.integrate(cell)  # Run simulation.
plt.plot(v.T)  # Plot voltage trace.
```

[Here](https://jaxley.readthedocs.io/en/latest/faq/question_03.html) you can find an overview of what kinds of models can be implemented in `Jaxley`. If you want to learn more, we recommend you to check out our tutorials on how to:

- [get started with `Jaxley`](https://jaxley.readthedocs.io/en/latest/tutorials/01_morph_neurons.html)
- [simulate networks of neurons](https://jaxley.readthedocs.io/en/latest/tutorials/02_small_network.html)
- [speed up simulations with GPUs and `jit`](https://jaxley.readthedocs.io/en/latest/tutorials/04_jit_and_vmap.html)
- [define your own channels and synapses](https://jaxley.readthedocs.io/en/latest/tutorials/05_channel_and_synapse_models.html)
- [compute the gradient and train biophysical models](https://jaxley.readthedocs.io/en/latest/tutorials/07_gradient_descent.html)


## Installation

`Jaxley` is available on [`PyPI`](https://pypi.org/project/jaxley/):
```sh
pip install jaxley
```
This will install `Jaxley` with CPU support. If you want GPU support, follow the instructions on the [`JAX` Github repository](https://github.com/google/jax) to install `JAX` with GPU support (in addition to installing `Jaxley`). For example, for NVIDIA GPUs, run
```sh
pip install -U "jax[cuda12]"
```


## Feedback and Contributions

We welcome any feedback on how Jaxley is working for your neuron models and are happy to receive bug reports, pull requests and other feedback (see [contribute](https://github.com/jaxleyverse/jaxley/blob/main/CONTRIBUTING.md)). We wish to maintain a positive community, please read our [Code of Conduct](https://github.com/jaxleyverse/jaxley/blob/main/CODE_OF_CONDUCT.md).


## License

[Apache License Version 2.0 (Apache-2.0)](https://github.com/jaxleyverse/jaxley/blob/main/LICENSE)


## Citation

If you use `Jaxley`, consider citing the [corresponding paper](https://www.biorxiv.org/content/10.1101/2024.08.21.608979):

```
@article{deistler2024differentiable,
  doi = {10.1101/2024.08.21.608979},
  year = {2024},
  publisher = {Cold Spring Harbor Laboratory},
  author = {Deistler, Michael and Kadhim, Kyra L. and Pals, Matthijs and Beck, Jonas and Huang, Ziwei and Gloeckler, Manuel and Lappalainen, Janne K. and Schr{\"o}der, Cornelius and Berens, Philipp and Gon{\c c}alves, Pedro J. and Macke, Jakob H.},
  title = {Differentiable simulation enables large-scale training of detailed biophysical models of neural dynamics},
  journal = {bioRxiv}
}
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "Jaxley",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "neuroscience, biophysics, simulator, jax",
    "author": null,
    "author_email": "jaxleyverse <jaxleyverse@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/55/4f/4ed76208cc87f69d8d6b02f8fa86ce719588a6af98fe24795543fc222d2b/jaxley-0.5.0.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\n  <img src=\"https://raw.githubusercontent.com/jaxleyverse/jaxley/main/docs/logo.png\" width=\"360\">\n</p>\n\n<h1 align=\"center\">Differentiable neuron simulations on CPU, GPU, or TPU</h1>\n\n[![PyPI version](https://badge.fury.io/py/jaxley.svg)](https://badge.fury.io/py/jaxley)\n[![Contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/jaxleyverse/jaxley/blob/main/CONTRIBUTING.md)\n[![Tests](https://github.com/jaxleyverse/jaxley/workflows/Tests/badge.svg?branch=main)](https://github.com/jaxleyverse/jaxley/actions)\n[![GitHub license](https://img.shields.io/github/license/jaxleyverse/jaxley)](https://github.com/jaxleyverse/jaxley/blob/main/LICENSE)\n\n[**Documentation**](https://jaxley.readthedocs.io/en/latest/)\n | [**Getting Started**](https://jaxley.readthedocs.io/en/latest/tutorials/01_morph_neurons.html)\n | [**Install guide**](https://jaxley.readthedocs.io/en/latest/installation.html)\n | [**Reference docs**](https://jaxley.readthedocs.io/en/latest/jaxley.html)\n | [**FAQ**](https://jaxley.readthedocs.io/en/latest/faq.html)\n\n\n## What is Jaxley?\n\n`Jaxley` is a differentiable simulator for [biophysical neuron models](https://jaxley.readthedocs.io/en/latest/faq/question_03.html), written in the Python library [JAX](https://github.com/google/jax). Its key features are:\n\n- automatic differentiation, allowing gradient-based optimization of thousands of parameters  \n- support for CPU, GPU, or TPU without any changes to the code  \n- `jit`-compilation, making it as fast as other packages while being fully written in python  \n- support for multicompartment neurons  \n- elegant mechanisms for parameter sharing  \n\n\n## Getting started\n\n`Jaxley` allows to simulate biophysical neuron models on CPU, GPU, or TPU:\n```python\nimport matplotlib.pyplot as plt\nfrom jax import config\n\nimport jaxley as jx\nfrom jaxley.channels import HH\n\nconfig.update(\"jax_platform_name\", \"cpu\")  # Or \"gpu\" / \"tpu\".\n\ncell = jx.Cell()  # Define cell.\ncell.insert(HH())  # Insert channels.\n\ncurrent = jx.step_current(i_delay=1.0, i_dur=1.0, i_amp=0.1, delta_t=0.025, t_max=10.0)\ncell.stimulate(current)  # Stimulate with step current.\ncell.record(\"v\")  # Record voltage.\n\nv = jx.integrate(cell)  # Run simulation.\nplt.plot(v.T)  # Plot voltage trace.\n```\n\n[Here](https://jaxley.readthedocs.io/en/latest/faq/question_03.html) you can find an overview of what kinds of models can be implemented in `Jaxley`. If you want to learn more, we recommend you to check out our tutorials on how to:\n\n- [get started with `Jaxley`](https://jaxley.readthedocs.io/en/latest/tutorials/01_morph_neurons.html)\n- [simulate networks of neurons](https://jaxley.readthedocs.io/en/latest/tutorials/02_small_network.html)\n- [speed up simulations with GPUs and `jit`](https://jaxley.readthedocs.io/en/latest/tutorials/04_jit_and_vmap.html)\n- [define your own channels and synapses](https://jaxley.readthedocs.io/en/latest/tutorials/05_channel_and_synapse_models.html)\n- [compute the gradient and train biophysical models](https://jaxley.readthedocs.io/en/latest/tutorials/07_gradient_descent.html)\n\n\n## Installation\n\n`Jaxley` is available on [`PyPI`](https://pypi.org/project/jaxley/):\n```sh\npip install jaxley\n```\nThis will install `Jaxley` with CPU support. If you want GPU support, follow the instructions on the [`JAX` Github repository](https://github.com/google/jax) to install `JAX` with GPU support (in addition to installing `Jaxley`). For example, for NVIDIA GPUs, run\n```sh\npip install -U \"jax[cuda12]\"\n```\n\n\n## Feedback and Contributions\n\nWe welcome any feedback on how Jaxley is working for your neuron models and are happy to receive bug reports, pull requests and other feedback (see [contribute](https://github.com/jaxleyverse/jaxley/blob/main/CONTRIBUTING.md)). We wish to maintain a positive community, please read our [Code of Conduct](https://github.com/jaxleyverse/jaxley/blob/main/CODE_OF_CONDUCT.md).\n\n\n## License\n\n[Apache License Version 2.0 (Apache-2.0)](https://github.com/jaxleyverse/jaxley/blob/main/LICENSE)\n\n\n## Citation\n\nIf you use `Jaxley`, consider citing the [corresponding paper](https://www.biorxiv.org/content/10.1101/2024.08.21.608979):\n\n```\n@article{deistler2024differentiable,\n  doi = {10.1101/2024.08.21.608979},\n  year = {2024},\n  publisher = {Cold Spring Harbor Laboratory},\n  author = {Deistler, Michael and Kadhim, Kyra L. and Pals, Matthijs and Beck, Jonas and Huang, Ziwei and Gloeckler, Manuel and Lappalainen, Janne K. and Schr{\\\"o}der, Cornelius and Berens, Philipp and Gon{\\c c}alves, Pedro J. and Macke, Jakob H.},\n  title = {Differentiable simulation enables large-scale training of detailed biophysical models of neural dynamics},\n  journal = {bioRxiv}\n}\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Differentiable neuron simulations.",
    "version": "0.5.0",
    "project_urls": null,
    "split_keywords": [
        "neuroscience",
        " biophysics",
        " simulator",
        " jax"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2720e6f7746f89719806c053f088b4eee915ff6155a16a33ffd020a48545d11f",
                "md5": "a27afd56d94ff4fd5b5cf590f6d07763",
                "sha256": "35198374191522fd77dd014d112aa145d9d38ba74e086d6c83128032507887d1"
            },
            "downloads": -1,
            "filename": "Jaxley-0.5.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a27afd56d94ff4fd5b5cf590f6d07763",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 159761,
            "upload_time": "2024-11-25T10:55:06",
            "upload_time_iso_8601": "2024-11-25T10:55:06.316940Z",
            "url": "https://files.pythonhosted.org/packages/27/20/e6f7746f89719806c053f088b4eee915ff6155a16a33ffd020a48545d11f/Jaxley-0.5.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "554f4ed76208cc87f69d8d6b02f8fa86ce719588a6af98fe24795543fc222d2b",
                "md5": "811341bb85797c8a7aea02304923c6f4",
                "sha256": "316296f31c39a60bdd109a53fdfa04f01d82f5c5b6743c27b47509df398659d0"
            },
            "downloads": -1,
            "filename": "jaxley-0.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "811341bb85797c8a7aea02304923c6f4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 122226,
            "upload_time": "2024-11-25T10:55:09",
            "upload_time_iso_8601": "2024-11-25T10:55:09.368897Z",
            "url": "https://files.pythonhosted.org/packages/55/4f/4ed76208cc87f69d8d6b02f8fa86ce719588a6af98fe24795543fc222d2b/jaxley-0.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-25 10:55:09",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "jaxley"
}
        
Elapsed time: 0.36590s