[PYTHON] Try SNN with BindsNET

I tried using Brian2 in the previous article, but this time I will use BindsNET, which is software that can implement SNN.

SNN (Spiking Neural Network) is closer to neurophysiology than the current Deep Learning, and learning is performed using simulation of neural activity. SNN and BindsNET are also introduced in this article.

GitHub:https://github.com/BindsNET/bindsnet Paper: https://www.frontiersin.org/articles/10.3389/fninf.2018.00089/full Documentation: https://bindsnet-docs.readthedocs.io/

While NEURON and Brian2 are mainly used for simulators, BindsNET will be mainly used as machine learning software. BindsNET is based on PyTorch and can also use GPU. It seems that BindsNET can implement reinforcement learning as well as supervised and unsupervised learning.

Installation

The environment is Ubuntu 16.04 CUDA 10 Anaconda Python 3.6 is.

pip install bindsnet

You have now installed. The version was 0.2.7.

However, if this is left as it is, an error will occur when running the demo. The workaround was to change the version of Pytorch and reinstall it with pytorch == 1.2.0.

Try the demo

First, download it with git clone.

git clone https://github.com/BindsNET/bindsnet.git

There are various demos in bindsnet / examples /. For the time being, I will run a demo of supervised learning.

cd examples/mnist/
python supervised_mnist.py

It took about 20 minutes to complete, but it worked. I was able to use the GPU with the --gpu option, but it didn't get faster. (Rather a little slower.) I was also worried that the test score was not very good.

I'll also run a demo of unsupervised learning (Diehl & Cook).

python eth_mnist.py

This seems to take several hours to complete.

Other demonstrations included self-organizing maps (SOMs), reservoir computing, and reinforcement learning.

Implementation method

According to Documentation, the implementation method is (1) Creation of network and (2) Definition of learning rules It seems to do two things. When creating a network, LIF neurons etc. are defined as layers and connected. In the definition of learning rules, we set learning rules such as Hebb law and STDP law for coupling.

Finally

BindsNET cannot solve ODE of neural dynamics, but it seems that learning by SNN can be done easily. Machine learning using SNN is still undergoing various studies in developing fields, and BindsNET may play a major role.

Recommended Posts

Try SNN with BindsNET
Try scraping with Python.
Try regression with TensorFlow
Try to factorial with recursion
Try function optimization with Optuna
Try deep learning with TensorFlow
Try using PythonTex with Texpad.
Try edge detection with OpenCV
Try implementing RBM with chainer.
Try Google Mock with C
Try using matplotlib with PyCharm
Try GUI programming with Hy
Try an autoencoder with Pytorch
Try Python output with Haxe 3.2
Try matrix operation with NumPy
Try running CNN with ChainerRL
Try various things with PhantomJS
Try running Python with Try Jupyter
Try implementing perfume with Go
Try Selenium Grid with Docker
Try face recognition with Python
Try OpenCV with Google Colaboratory
Try machine learning with Kaggle
Try TensorFlow MNIST with RNN
Try building JupyterHub with Docker
Try using folium with anaconda
Try Deep Learning with FPGA-Select Cucumbers
Try scraping with Python + Beautiful Soup
Reinforcement learning 13 Try Mountain_car with ChainerRL.
Try to operate Facebook with Python
Try singular value decomposition with Python
Try face recognition with Generated Photos
Try horse racing prediction with Chainer
Try to profile with ONNX Runtime
Try machine learning with scikit-learn SVM
Try L Chika with raspberry pi
Try face recognition with python + OpenCV
Try running Jupyter with VS Code
Try mining Bitcoin with Python's hashlib
Beginner RNN (LSTM) | Try with Keras
Try moving 3 servos with Raspberry Pi
Try frequency control simulation with Python
Try blurring the image with opencv2
Try Common Representation Learning with chainer
Try to output audio with M5STACK
Try data parallelism with Distributed TensorFlow
Try using Python's networkx with AtCoder
[PyStan] Try Graphical Lasso with Stan.
Try to reproduce color film with Python
Try logging in to qiita with Python
Try mathematical formulas using Σ with python
Try working with binary data in Python
Try implementing XOR with Keras Functional API
Try the Variational-Quantum-Eigensolver (VQE) algorithm with Blueqat
Try drawing a normal distribution with matplotlib
Try using the camera with Python's OpenCV
Try Bitcoin Price Forecasting with Deep Learning
Try with Chainer Deep Q Learning --Launch
Let's try gRPC with Go and Docker
Try using Python with Google Cloud Functions
Try fishing for smelt with Raspberry Pi