# Best Python Library for Spiking Neural Networks?

I'm trying to experiment with Spiking Neural Networks and I'm wanting to use a high-level programming language like Python.

I've come across some libraries, i.e., snnTorch, Brian 2, ANNarchy, BindsNET and so on.

What is the best library? Is there a detailed list / comparison somewhere?

It depends on your intended use Gentian - best is a very subjective measure! Some packages are designed to directly simulate biological neuronal behaviour and firing potentials in the brain for the purposes of neuroscience research only. Others are more pragmatic in terms of their applied use as a computer / data science tool, and as a useable alternative to "traditional" deep neural networks/ANNs.

Personally, for the latter, although I commenced my research work on BindsNet, I'd go for snnTorch. BindsNet is very capable, and started off life well in 2018, but from my perspective, development seems to have slowed down in the last 12 months, although it started to recommence commits this last month. However, for complete beginners with SNNs, it has fewer examples and tutorial notebooks than snnTorch, which is equally capable for my purposes.

snnTorch also has numerous examples which work without problems, and is actively supported by its developer Jason Eshraghian, a post-Doc researcher & Fulbright Scholar, and his team at the University of Michigan.

snnTorch, like BindsNet, is based on PyTorch. Personally, I've found snnTorch to be the package that's most flexible, easiest to understand, and has a clear syntax, although I appreciate this may be subjective. Jason's an exceptionally good, clear communicator, who doesn't bog his code down in mathematics, which is essential to commercial implementations, and for anyone who's not got degree level understanding of the mathematics behind deep learning.

It also has a clean dependency tree - if you can install PyTorch and Python 3.7 upwards, snnTorch will install without any problems. Most importantly for my own work, I've found it installs and works first time in the AWS SageMaker Studio environment in the cloud, which is a major consideration for my research due to moving around and working from different locations and not wanting to take hardware with me. This in turn also allows me to trains my SNNs on GPU accelerated hardware.

Finally, snnTorch is also extremely well documented, with very clear explanations, which are essential if you're just starting out.

Easy installs aren't always the case for other SNN packages, which can range from mildly challenging to outright frustrating to install. Norse also looks good, and also has numerous example Jupyter notebooks for beginners, but I found it can provide challenges installing it in some environments.

As an aside, in my opinion there is no clear leader in the SNN package /framework race yet, particularly for applied commercial use. This contrasts starkly with DNN frameworks, where Tensorflow/Keras, PyTorch and to a lesser extend MXNet are the pack leaders, with numerous utilities, broad support, tutorials and example code.

However, snnTorch has gained very strong support in just 12-18 months as one of the most popular SNN packages, probably due to the factors I outlined above. My personal opinion is that it may become a leader due to its usability and support, another factor in chosing it for my own research.

snnTorch repo: https://github.com/jeshraghian/snntorch

Author's repo: https://github.com/jeshraghian

Author web site: www.jasoneshraghian.com

A good recommendation would be to watch these videos first to see how you get on, and to check out the snnTorch repo' examples: https://github.com/jeshraghian/snntorch/tree/master/examples

Finally, for comparisons:

You might find my own core criteria for selecting a package useful:

• Does it allow me to do what I want to achieve?

• Is it easy to install?

• Is it actively supported, in case of problems?

• Is it well documented?

• Does it have clear examples?

• Does it run on commonly found, easy to acquire and comparatively inexpensive hardware - Intel/Nvidia stack?

In addition, I also wanted these capabilities:

• Installs easily and works well in the AWS SageMaker environment.

• Supports GPU and CPU training.

I'd investigate each package on a case by case basis using the above criteria, see if you get on with it, and then compare your short list a pair of packages at a time.

There are over 850 repo's returned in GitHub if you search for spiking neural network, at the time of writing, so it's impossible to do a comprehensive review of all of them.

The majority are abandonware, rarely updated or badly documented, and as such can be discounted - there's a very long tail of these. In addition, many of the older review papers omit packages like snnTorch and Norse, purely because they had not been written at the time the paper was created. Both packages were created in 2021.

I would start with the top 10-20 from these two searches (rating and last updated) and go from there:

https://github.com/search?o=desc&q=spiking+neural+network&s=stars&type=Repositories

https://github.com/search?o=desc&q=spiking+neural+network&s=updated&type=Repositories

Hope this helps.

Jon.

If you found any of the above information useful, an upvote is always gratefully received. :-)