Skip to main content
. 2026 Mar 23;26(6):2005. doi: 10.3390/s26062005
Algorithm 1 Flow of the proposed AL-PP algorithm
  • Input: 

    Training dataset X={x1,x2,…,xn}, where n denotes the number of training samples; fixed pre-trained baseline network fb(·;MB); pruning network fg(·;MG,m); discriminator D(·;MD); sparsity factor λ; polarization parameter μ; maximum number of training epochs N.

  • 1:

    Phase 1: Sparsity training with performance recovery

  • 2:

    Load the parameters of the pre-trained baseline network MB.

  • 3:

    Initialize the pruning network parameters MG and the soft masks m, as well as the discriminator parameters MD.

  • 4:

    for epoch=1 to N do

  • 5:   

    Fix baseline network fb(·;MB) and update discriminator D(·;MD)

  • 6:   

    Feed the training samples x∈X into the baseline network and the pruning network to obtain the outputs yb=fb(x;MB) and yg=fg(x;MG,m).

  • 7:   
    Update the discriminator parameters MD by maximizing the following objective using stochastic gradient descent (SGD):
    maxMDLD(MD)+RD(MD)
  • 8:   

    Fix discriminator D(·;MD) and update pruning network fg(·;MG,m)

  • 9:   
    Update the pruning network parameters MG and the soft masks m by minimizing the following objective using SGD:
    minMG,mLG(MG,m)+LM(MG,m)+Rm(m)+RG(MG)
  • 10:

    end for

  • 11:

    Phase 2: Structured channel pruning

  • 12:

    Evaluate the importance of each channel according to the learned soft mask values.

  • 13:

    Retain channels with large mask values and prune channels with small mask values to obtain the compact pruned model.

  • Output: 

    The compact model after structured pruning.