class_docstr: Given a batch of input images and labels, this class randomly applies the
  `MixUp transformation <https://arxiv.org/abs/1710.09412>`_
  
  Args:
      opts (argparse.Namespace): Arguments
      num_classes (int): Number of classes in the dataset
code: def __init__(
      self, opts: argparse.Namespace, num_classes: int, *args, **kwargs
  ) -> None:
      super().__init__(opts=opts, *args, **kwargs)
      alpha = getattr(opts, "image_augmentation.mixup.alpha")
      assert (
          num_classes > 0
      ), "Please provide a valid positive value for the num_classes."
      assert alpha > 0, "Alpha param can't be zero."
  
      self.num_classes = num_classes
      self.p = getattr(opts, "image_augmentation.mixup.p")
      assert (
          0.0 < self.p <= 1.0
      ), "MixUp probability should be between 0 and 1, where 1 is inclusive"
      self.alpha = alpha
      self.inplace = getattr(opts, "image_augmentation.mixup.inplace")
      self.sample_key = getattr(
          opts, "image_augmentation.mixup.sample_key"
      )
      self.target_key = getattr(
          opts, "image_augmentation.mixup.target_key"
      )
  
imports: import argparse
  import math
  import random
  from typing import Dict, Tuple
  import torch
  from torch import Tensor
  from torch.nn import functional
  from torchvision.transforms import functional
  from data.transforms import TRANSFORMATIONS_REGISTRY, BaseTransformation
  from utils import logger
label_desc: Use image node_id 1 to create a new RandomMixup object from inherited base classes: BaseTransformation with example: obj = RandomMixup(opts, num_classes)