NeuromorphicProcessorProject / snntoolbox_applications

Collection of Spiking Neural Network applications for SNN Toolbox.
MIT License
30 stars 14 forks source link

Asynchronous behaviour of SNN model #5

Open abdul-muneeb7 opened 5 months ago

abdul-muneeb7 commented 5 months ago

Hi, I have a quick question regarding the Asynchronous implementation of Spiking Neural Networks in Python. As Python is a sequential language then how SNN-toolbox can deal with the asynchronous behavior of SNNs, as each layer should have to work independently from the rest of the layers, and how does SNN-toolbox incorporate that async. functionality in Python.

rbodo commented 5 months ago

SNN toolbox provides an interface to multiple backends, some of which are actual neuromorphic hardware (Loihi, Spinnaker). When using these, Python is only involved in preparing / deploying the model, and the actual processing is (more or less) asynchronous, depending on the hardware. Aside from these, the toolbox also provides a GPU / CPU backend, which does not emulate or implement asynchronous spike behavior. Instead it simulates sparse spike processing by running a full forward pass at each time step. in this forward pass, the membrane potentials are updated, and where applicable, spikes are generated and passed on to the next layer, where they get added to the membrane potential and may cause a spike, and so on. Then the next time step is done with a full forward pass. Not very efficient, but one can count the number of nonzero activations (spikes) and thus estimate the computational effort (synaptic operations) that would be necessary on dedicated asynchronous hardware.