Skip to main content

Differentiable neuron simulations.

Project description

Differentiable neuron simulations on CPU, GPU, or TPU

PyPI version Contributions welcome Tests GitHub license

Documentation | Getting Started | Install guide | Reference docs | FAQ

What is Jaxley?

Jaxley is a differentiable simulator for biophysical neuron models, written in the Python library 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:

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 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:

Installation

Jaxley is available on PyPI:

pip install jaxley

This will install Jaxley with CPU support. If you want GPU support, follow the instructions on the JAX Github repository to install JAX with GPU support (in addition to installing Jaxley). For example, for NVIDIA GPUs, run

pip install -U "jax[cuda13]"

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). We wish to maintain a positive community, please read our Code of Conduct.

License

Apache License Version 2.0 (Apache-2.0)

Citation

If you use Jaxley, consider citing the corresponding paper:

@article{deistler2025jaxley,
  title={Jaxley: differentiable simulation enables large-scale training of detailed biophysical models of neural dynamics},
  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 others},
  journal={Nature Methods},
  pages={1--9},
  year={2025},
  publisher={Nature Publishing Group US New York}
}

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

jaxley-0.12.0.tar.gz (189.9 kB view details)

Uploaded Source

Built Distribution

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

jaxley-0.12.0-py3-none-any.whl (238.2 kB view details)

Uploaded Python 3

File details

Details for the file jaxley-0.12.0.tar.gz.

File metadata

  • Download URL: jaxley-0.12.0.tar.gz
  • Upload date:
  • Size: 189.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for jaxley-0.12.0.tar.gz
Algorithm Hash digest
SHA256 2ba06055f1a28f77284499df055d8f2fd559912529c17198de5fb621e4149cd1
MD5 b7390276fddfba2928f103e96e8eeb08
BLAKE2b-256 2e6451d91858fea6d849a4d6d9cd705e72d98d0c263676c004f24618cb27c323

See more details on using hashes here.

File details

Details for the file jaxley-0.12.0-py3-none-any.whl.

File metadata

  • Download URL: jaxley-0.12.0-py3-none-any.whl
  • Upload date:
  • Size: 238.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for jaxley-0.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 18014c85398a8d917fe1e3b25584ceda5beda36376e43da32600e74947c0c9d0
MD5 2fdf01152f5ea9e2f16720c2d73108ab
BLAKE2b-256 79b4335d6a6bd9793a41b57c7280b9ba924a164f9015c2a80f6a68889701bd02

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