Skip to main content
. 2019 Jan 8;19(1):217. doi: 10.3390/s19010217
Algorithm 2 The reverse propagation algorithm of CNN
1  //process of the reverse propagation
2 Input: The error E of the output layer calculated by the loss function, the learning rate γ,γ(0,1).
3  Process:
4  for (l=L;l1;l=l1) do
5    if (δnl+1 is fully connected layer) then
6    get δnl according to δnl=(wl+1)Tδnl+1f(wlanl1+bl)
7    end
8    if (δnl+1 is the convolutional layer) then
9    get δnl according to δnl=δnl+1[f(zl)×wl+1+bl+1]zl×rot180(wl+1)f(wl×anl+bl)
10   end
11   if (δnl+1 is the pooling layer) then
12    get δnl according to δnl=upsample(δnl+1)f(pool(anl))
13   end
14  end
15  for (l=2;lL;l=l+1) do
16   if(hl is fully connected layer) then
17    wl=wlγn=1Nδnl(anl1)T
18    bl=blγn=1Nδnl
19   end
20   if(hl is the convolutional layer) then
21    wl=wlγn=1Nδnl×rot180(anl1)
22    bl=blγn=1Nu,v(δnl)u,v
23   end
24  end
25 Output: Updated values for w and b.