Skip to main content
. 2022 May 8;22(9):3581. doi: 10.3390/s22093581
Algorithm 1: Model training algorithm.
1: Read Data dt
2: Pre-train the model
3: for model in CNN, RNN, …, Transformer do
4:     for i in 1, 2, 3, 4, 5 do
5:             1. Batch and Shuffle dt by Mini-batch size to Generate D
6:             2. Randomly divide D as the training set Dt, validation set Dv, test set Dtt
7:             Initialize ω and b randomly by the Gaussian distribution
8:             Reading parameter configuration information
9:             for epoch in 1 to 20 do
10:                 3. va=matmulx,ω # calculate the value before activation
11:                 4. ypre=softmaxva # the value after activation
12:                 5. CFθ = Equation (4) # compute loss
13:                 6. grd=sgdwithmomentumCFθ,θ
14:                 7. ηθx = Equation (5) # fit the regression curve
15:                 8. θj+1 = Equation (7) # update model parameters
16:           End
17:     End
18: End
19: Fine-Tune.