class_docstr: This is abstract class for different backend-specific implementations of AWP protocol
  for adversarial training.
  
  | Paper link: https://proceedings.neurips.cc/paper/2020/file/1ef91c212e30e14bf125e9374262401f-Paper.pdf
class_docstr_tok: ["This","is","abstract","class","for","different","backend-specific","implementations","of","AWP","protocol","for","adversarial","training",".","|","Paper","link",":","https",":","\/\/proceedings.neurips.cc\/paper\/2020\/file\/1ef91c212e30e14bf125e9374262401f-Paper.pdf"]
docstr: Create an :class:`.AdversarialTrainerAWP` instance.
  
  :param classifier: Model to train adversarially.
  :param proxy_classifier: Model for adversarial weight perturbation.
  :param attack: attack to use for data augmentation in adversarial training
  :param mode: mode determining the optimization objective of base adversarial training and weight perturbation
         step
  :param gamma: The scaling factor controlling norm of weight perturbation relative to  model parameters norm
  :param beta: The scaling factor controlling tradeoff between clean loss and adversarial loss for TRADES protocol
  :param warmup: The number of epochs after which weight perturbation is applied
docstr_tok: ["Create","an",":","class",":","`",".AdversarialTrainerAWP","`","instance",".",":","param","classifier",":","Model","to","train","adversarially",".",":","param","proxy_classifier",":","Model","for","adversarial","weight","perturbation",".",":","param","attack",":","attack","to","use","for","data","augmentation","in","adversarial","training",":","param","mode",":","mode","determining","the","optimization","objective","of","base","adversarial","training","and","weight","perturbation","step",":","param","gamma",":","The","scaling","factor","controlling","norm","of","weight","perturbation","relative","to","model","parameters","norm",":","param","beta",":","The","scaling","factor","controlling","tradeoff","between","clean","loss","and","adversarial","loss","for","TRADES","protocol",":","param","warmup",":","The","number","of","epochs","after","which","weight","perturbation","is","applied"]
code: def __init__(
      self,
      classifier: "CLASSIFIER_LOSS_GRADIENTS_TYPE",
      proxy_classifier: "CLASSIFIER_LOSS_GRADIENTS_TYPE",
      attack: EvasionAttack,
      mode: str = "PGD",
      gamma: float = 0.01,
      beta: float = 6.0,
      warmup: int = 0,
  ):
      """
      Create an :class:`.AdversarialTrainerAWP` instance.
  
      :param classifier: Model to train adversarially.
      :param proxy_classifier: Model for adversarial weight perturbation.
      :param attack: attack to use for data augmentation in adversarial training
      :param mode: mode determining the optimization objective of base adversarial training and weight perturbation
             step
      :param gamma: The scaling factor controlling norm of weight perturbation relative to  model parameters norm
      :param beta: The scaling factor controlling tradeoff between clean loss and adversarial loss for TRADES protocol
      :param warmup: The number of epochs after which weight perturbation is applied
      """
      self._attack = attack
      self._proxy_classifier = proxy_classifier
      self._mode = mode
      self._gamma = gamma
      self._beta = beta
      self._warmup = warmup
      self._apply_wp = False
      super().__init__(classifier)
  
file_path: adversarial-robustness-toolbox/art/defences/trainer/adversarial_trainer_awp.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import abc
  from typing import Optional, Tuple, TYPE_CHECKING
  import numpy
  from art.defences.trainer.trainer import Trainer
  from art.attacks.attack import EvasionAttack
  from art.data_generators import DataGenerator
label_desc: Use image node_id 1 to create a new AdversarialTrainerAWP object from inherited base classes: Trainer with example: obj = AdversarialTrainerAWP(classifier, proxy_classifier, attack, mode, gamma, beta, warmup)