fangwei123456 / spikingjelly

SpikingJelly is an open-source deep learning framework for Spiking Neural Network (SNN) based on PyTorch.
https://spikingjelly.readthedocs.io
Other
1.3k stars 237 forks source link

SLAYER Algorithm #223

Open AiladReb opened 2 years ago

AiladReb commented 2 years ago

I have checked the documentation and I realized that many surrogate functions exist. My question is, is there anyway to have the one used by SLAYER https://arxiv.org/pdf/1810.08646.pdf ?

fangwei123456 commented 2 years ago

image https://spikingjelly.readthedocs.io/zh_CN/latest/spikingjelly.clock_driven.surrogate.html#piecewiseexp-init-en

I suggest to set alpha=2.

AiladReb commented 2 years ago

Thank you for your answer. However, I believe that by doing this it's not going to distribute the credit of error back in time as SLAYER does.

image

fangwei123456 commented 2 years ago

https://github.com/bamsumit/slayerPytorch/blob/e29ca09e543783a0db18f1e9454c769080601859/src/slayer.py#L862

Yanqi-Chen commented 2 years ago

Surrogate gradient just handles the non-differentiable gradient of spike w.r.t. potential. It can be coupled with different learning (credit assignment) rules like STBP or SLAYER.