code: def __init__(
      self,
      active_dataset: ActiveLearningDataset,
      network: nn.Module,
      **kwargs,
  ):
      super().__init__(active_dataset, **kwargs)
  
      self.network = network
  
      # Maximum unsupervised loss weight as defined in the paper.
      M = len(self.active_dataset)
      N = len(self.active_dataset) + len(self.active_dataset.pool)
      self.max_unsupervised_weight = self.hparams.w_max * M / N
  
      self.criterion = nn.CrossEntropyLoss()
      self.consistency_criterion = nn.MSELoss()
  
      if self.hparams.baseline:
          assert (
              self.hparams.p == 1
          ), "Only labeled data is used for baseline (p=1)"
  
      # Consistency augmentations
      self.gaussian_noise = GaussianNoise()
      self.random_crop = RandomTranslation()
  
      # Keep track of current lr for logging
      self.current_lr = self.hparams.lr
  
imports: import argparse
  from typing import Dict
  import numpy
  import torch
  from torch.hub import load_state_dict_from_url
  from torch import nn, Tensor
  from torch.utils.data import DataLoader
  from torchvision import transforms
  from torchvision.datasets import CIFAR10
  from torchvision.models import vgg11
  from baal import ActiveLearningDataset
  from baal import SSLModule
  import torch.multiprocessing
label_desc: Use image node_id 1 to create a new PIModel object from inherited base classes: SSLModule with example: obj = PIModel(active_dataset, network)