code: def perform_active_learning(
      active_learner, train, indices_labeled, test, num_iterations
  ):
      # Perform 20 iterations of active learning...
      for i in range(num_iterations):
          # ...where each iteration consists of labelling 20 samples
          indices_queried = active_learner.query(
              num_samples=20, representation=train
          )
  
          # Simulate user interaction here. Replace this for real-world usage.
          y = train.y[indices_queried]
  
          # Return the labels for the current query to the active learner.
          active_learner.update(y)
  
          indices_labeled = np.concatenate(
              [indices_queried, indices_labeled]
          )
  
          print(
              "Iteration #{:d} ({} samples)".format(
                  i, len(indices_labeled)
              )
          )
          evaluate(active_learner, train[indices_labeled], test)
  
file_path: small-text/examples/examplecode/pytorch_multiclass_classification.py
imports: import torch
  import numpy
  from small_text import ActiveLearnerException, EmptyPoolException, ExpectedGradientLength, KimCNNFactory, PoolBasedActiveLearner, PoolExhaustedException, random_initialization_stratified
  from examplecode.data.example_data_multiclass import get_train_test, preprocess_data
  from examplecode.shared import evaluate
label_desc: Use image node_id 2 for calling a global function with example usage: perform_active_learning(active_learner, train, indices_labeled, test, num_iterations) without return types