Skip to main content
. 2019 Jan 8;19(1):217. doi: 10.3390/s19010217
Algorithm 1 The forward propagation algorithm of CNN
1 //process of the forward propagation
2 Input: training set D={(xn,yn)}n=1N; the number of CNN layers is L, each layer denoted as hl; anl represents the nth input sample corresponding to the output of layer l; expected output tnv.
3 Process:
4 Initialization: Initialize all layers of convolutional kernel wl and offset term bl.
5 for all (xn,yn)D do
6  for (l=1;lL;l+1) do
7   if (hl is the convolutional layer) then
8     for (all anl) do
9     get anl according to (1)
10    end
11   end
12   if (hl is the pooling layer) then
13    for (all anl) do
14     get anl according to (7)
15    end
16   end
17   if (hl is fully connected layer)
18    for(all anl) do
19     get anl according to (8)
20    end
21   end
22   if (hL is output layer) then
23    get anL or onv according to (9)
24   end
25  end
26 end
27 Output: Calculate the error E of the output layer by the loss function, according to (11).