class_docstr: Object that perform the training and active learning iteration.
  
  Args:
      dataset (ActiveLearningDataset): Dataset with some sample already labelled.
      heuristic (Heuristic): Heuristic from baal.active.heuristics.
      query_size (int): Number of sample to label per step.
      max_sample (int): Limit the number of sample used (-1 is no limit).
      **kwargs: Parameters forwarded to `get_probabilities`
          and to pytorch_ligthning Trainer.__init__
code: def __init__(
      self,
      dataset: ActiveLearningDataset,
      heuristic: heuristics.AbstractHeuristic = heuristics.Random(),
      query_size: int = 1,
      **kwargs,
  ) -> None:
      super().__init__(**kwargs)
      self.query_size = query_size
      self.heuristic = heuristic
      self.dataset = dataset
      self.kwargs = kwargs
  
imports: import sys
  import types
  import warnings
  from collections.abc import Sequence
  from typing import Dict, Any, Optional
  import numpy
  import structlog
  import torch
  from pytorch_lightning import Trainer, Callback, LightningDataModule, LightningModule
  from pytorch_lightning.accelerators import CUDAAccelerator
  from torch.utils.data import DataLoader
  from tqdm import tqdm
  from baal.active import ActiveLearningDataset
  from baal.active.heuristics import heuristics
  from baal.modelwrapper import mc_inference
  from baal.utils.cuda_utils import to_cuda
  from baal.utils.iterutils import map_on_tensor
label_desc: Use image node_id 1 to create a new BaalTrainer object from inherited base classes: Trainer with example: obj = BaalTrainer(dataset, heuristic, query_size)