Skip to main content
. 2020 Feb 28;14:119. doi: 10.3389/fnins.2020.00119

Algorithm 1.

Forward propagation with dropout at each iteration in SNN

1:  Input : Poisson-distributed input spike train (inputs), Dropout ratio (p), Total number of time steps (#timesteps), Membrane potential (Vmem), Time constant of membrane potential (τm), Firing      threshold (Vth)
2:  Initialize SNNl.Vmem0 Al=2,,#SNN.layer
3:  // Define the random subset of units (with a probability 1 − p) at each iteration
4:  for l ← 1 to #SNN.layer − 1 do
5:        masklgenerate_random_subset(probability = 1 − p)
6:  for t ← 1 to #timesteps do
7:       // Set input of first layer equal to spike train of a mini-batch data
8:       SNN1.spike[t] ← inputs[t];
9:       for l ← 2 to #SNN.layer do
10:           // Integrate weighted sum of input spikes to membrane potential
11:           SNNl.Vmem[t]SNNl.Vmem[t-1]+SNNl-1forward(SNNl-1.spike[t]).*(maskl-1/(1-p));
12:           // If Vmem is greater than Vth, post-neuron generate a spike
13:           if SNNl.Vmem[t]>SNNl.Vth then
14:                // Membrane potential resets if the corresponding neuron fires a spike
15:                SNNl.spike[t] ← 1
16:                SNNl.Vmem[t]0
17:           else
18:                // Else, membrane potential decays over time
19:                SNNl.spike[t] ← 0
20:                SNNl.Vmem[t]e-1τm*SNNl.Vmem[t]