Research Article

Hybrid Fine-Tuning Strategy for Few-Shot Classification

Algorithm 1

Pseudocode for the AFT module.
Input: the validation dataset: , the pretrained model
Output: hybrid fine-tuning strategy represented by adaptive epoch:
Hyper-parameters: the total number of pseudofine-tuning tasks , the maximum number of epochs , the number of epochs contained in a chunk , the number of nodes contained in a chunk , and the starting chunk number .
for: do
   = RandomTaskSample ; #get train and test sets for task
   = FSLDA ; #initialize the model by FSLDA
   = Evaluate ;
   = /; #number of chunks
   = Backpropagation ; #train the model by epochs
  for each chunk : do
   for each node : do
     = Backpropagation ;
     = Evaluate ;
   end for
    = ; #the average accuracy of chunk
   if% or  =  then
    ; #adaptive epochs
    if then; #optimal hybrid epoch
    break;
   end if
  end for
end for
 Set  = , . #number of tasks needing finetuning
if then ; #get the quantile of
else .