Skip to main content
. 2019 Jan 8;19(1):217. doi: 10.3390/s19010217
Algorithm 3 The gas recognition algorithm based on CNN
1   Input: E represents the error; e represents the set error value; k represents the number of iterations and K represents the maximum batch; Dtotal represents all data sets.
2   Process:
   //training the LeNet-5
3   for Dtotal do
4    One-Hot encoding and data set partition
5    training dataset and testing dataset are obtained
6   Begin of training time
7   for all training dataset do
8    for (k=0;k=k+1;k<K) do
9     Algorithm 1
10    if E>e then do
11     Algorithm 2 and return to step 8
12    else
13     break;
14    end
15   end
16  end
17  End of training time
18  store all w and all b
   // test the LeNet-5
19  Load all w and all b to the LeNet-5 then do
20  Begin of test time
21  for all testing dataset do
22   Algorithm 1 which is forward propagation
23  end
24  End of test time
25  Calculate the accuracy
26  Output: training time, test time and accuracy.