Skip to main content
. 2023 Sep 18;28(18):6680. doi: 10.3390/molecules28186680
Algorithm 1 Uncertainty-aware augmented sample selection (ACPs-ASSF)
Require: Original training dataset Do; augmented sample dataset Da; prediction model fθ with trainable parameters θ; uncertainty threshold λ and confidence threshold γ; number of stochastic forward pass times T; number of iterations for selecting samples I; number of epochs E for training model.
1: D=Do; ▷ obtain training set
2:  for iteration=1 to I do
3:        Initialize θ;
4:        if iteration>1
5:            D=Do∪Ds; ▷ merge the selected samples to the training set
6:        for epoch=1 to E do
7:              Train fθ using D; ▷ using CE loss and SGD
8:        end for
9:        for  t=1  to  T  do
10:               Dropout(θ);
11:               Input samples from Da into fθ; ▷ accumulate the output of each pass
12:         end for
13:         Compute the uncertainty and pseudo-labels by Equations (9) and (10);
14:         Use Equation (11) to obtain Ds; ▷ select augmented samples
15:  end for
16:  return θ