Skip to main content
. 2023 Nov 4;8(7):525. doi: 10.3390/biomimetics8070525
Algorithm 4: Competency-Based Learning in ETLBOCBL-CNN’s Modified Teacher Phase
Inputs:  P=[X1,,Xn,.,XN]NDXTeachertrainvalidSbatchεtrainRLCnumSGroupG
01: Initialize offspring population set as Poff;
02: Calculate the population mean X¯.Mean using Algorithm 3;
03: Sort all solution members of P ascendingly by referring to their fitness values Xn.Err;
04: Determine the group index g assigned to Xn.Grp of all sorted learners using Equations (9) and (10);
05: for n=1 to N do
06:        Initialize the n-th offspring learner as Xnoff;
07:        if Xn.Grp3 then
08:          Randomly select two better group indices of gr1, gr2{1,g1}, where gr1<gr2<g; 
09:          Randomly select two predominant learners with the population indices represented as
         nr1gr1{(gr11)SGroup,gr1SGroup} and nr2gr2{(gr21)SGroup,gr2SGroup};  
10:          Calculate Xnoff.Pos using Equation (11);
11:        else if Xn.Grp=2 then
12:          Randomly select two predominant learners from the first group (i.e., g=1) with the population
         indices of nr11, nr21{1,SGroup} and nr11nr21, where Xnr11.Grp=Xnr21.Grp=1;
13:          Compare the fitness values of two predominant learners, i.e., Xnr11.Err and Xnr21.Err;
14:          Calculate Xnoff.Pos using Equation (12);
15:        else if Xn.Grp=1 then
16:          Calculate Xnoff.Pos using Equation (13);
17:        end if
18:        for d=1 to D do
19:             if d2NmaxConv+3l1 with  l=1,,NmaxConv then
20:              Xnoff.PosdRound(Xnoff.Posd );
21:            end if
22:        end for
23:       Perform fitness evaluation on Xnoff.Pos to obtain Xnoff.Err using Algorithm 2;
24:       if Xnoff.Er<XTeacher.Err then
25:       XTeacher.PosXnoff.Pos , XTeacher.ErrXnoff.Err 
26:        end if
27:        PoffPoffXnoff;
28: end for
Outputs:  Poff=[X1off,,Xnoff,.,XNoff] P=[X1,,Xn,.,XN]XTeacher