New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with inputing custom weights for Rate based SNN #66
Comments
Hi Kannan, Really appreciate the kind words :)
If none of the above work, then you may need to scale or normalize your weights (or inputs). I also guess that you have no inhibitory connections (i.e., all of your weights are positive). This might be okay for simple tasks, but you might consider having a hidden layer size of 42*2 =84. Where 42 of your weights are initialized positive, and the other 42 are negative. It sounds like you're working on a really cool project too - most of my work is with RRAM devices which seems kind of relevant here, so feel free to update me on how you go! |
Hi Jason, |
I've been playing with your code a bit more. Your train/test loss are both decreasing, but as you've observed, the accuracy has struggled to decrease. This is a plot of 9 of 10 of the output neurons, and their membrane explodes; the values below exceed 100 (threshold=1 means spiking). So I would guess you're facing an exploding gradient problem. This might make sense as the device weights are positively distributed (activations are becoming too positive). I managed to (unexplainably) fix the issue by using the raw MNIST input (instead of spikes), and that was able to successfully train. After pre-training it on the raw input, I was then able to train it on the spiking version as well (50%+ before exiting the process). Alternative approaches that I would test out would be anything that can prevent the membrane potential from exploding:
Happy to chat further on RRAM, feel free to reach out! Contact details are on my website. |
Closing due to inactivity & I believe the issue was solved. |
Description
Hi Jason,
First of all, I appreciate your wonderful effort in developing this package and a detailed documentation. I have recently started using snntorch for rate based SNN coding. Although I am getting good performance for purely software based run, I am facing issues with inputing custom weights extracted from a synaptic device. My accuracy is getting stuck at around 10% which is the same as the untrained accuracy.
What I Did
I used a custom function to input the weights from a text file as shown in the screenshot. Please let me know how to solve this issue.
NB: I am pretty new to programming. so pls excuse me if my code is too cumbersome :)
`
Here is the full file and the text file for data input
rate_SNN_dev_weights.zip
Thanks,
Kannan
The text was updated successfully, but these errors were encountered: