All Projects → BindsNET → Bindsnet

BindsNET / Bindsnet

Licence: agpl-3.0
Simulation of spiking neural networks (SNNs) using PyTorch.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Bindsnet

Aws Robomaker Sample Application Deepracer
Use AWS RoboMaker and demonstrate running a simulation which trains a reinforcement learning (RL) model to drive a car around a track
Stars: ✭ 105 (-87.46%)
Mutual labels:  reinforcement-learning, simulation
Autodrome
Framework and OpenAI Gym Environment for Autonomous Vehicle Development
Stars: ✭ 214 (-74.43%)
Mutual labels:  reinforcement-learning, simulation
Articulations Robot Demo
Stars: ✭ 145 (-82.68%)
Mutual labels:  reinforcement-learning, simulation
Maze
Maze Applied Reinforcement Learning Framework
Stars: ✭ 85 (-89.84%)
Mutual labels:  reinforcement-learning, simulation
Gym Miniworld
Simple 3D interior simulator for RL & robotics research
Stars: ✭ 338 (-59.62%)
Mutual labels:  reinforcement-learning, simulation
Hand dapg
Repository to accompany RSS 2018 paper on dexterous hand manipulation
Stars: ✭ 88 (-89.49%)
Mutual labels:  reinforcement-learning, simulation
Rl trading
An environment to high-frequency trading agents under reinforcement learning
Stars: ✭ 205 (-75.51%)
Mutual labels:  reinforcement-learning, simulation
Gym Alttp Gridworld
A gym environment for Stuart Armstrong's model of a treacherous turn.
Stars: ✭ 14 (-98.33%)
Mutual labels:  reinforcement-learning, simulation
QuadrotorFly
This is a dynamic simulation for quadrotor UAV
Stars: ✭ 61 (-92.71%)
Mutual labels:  simulation, dynamic
PySDM
Pythonic particle-based (super-droplet) warm-rain/aqueous-chemistry cloud microphysics package with box, parcel & 1D/2D prescribed-flow examples in Python, Julia and Matlab
Stars: ✭ 26 (-96.89%)
Mutual labels:  simulation, gpu-computing
Mabalgs
👤 Multi-Armed Bandit Algorithms Library (MAB) 👮
Stars: ✭ 67 (-92%)
Mutual labels:  reinforcement-learning, simulation
Awesome Robotics
A curated list of awesome links and software libraries that are useful for robots.
Stars: ✭ 478 (-42.89%)
Mutual labels:  reinforcement-learning, simulation
Pgdrive
PGDrive: an open-ended driving simulator with infinite scenes from procedural generation
Stars: ✭ 60 (-92.83%)
Mutual labels:  reinforcement-learning, simulation
Gym Ignition
Framework for developing OpenAI Gym robotics environments simulated with Ignition Gazebo
Stars: ✭ 97 (-88.41%)
Mutual labels:  reinforcement-learning, simulation
Bullet3
Bullet Physics SDK: real-time collision detection and multi-physics simulation for VR, games, visual effects, robotics, machine learning etc.
Stars: ✭ 8,714 (+941.1%)
Mutual labels:  reinforcement-learning, simulation
Mjrl
Reinforcement learning algorithms for MuJoCo tasks
Stars: ✭ 162 (-80.65%)
Mutual labels:  reinforcement-learning, simulation
Pysnn
Efficient Spiking Neural Network framework, built on top of PyTorch for GPU acceleration
Stars: ✭ 129 (-84.59%)
Mutual labels:  gpu-computing, dynamic
Plant
Trait-Driven Models of Ecology and Evolution 🌲
Stars: ✭ 39 (-95.34%)
Mutual labels:  simulation, dynamic
Awesome Real World Rl
Great resources for making Reinforcement Learning work in Real Life situations. Papers,projects and more.
Stars: ✭ 234 (-72.04%)
Mutual labels:  reinforcement-learning, simulation
Recsim
A Configurable Recommender Systems Simulation Platform
Stars: ✭ 461 (-44.92%)
Mutual labels:  reinforcement-learning, simulation

Important:

If you are using BindsNET for your research, please consider answering a short survey on the value of a standardized format that could be used for the exchange of computational models in neuroscience, cognitive science, and computer science.

Survey link

Data from this survey will be used exclusively for our own internal purposes, and will not be shared beyond our small group other than summary form for any purpose. The survey is anonymous unless you chose to add an email address for follow-up correspondence.

A Python package used for simulating spiking neural networks (SNNs) on CPUs or GPUs using PyTorch Tensor functionality.

BindsNET is a spiking neural network simulation library geared towards the development of biologically inspired algorithms for machine learning.

This package is used as part of ongoing research on applying SNNs to machine learning (ML) and reinforcement learning (RL) problems in the Biologically Inspired Neural & Dynamical Systems (BINDS) lab.

Check out the BindsNET examples for a collection of experiments, functions for the analysis of results, plots of experiment outcomes, and more. Documentation for the package can be found here.

Build Status Documentation Status HitCount Gitter chat

Requirements

  • Python 3.6
  • requirements.txt

Setting things up

Using pip

BindsNET is available through its git repository. Issue

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

to get the most recent stable release. Or, to build the bindsnet package from source, clone the GitHub repository, change directory to the top level of this project, and issue

pip install .

Or, to install in editable mode (allows modification of package without re-installing):

pip install -e .

