Library / SDK
BindsNET/bindsnet avatar
BindsNET/bindsnet

BindsNET: a PyTorch-based spiking neural network simulator for STDP and reinforcement learning research

Simulation of spiking neural networks (SNNs) using PyTorch.

1,703 stars351 forksPythonAGPL-3.0

At a glance

What is it?
BindsNET turns neuron dynamics into difference equations solved on torch.Tensor, so you can run STDP-based SNNs on a GPU. It suits researchers who already know PyTorch; it is not a general deep learning framework.
Who is it for?
Adopt BindsNET if you are doing biologically inspired SNN research with STDP or RL and you are comfortable reading PyTorch code, particularly if you want the Diehl and Cook 2015 MNIST replication that REPRODUCING.md maps to examples/mnist/eth_mnist.py. Do not adopt it if you need a permissively licensed dependency, since the package is AGPL-3.0-only, or if you want a maintained release cadence: 0.3.1 shipped in 2022, 0.3.3 in 2024 and 0.3.4 in 2026.
Can I use it commercially?
Yes, with strict conditions. AGPL-3.0 is a network copyleft licence: if people use a modified version over a network, for example as a hosted service, you must offer them its source code under the same licence.
Is it still maintained?
Yes. The repository last received commits 3 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 1, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What BindsNET is for, and who actually needs it

BindsNET is a Python package for simulating spiking neural networks on CPUs or GPUs using PyTorch Tensor functionality. The README frames the goal narrowly: it is geared towards the development of biologically inspired algorithms for machine learning, and it is used in ongoing research at the BINDS lab at UMass and the Allen Discovery Center at Tufts. If your work involves spike-timing-dependent plasticity and you want the weight updates to happen inside a PyTorch computation graph rather than in a separate simulator, that is the gap this fills.

The intended user is a researcher who already writes PyTorch. The README's own argument for the design is that solving the ordinary differential equations behind neuron dynamics in torch.Tensor lets you reuse torch.nn.functional for convolution and pooling, and lets you move tensors to and from GPU devices. Nothing in the package targets a practitioner who wants a scikit-learn style fit and predict interface. The examples directory holds experiments, result analysis functions and plots, and the README points readers there rather than at a task-level API.

How the simulation works: ODEs become difference equations on tensors

The mechanism is stated plainly in the README's Background section. PyTorch does not explicitly support solving differential equations, unlike brian2. BindsNET's answer is to convert the ODEs that define neuron dynamics into difference equations and solve them at regular, short intervals, with a dt on the order of 1 millisecond. The README concedes that brian2 is doing the same thing under the hood; the difference is where the arithmetic lives.

That choice has consequences for the surrounding architecture. Because states are tensors, a network can be built from PyTorch primitives: convolution and pooling functions come from torch.nn.functional instead of being reimplemented. Synaptic weights are modified with STDP, which the README traces to Markram et al. (1997) as an extension of Hebbian learning. In the ML case the objective is a setting of synapse weights that produces data-dependent spiking activity, which is then used for a task such as discriminating or clustering input data. The repository topics list both stdp and reinforcement-learning, and the README describes the RL case as modifying synapse weights in the same way, with the activity feeding a reinforcement learning problem.

One practical note on data: BindsNET ships no third-party datasets. The loaders fetch them from upstream sources, and DATA.md declares each dataset and synthetic stimulus with its source, retrieval method, license pointer and spike-encoding preprocessing. If you need to audit where MNIST or an Atari frame came from, that file is the place to look, not the README.

Installing BindsNET and running the MNIST example

The requirement line is strict and worth reading before anything else: Python >=3.11,<3.14, continuously tested on 3.11, 3.12 and 3.13. The pinned dependency set lives in poetry.lock, and the README offers it as the byte-for-byte reproducible path.

bash
poetry install

If you prefer pip, the README gives three routes. The first installs the most recent stable release straight from GitHub:

bash
pip install git+https://github.com/BindsNET/bindsnet.git

