miladmozafari / SpykeTorch

High-speed simulator of convolutional spiking neural networks with at most one spike per neuron.
GNU General Public License v3.0
381 stars 100 forks source link

score can't stabilize #5

Closed lingji981 closed 3 years ago

lingji981 commented 4 years ago

Hi miladmozafari, I am trying to implement your SpykeTorch code.I have some issues. use face and motorbicyle images, during the training, the score will increase first and then decrease with the increase of the number of iterations, can't stabilize, do you know what the problem is?

miladmozafari commented 4 years ago

Hello, Are you using the script that I provided for my paper (MozafariShallow.py)? As far as I know, this script should work fine. However, if you are implementing yours, this problem can be due to overfitting. Mechanisms like dropout and adaptive learning rates should stabilize the score.

Gambit-Jake commented 3 years ago

Hi, Mozafari!I am trying to reproduce the task 2 you mentioned in the paper “ Bio-inspired digit recognition using reward-modulated spike-timing-dependent plasticity in deep convolutional networks”. I find that you set the convolutional kernel size of S2 to be 1515 and max-pooling kernel size of c2 to be 1414. I wonder why these sizes is set so large. In addition, the output feature map size of S2 is 2 2.  With this input size, the pooling operation of C2 cannot be done appropriately. To run the code successfully, I resize the c2 size to be 22 to perform global pooling. But the experimental results is quite poor. Would you please present more details about Task2?

miladmozafari commented 3 years ago

Hello, First of all, I have to say that the main implementation of the paper was done in C++/CUDA (from scratch) and it might not be possible to simulate the exact network in SpykeTorch. The idea in this task was to have S2 neurons that are able to see the whole stimuli. Thus, since the output of C1 is 14x14, I used a convolution kernel of size 15x15 (in C++ implementation, I had to use odd kernel sizes) in layer S2. The result of S2 was a map of size 14x14. Then, I applied C2 with 14x14 pooling window to converge to a single neuron per feature map.

In SpykeTorch you can use a configuration like this (I do not write the channel dimension): S1 (5x5) with padding of 2 -----------------------------------------------> output will be 28x28 C1 (2x2) with stride of 2 --------------------------------------------------> output will be 14x14 S2 (14x14) with padding of 7 for one side and 8 for the other size ----> output will be 14x14 C2 (14x14) ----------------------------------------------------------------> output will be 1x1 S3 (1x1)

I hope it solves your problem.