class_docstr: Perform SamplePairing on the model inputs. This is the process of averaging each image with another random image
  without changing the targets. The key here is to use the policy function to only do this some of the time.
  
  Example: ::
  
      >>> from torchbearer import Trial
      >>> from torchbearer.callbacks import SamplePairing
  
      # Example Trial which does Sample Pairing regularisation with the policy from the paper
      >>> pairing = SamplePairing()
      >>> trial = Trial(None, criterion=Mixup.loss, callbacks=[pairing], metrics=['acc'])
  
  Args:
      policy: A function of state which returns True if the current batch should be paired.
code: def __init__(self, policy=None):
      self.on_sample = only_if(
          SamplePairing.default_policy(100, 800, 8, 2)
          if policy is None
          else policy
      )(self.on_sample)
  
file_path: torchbearer/torchbearer/callbacks/sample_pairing.py
imports: import torch
  import torchbearer
  from torchbearer import cite
  from torchbearer.callbacks import Callback, only_if, once_per_epoch
label_desc: Use image node_id 2 to create a new SamplePairing object from inherited base classes: Callback with example: obj = SamplePairing(policy)