class_docstr: Implement the Mixup data augmentation defence approach.
  
  | Paper link: https://arxiv.org/abs/1710.09412
  
  | Please keep in mind the limitations of defences. For more information on the limitations of this defence,
      see https://arxiv.org/abs/1803.09868 . For details on how to evaluate classifier security in general, see
      https://arxiv.org/abs/1902.06705
class_docstr_tok: ["Implement","the","Mixup","data","augmentation","defence","approach",".","|","Paper","link",":","https",":","\/\/arxiv.org\/abs\/1710.09412","|","Please","keep","in","mind","the","limitations","of","defences",".","For","more","information","on","the","limitations","of","this","defence",",","see","https",":","\/\/arxiv.org\/abs\/1803.09868",".","For","details","on","how","to","evaluate","classifier","security","in","general",",","see","https",":","\/\/arxiv.org\/abs\/1902.06705"]
docstr: Create an instance of a Mixup data augmentation object.
  
  :param num_classes: The number of classes used for one-hot encoding.
  :param alpha: The hyperparameter for the mixing interpolation strength.
  :param num_mix: The number of samples to mix for k-way Mixup.
  :param apply_fit: True if applied during fitting/training.
  :param apply_predict: True if applied during predicting.
docstr_tok: ["Create","an","instance","of","a","Mixup","data","augmentation","object",".",":","param","num_classes",":","The","number","of","classes","used","for","one-hot","encoding",".",":","param","alpha",":","The","hyperparameter","for","the","mixing","interpolation","strength",".",":","param","num_mix",":","The","number","of","samples","to","mix","for","k-way","Mixup",".",":","param","apply_fit",":","True","if","applied","during","fitting\/training",".",":","param","apply_predict",":","True","if","applied","during","predicting","."]
code: def __init__(
      self,
      num_classes: int,
      alpha: float = 1.0,
      num_mix: int = 2,
      apply_fit: bool = True,
      apply_predict: bool = False,
  ) -> None:
      """
      Create an instance of a Mixup data augmentation object.
  
      :param num_classes: The number of classes used for one-hot encoding.
      :param alpha: The hyperparameter for the mixing interpolation strength.
      :param num_mix: The number of samples to mix for k-way Mixup.
      :param apply_fit: True if applied during fitting/training.
      :param apply_predict: True if applied during predicting.
      """
      super().__init__(
          is_fitted=True,
          apply_fit=apply_fit,
          apply_predict=apply_predict,
      )
      self.num_classes = num_classes
      self.alpha = alpha
      self.num_mix = num_mix
      self._check_params()
  
file_path: adversarial-robustness-toolbox/art/defences/preprocessor/mixup/mixup.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import Optional, Tuple
  import numpy
  from art.defences.preprocessor.preprocessor import Preprocessor
  from art.utils import to_categorical
label_desc: Use image node_id 1 to create a new Mixup object from inherited base classes: Preprocessor with example: obj = Mixup(num_classes, alpha, num_mix, apply_fit, apply_predict)