Cloning the repository and running `pip install .` from the top level builds the package from source, and `pip install -e .` installs it in editable mode so you can modify the package without reinstalling. Note that the pyproject.toml pins torch 2.14.0 and torchvision 0.29.0, with a separate wheel source named torch+cu130 at https://download.pytorch.org/whl/cu130 used on non-darwin platforms. On macOS the same versions resolve without that source.

For a first real use, the README points at a near-replication of the SNN from a 2015 Frontiers paper. Change into the example directory and run the script:

bash
cd examples/mnist
python eth_mnist.py

That script is the Diehl and Cook 2015 MNIST replication that REPRODUCING.md maps to its model class, exact command, seed and expected output. Optional arguments include `--plot` to display monitoring figures, `--n_neurons [int]` for the number of excitatory and inhibitory neurons, and `--mode ['train' | 'test']` to set the training or testing phase. Run the script with `--help` or `-h` for the full list. Expect the first run to spend time fetching MNIST through the loader described in DATA.md.

Docker is the other supported route. The README links a Docker Hub repository and ships a Dockerfile that installs BindsNET with its dependencies. Build it at the top level of the project:

bash
docker build .

Then tag the result with `docker tag <IMAGE_ID> <NEW_IMAGE_ID>` and start a container with `docker run -it <NEW_IMAGE_ID> bash`. The Dockerfile in the repository is more conservative than the pip path in one respect: it installs Python 3.8 and CUDA 11.1 from nvidia/cuda:11.1-base, which does not match the >=3.11,<3.14 requirement stated for the package. Treat the Dockerfile as the pinned stack the README advertises, and check which Python it actually gives you before assuming it matches the pip install.

Where BindsNET is the wrong tool

The clearest limitation is licensing. pyproject.toml declares license = "AGPL-3.0-only", and the repository ships LICENSE and SECURITY.md at the top level. AGPL-3.0 is a strong copyleft licence, and its network clause reaches software offered to users over a network. If you are building a closed product that links BindsNET, or a hosted service that runs it, the licence is the first thing to route to whoever handles your legal review. Nothing in the repository grants a permissive alternative.

A second limitation is the release cadence. The recent releases are 0.3.1 in February 2022, 0.3.3 in October 2024 and 0.3.4 in June 2026. The last push to the repository was on 2026-09-07, so work is happening, but the version numbers move slowly and the 0.3.3 release name, Multicompartment Connection, was the only feature-labelled entry in that list. If you need a library with a predictable deprecation policy and frequent minor releases, the version history does not promise that.

A third limitation is scope. BindsNET is a simulator for biologically inspired algorithms, not a drop-in replacement for a standard deep learning stack. The README's own comparison is with brian2, and it admits that brian2 solves the same ODEs by the same discretisation. What BindsNET adds is tensor and GPU execution plus access to torch.nn.functional, and what it gives up is brian2's dedicated equation-parsing front end. If your model is described in brian2's equation syntax and you do not need GPU tensor ops, switching costs you the notation and buys you little. Finally, the tests are not self-contained: the README states that some tests fail if OpenAI gym is not installed, so a clean `python -m pytest test/` run is not a pure pass or fail signal about the package itself.

BindsNET compared with brian2 and snnTorch

The README names brian2 directly and the difference is architectural, not cosmetic. brian2 explicitly supports solving differential equations; BindsNET does not, and instead converts the ODEs into difference equations stepped at a dt around 1 millisecond. BindsNET's stated payoff is that the state lives in torch.Tensor, which can move to a GPU and which interoperates with torch.nn.functional for convolution and pooling. So the split is: brian2 for equation-level modelling fidelity and its own DSL, BindsNET for models you want to express as PyTorch tensors and run on a GPU.

snnTorch appears in the related searches as a peer project, and the honest comparison is about abstraction level. BindsNET ships a package with neuron and synapse abstractions, dataset loaders declared in DATA.md, a test suite, and a set of example experiments including breakout, mnist, stress_test, tensorboard and benchmark. That is a research scaffold, not a minimal layer. If you want a thin set of spiking primitives to embed in an existing PyTorch training loop, a lighter library will cost you less to integrate. If you want the Diehl and Cook MNIST replication and the Hazan et al. 2018 scaling benchmark already wired up, the work is done for you here, and REPRODUCING.md maps each shipped model and published claim to its model class, example script, exact command, seed and expected output. That mapping is the strongest argument for BindsNET over a thinner alternative, because it makes the published numbers checkable rather than aspirational.

