Skip to main content
. 2023 Nov 4;8(7):525. doi: 10.3390/biomimetics8070525
Algorithm 2: Fitness Evaluation of ETLBOCBL-CNN
Inputs: Xn.PostrainvalidSbatchεtrainRLCnum
01: Construct a candidate CNN architecture based on the network and learning hyperparameters decoded from Xn.Pos and insert a fully connected layer with Cnum output neurons;
02: Compute τtrain and τvalid using Equations (4) and (6), respectively;
03: Generate the initial weights of the CNN model as  ϖ={ϖ1,ϖ2,} using the selected weight initializer;
04: for ε=1 to εtrain do
05:         for i=1 to τtrain do
06:                    Calculate f(ϖ,itrain  ) of CNN model;
07:                    Update the weights  ϖnew={ϖ1new,ϖ2new,} based on Equation (5);
08:          end for
09: end for
10: for j=1 to τvalid do
11:         Classify the jvalid dataset using the trained CNN model;
12:         Record the classification errors for solving the jvalid dataset as Err_Batchj;
13: end for
14: Calculate Xn,Err of the candidate CNN architecture built from Xn.Pos with Equation (7);
Output:  Xn.Err