Spiking Neural Network

I am trying to implement the spiking neural network model in this paper https://www.frontiersin.org/articles/10.3389/fninf.2018.00079/full and I wanted to use DifferentialEquations.jl Basically, the model consists of a network of so-called integrate-and-fire units, i.e. units where the membrane potential is governed by this simple equation


where w are the connection weights from all units to unit i and a(t) is the spiking activity of the other units.
A unit emits a spike when the membrane potential V exceeds a specified threshold, after which it is reset to its resting value.
My initial thought was to make use of callbacks to manage the spiking activity, as it involves directly manipulating the value of what is being integrated. However, it wasn’t clear to me how to manage multiple callbacks (it seems I would need one callback per unit, so potentially hundreds of them). I am aware of https://github.com/JuliaDiffEq/DiffEqBase.jl/pull/221, which seems to address my need. I guess my question is, should I wait for this PR to be merged, or is there a better way of handling a spiking neural network model? Thanks!

Sorry, not much of help here, but I think there is a way for you to use a specific PR of a package with Pkg, so at least you won’t need to wait until that PR is merged.

1 Like

It depends how you define a callback for spikes. If it is just thresholding,then make a DiscreteCallback with always codition true and use affect! to find if there are states above the threshold. Depending how fast the spikes occur, you may miss if the time steps high though.

In case you don’t want to use DifferentialEquations.jl, there is this somewhat outdated talk on simulating spiking neural networks with julia (I don’t think that there is a public repository available) and we have a preliminary version of a spiking neural network integrator here (docs and further improvements to come).

1 Like

Thanks! Those are all really useful resources. I’ll definitely take a look and let you guys know how it goes.

@jbrea your paper sounds really interesting, I will definitely give it a read : )