ericjang / pyN

Neuron(s)-based library in Python using numpy and Blender Game Engine.
BSD 2-Clause "Simplified" License
6 stars 4 forks source link

Faster implementations of models via @numba.jit. #1

Open russelljjarvis opened 3 years ago

russelljjarvis commented 3 years ago

Hi Ericjang.

I made a really fast implementation of your AdExp model. It uses numba.jit (just in time compilation) to evaluate in ~ 0.0005 seconds. Numba.jit also has a @vectorize decorator that you could use to make network scale model evaluations fast.

I used the same technique to speed up a forward euler implementation of the Izhikevich model.

I can see you have not done any development on this repository for many years, but yet on the other hand people are still forking the repository, as I think there is an appetite for python native spiking neural network simulation. Do you want me to pull request the new models in?

ericjang commented 3 years ago

Hey Russell, thanks a lot! Sure, maybe you could send a pull request that has an argument in the constructor to specify the backend for the AdExp model?

russelljjarvis commented 3 years ago

Yes great. I will do this. Could take me a week, but I think it would be interesting :)

russelljjarvis commented 3 years ago

Actually, I don't know if I will get around to doing the merge, but if you are curious about an accelerated version of the vectorized neurons look here. Its my understanding that this can be mapped onto cuda GPU cores with a decorator like: @guvectorize([(float32[:,:], float32[:,:])], '(m,l),(l,n)->(m,n)'), target='cuda')