fangwei123456
fangwei123456
https://spikingjelly.readthedocs.io/zh_CN/latest/clock_driven_en/5_ann2snn.html
You can also refer to these codes: https://github.com/fangwei123456/spikingjelly/blob/master/spikingjelly/clock_driven/ann2snn/examples/resnet18_cifar10.py
Merge #156.
建议检查一下各层的输入输出
使用监视器 https://spikingjelly.readthedocs.io/zh_CN/latest/activation_based/monitor.html
需要先测试一下是不是真的节省了显存。。
@ZulunZhu 他们的实现方式和我们的类似,实测速度更快吗 https://github.com/Delver-of-Squeakrets/LISNN/blob/a099a9c0d7f20073cde4b368cd3de4a4d2df30ad/LISNN.py#L7
``` from spikingjelly.clock_driven import surrogate, neuron import torch from spikingjelly.cext import cal_fun_t device = 'cuda:0' T = 64 N = 128 x = torch.rand([T, N], requires_grad=True, device=device) thresh, lens, decay...
FuseLIF和LISNN的充电重置方程包含3个操作,SJ中的LIF充电+重置包含7个操作
python代码的每一个操作都会重新调用一次CUDA内核,所以操作越多速度越慢。因而后来用CUDA重写了一些神经元,所有操作都放到了一个CUDA内核。但实测单步和python的提升不大,多步的提升巨大,因而下一次更新的时候就只保留多步cuda神经元,单步的cuda神经元删除,用python足够了。