chan8972 / enabling_spikebased_backpropagation Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Hi,
I'm trying to implement LeNet using the N-MNIST dataset but the accuracy does not increase as the training step growing. I load the N-MINST dataset by PySNN ( https://github.com/BasBuller/PySNN).
Can you please tell me how to train the model on N-MNIST?
Your help will be appreciated.
Thanks
hi,
could you plz tell me how to record spike activities?
Hi,
I wanna calculate the total energy consumption of the ANN and SNN model.
I've read your article that you calculated the total energy consumption for both ANN and SNN models, which I got it.
For the SNN model, total energy consumption is calculated as (# of neurons in a particular layer * # of synaptic connections* average spiking activity).
I didn't exactly understand, how did you calculate the total energy for VGG and ResNet for SNN and ANN models which you've reported in your article? I mean the ratios?
For instance, I've made 4 layer SNN and ANN model for the MNIST dataset then how could I calculate the total energy?
I mean, how I know the total number of spikes in one inference image?
Do you have any code for that, so that I can calculate or Can you please give me an example??
Your help will be highly appreciated.
Thanks
Hi,
When I am trying to train from scratch, I get such an error :
"Traceback (most recent call last):
File "cifar10_ResNet11.py", line 704, in
main()
File "cifar10_ResNet11.py", line 143, in main
train(train_loader, model, criterion, criterion_en, optimizer, epoch, time_steps=100, leak=0.99)
File "cifar10_ResNet11.py", line 206, in train
output, Total_11_output, LF_11_output, Total_21_output, LF_21_output, Total_22_output, LF_22_output, Total_31_output, LF_31_output, Total_32_output, LF_32_output, Total_41_output, LF_41_output, Total_42_output, LF_42_output, Total_51_output, LF_51_output, Total_52_output, LF_52_output, Total_f0_output, LF_f0_output, out11_temp, out21_temp, out22_temp, out31_temp, out32_temp, out41_temp, out42_temp, out51_temp, out52_temp, outf0_temp = model(input_var, steps=time_steps, l=leak)
File "/home/ubuntu/anaconda3/envs/pytorch_p27/lib/python2.7/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "cifar10_ResNet11.py", line 570, in forward
mem_11, out = LIF_sNeuron(mem_11, self.cnn11.threshold, l, i)
File "cifar10_ResNet11.py", line 411, in LIF_sNeuron
out = SpikingNN()(ex_membrane)
TypeError: forward() takes exactly 2 arguments (1 given)".
Can you please check from your side?
Hi,
I am referring to your code. I have some confusion related to forward function.
I'm trying to implement VGG11 using the CIFAR10 dataset but got some dimension errors.
Can you please explain how did you make the dimensions inside forward function like this?
torch.zeros(batch_size, 64, 32, 32, device=device))
When I tried this using VGG11 , got this error?
It means my dimensions are not correct.
Below is the snippet of my forward function:
I notice the implementation of Poisson-distributed spike as below
rand_num = Variable(torch.rand(input.size(0), input.size(1), input.size(2), input.size(3)).cuda())
Poisson_d_input = (torch.abs(input) > rand_num).type(torch.cuda.FloatTensor)
Poisson_d_input = torch.mul(Poisson_d_input, torch.sign(input))
which means that the encoded spikes are triple-valued {0, ±1}. It's a little different from the well-known encoding style with binary value {0, 1}.
I wonder why you choose this way of Poisson encoding.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.