To install the packages necessary to interface with the OpenAI gym RL environments library, follow their instructions for installing the packages needed to run the RL environments simulator (on Linux / MacOS).

Using Docker

Link to Docker repository.

We also provide a Dockerfile in which BindsNET and all of its dependencies come installed in. Issue

docker image build .

at the top level directory of this project to create a docker image.

To change the name of the newly built image, issue

docker tag <IMAGE_ID> <NEW_IMAGE_ID>

To run a container and get a bash terminal inside it, issue

docker run -it <NEW_IMAGE_ID> bash

Getting started

To run a near-replication of the SNN from this paper, issue

cd examples/mnist
python eth_mnist.py

There are a number of optional command-line arguments which can be passed in, including --plot (displays useful monitoring figures), --n_neurons [int] (number of excitatory, inhibitory neurons simulated), --mode ['train' | 'test'] (sets network operation to the training or testing phase), and more. Run the script with the --help or -h flag for more information.

A number of other examples are available in the examples directory that are meant to showcase BindsNET's functionality. Take a look, and let us know what you think!

Running the tests

Issue the following to run the tests:

python -m pytest test/

Some tests will fail if Open AI gym is not installed on your machine.

Background

The simulation of biologically plausible spiking neuron dynamics can be challenging. It is typically done by solving ordinary differential equations (ODEs) which describe said dynamics. PyTorch does not explicitly support the solution of differential equations (as opposed to brian2, for example), but we can convert the ODEs defining the dynamics into difference equations and solve them at regular, short intervals (a dt on the order of 1 millisecond) as an approximation. Of course, under the hood, packages like brian2 are doing the same thing. Doing this in PyTorch is exciting for a few reasons:

  1. We can use the powerful and flexible torch.Tensor object, a wrapper around the numpy.ndarray which can be transferred to and from GPU devices.

  2. We can avoid "reinventing the wheel" by repurposing functions from the torch.nn.functional PyTorch submodule in our SNN architectures; e.g., convolution or pooling functions.

The concept that the neuron spike ordering and their relative timing encode information is a central theme in neuroscience. Markram et al. (1997) proposed that synapses between neurons should strengthen or degrade based on this relative timing, and prior to that, Donald Hebb proposed the theory of Hebbian learning, often simply stated as "Neurons that fire together, wire together." Markram et al.'s extension of the Hebbian theory is known as spike-timing-dependent plasticity (STDP).

We are interested in applying SNNs to ML and RL problems. We use STDP to modify weights of synapses connecting pairs or populations of neurons in SNNs. In the context of ML, we want to learn a setting of synapse weights which will generate data-dependent spiking activity in SNNs. This activity will allow us to subsequently perform some ML task of interest; e.g., discriminating or clustering input data. In the context of RL, we may think of the spiking neural network as an RL agent, whose spiking activity may be converted into actions in an environment's action space.

We have provided some simple starter scripts for doing unsupervised learning (learning a fully-connected or convolutional representation via STDP), supervised learning (clamping output neurons to desired spiking behavior depending on data labels), and reinforcement learning (converting observations from the Atari game Space Invaders to input to an SNN, and converting network activity back to actions in the game).

Benchmarking

We simulated a network with a population of n Poisson input neurons with firing rates (in Hertz) drawn randomly from U(0, 100), connected all-to-all with a equally-sized population of leaky integrate-and-fire (LIF) neurons, with connection weights sampled from N(0,1). We varied n systematically from 250 to 10,000 in steps of 250, and ran each simulation with every library for 1,000ms with a time resolution dt = 1.0. We tested BindsNET (with CPU and GPU computation), BRIAN2, PyNEST (the Python interface to the NEST SLI interface that runs the C++NEST core simulator), ANNarchy (with CPU and GPU computation), and BRIAN2genn (the BRIAN2 front-end to the GeNN simulator).

Several packages, including BRIAN and PyNEST, allow the setting of certain global preferences; e.g., the number of CPU threads, the number of OpenMP processes, etc. We chose these settings for our benchmark study in an attempt to maximize each library's speed, but note that BindsNET requires no setting of such options. Our approach, inheriting the computational model of PyTorch, appears to make the best use of the available hardware, and therefore makes it simple for practicioners to get the best performance from their system with the least effort.

BindsNET%20Benchmark

All simulations run on Ubuntu 16.04 LTS with Intel(R) Xeon(R) CPU E5-2687W v3 @ 3.10GHz, 128Gb RAM @ 2133MHz, and two GeForce GTX TITAN X (GM200) GPUs. Python 3.6 is used in all cases. Clock time was recorded for each simulation run.

Citation

If you use BindsNET in your research, please cite the following article:

@ARTICLE{10.3389/fninf.2018.00089,
	AUTHOR={Hazan, Hananel and Saunders, Daniel J. and Khan, Hassaan and Patel, Devdhar and Sanghavi, Darpan T. and Siegelmann, Hava T. and Kozma, Robert},   
	TITLE={BindsNET: A Machine Learning-Oriented Spiking Neural Networks Library in Python},      
	JOURNAL={Frontiers in Neuroinformatics},      
	VOLUME={12},      
	PAGES={89},     
	YEAR={2018}, 
	URL={https://www.frontiersin.org/article/10.3389/fninf.2018.00089},       
	DOI={10.3389/fninf.2018.00089},      
	ISSN={1662-5196},
}

Contributors

License

GNU Affero General Public License v3.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].