class_docstr: Cutmix callback which replaces a random patch of image data with the corresponding patch from another image.
  This callback also converts labels to one hot before combining them according to the lambda parameters, sampled from
  a beta distribution as is done in the paper.
  
  Example: ::
  
      >>> from torchbearer import Trial
      >>> from torchbearer.callbacks import CutMix
  
      # Example Trial which does CutMix regularisation
      >>> cutmix = CutMix(1, classes=10)
      >>> trial = Trial(None, callbacks=[cutmix], metrics=['acc'])
  
  Args:
      alpha (float): The alpha value for the beta distribution.
      classes (int): The number of classes for conversion to one hot.
  
  State Requirements:
      - :attr:`torchbearer.state.X`: State should have the current data stored
      - :attr:`torchbearer.state.Y_TRUE`: State should have the current data stored
code: def on_sample(self, state):
      super(CutMix, self).on_sample(state)
  
      lam = self.dist.sample().to(state[torchbearer.DEVICE])
      length = (1 - lam).sqrt()
      cutter = BatchCutout(
          1,
          (length * state[torchbearer.X].size(-1)).round().item(),
          (length * state[torchbearer.X].size(-2)).round().item(),
      )
      mask = cutter(state[torchbearer.X])
      erase_locations = mask == 0
  
      permutation = torch.randperm(state[torchbearer.X].size(0))
      if self.mixup_loss:
          state[torchbearer.MIXUP_PERMUTATION] = permutation
          state[torchbearer.MIXUP_LAMBDA] = lam
  
      state[torchbearer.X][erase_locations] = state[torchbearer.X][
          permutation
      ][erase_locations]
  
      if self.mixup_loss:
          state[torchbearer.TARGET] = (
              state[torchbearer.TARGET],
              state[torchbearer.TARGET][
                  state[torchbearer.MIXUP_PERMUTATION]
              ],
          )
      else:
          target = self._to_one_hot(state[torchbearer.TARGET]).float()
          state[torchbearer.TARGET] = (
              lam * target + (1 - lam) * target[permutation]
          )
  
imports: import torchbearer
  from torchbearer import Callback
  import torch
  from torch.distributions import Beta
  from torchbearer.bases import cite
label_desc: Use image node_id 3 for calling the CutMix obj's underlying member method code with example usage: obj.on_sample(state) without return types