Maintenance, upgrades and the licence you are accepting

The repository is not archived, and the last push was on 2026-09-07. Releases are sparse: 0.3.1 in 2022, 0.3.3 in 2024, 0.3.4 in 2026. The version in pyproject.toml is 0.3.4, matching the most recent release, so the packaging metadata and the release tag agree. CHANGELOG.md sits at the top level, which is where to look for what changed between 0.3.3 and 0.3.4 rather than inferring it from the version number.

Upgrade cost is dominated by the dependency pins. Python is constrained to >=3.11,<3.14, so a 3.10 environment will not install and a 3.14 environment will not either. torch is pinned at 2.14.0 and torchvision at 0.29.0, with a dedicated wheel index for CUDA 13.0 on non-darwin platforms. numpy is ^2, pandas ^3, pytest ^9 and black ^26 in the dev group. Those are aggressive floors: the numpy 2 major version and the pandas 3 major version both break code written against their predecessors, so a project that pins BindsNET alongside older scientific Python will have to reconcile the two sets. The poetry.lock file is committed, which is the escape hatch: install from the lock and you get the exact set the maintainers tested, at the cost of not being able to float any of it.

On licence, the fact is that pyproject.toml declares AGPL-3.0-only and LICENSE is present in the repository. AGPL-3.0-only means no later-version option is granted by the metadata. What that implies for your distribution or your hosted service is a question for a lawyer, not for this article. The relevant engineering point is that the licence is a property of the package you would be depending on, and it does not change with how you install it, whether from pip, from source, or from the Docker image.

Editorial conclusion

Adopt BindsNET if you are doing biologically inspired SNN research with STDP or RL and you are comfortable reading PyTorch code, particularly if you want the Diehl and Cook 2015 MNIST replication that REPRODUCING.md maps to examples/mnist/eth_mnist.py. Do not adopt it if you need a permissively licensed dependency, since the package is AGPL-3.0-only, or if you want a maintained release cadence: 0.3.1 shipped in 2022, 0.3.3 in 2024 and 0.3.4 in 2026. Before committing, verify that your Python version falls in the >=3.11,<3.14 range and that the pinned torch 2.14.0 wheel source resolves on your platform.

Frequently asked questions

How does BindsNET simulate a spiking neural network?

It converts the ordinary differential equations that define neuron dynamics into difference equations and solves them at regular short intervals, with a dt on the order of 1 millisecond. The state is held in PyTorch tensors, so the simulation can run on a GPU and reuse functions from torch.nn.functional.

Is BindsNET a Python library for neural networks?

It is a Python package for simulating spiking neural networks on CPUs or GPUs using PyTorch Tensor functionality, geared towards biologically inspired algorithms for machine learning. It is not a general-purpose deep learning framework.

What is BindsNET used for in machine learning research?

The README describes applying SNNs to machine learning and reinforcement learning problems, using STDP to modify the weights of synapses connecting pairs or populations of neurons. In the ML case the aim is a setting of synapse weights that produces data-dependent spiking activity for a task such as discriminating or clustering input data.

Which Python version does BindsNET require?

The README and pyproject.toml both state Python >=3.11,<3.14, continuously tested on 3.11, 3.12 and 3.13. Note that the shipped Dockerfile installs Python 3.8 and CUDA 11.1, which does not match that range.

What licence does BindsNET use?

pyproject.toml declares license = "AGPL-3.0-only", and the repository contains a LICENSE file. That is a strong copyleft licence, so check how it interacts with your own distribution before depending on the package.

How do I run the MNIST example in BindsNET?

The README gives the commands cd examples/mnist followed by python eth_mnist.py. Optional arguments include --plot, --n_neurons [int] and --mode ['train' | 'test'], and the script accepts --help or -h.

Official sources

  1. BindsNET/bindsnet on GitHub
  2. Issues
  3. License: AGPL-3.0
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/bindsnet-bindsnet.svg)](https://hysenlabs.com/projects/bindsnet-bindsnet)