class_docstr: Class performing adversarial training following Oracle Aligned Adversarial Training (OAAT) protocol.
  
  | Paper link: https://link.springer.com/chapter/10.1007/978-3-031-20065-6_18
class_docstr_tok: ["Class","performing","adversarial","training","following","Oracle","Aligned","Adversarial","Training","(","OAAT",")","protocol",".","|","Paper","link",":","https",":","\/\/link.springer.com\/chapter\/10.1007\/978-3-031-20065-6_18"]
docstr: Modify the model's weight parameters according to the weight perturbations.
  
  :param p_classifier: model for awp protocol.
  :param list_keys: list of model parameters' names
  :param w_perturb: dictionary containing model parameters' names as keys and model parameters as values
  :param op: controls whether weight perturbation will be added or subtracted from model parameters
docstr_tok: ["Modify","the","model","'s","weight","parameters","according","to","the","weight","perturbations",".",":","param","p_classifier",":","model","for","awp","protocol",".",":","param","list_keys",":","list","of","model","parameters","'","names",":","param","w_perturb",":","dictionary","containing","model","parameters","'","names","as","keys","and","model","parameters","as","values",":","param","op",":","controls","whether","weight","perturbation","will","be","added","or","subtracted","from","model","parameters"]
code: def _modify_classifier(
      self,
      p_classifier: PyTorchClassifier,
      list_keys: List[str],
      w_perturb: Dict[str, "torch.Tensor"],
      op: str,
  ) -> None:
      """
      Modify the model's weight parameters according to the weight perturbations.
  
      :param p_classifier: model for awp protocol.
      :param list_keys: list of model parameters' names
      :param w_perturb: dictionary containing model parameters' names as keys and model parameters as values
      :param op: controls whether weight perturbation will be added or subtracted from model parameters
      """
      import torch
  
      if op.lower() == "add":
          c_mult = 1.0
      elif op.lower() == "subtract":
          c_mult = -1.0
      else:
          raise ValueError(
              "Incorrect op provided for weight perturbation. 'op' must be among 'add' and 'subtract'."
          )
      with torch.no_grad():
          for name, param in p_classifier.model.named_parameters():
              if name in list_keys:
                  param.add_(
                      c_mult
                      * self._train_params["awp_gamma"]
                      * w_perturb[name]
                  )
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  from collections import OrderedDict
  import logging
  import os
  import time
  from typing import Optional, Tuple, TYPE_CHECKING, List, Dict, Union
  import six
  import numpy
  from tqdm.auto import trange
  from art import config
  from art.defences.trainer.adversarial_trainer_oaat import AdversarialTrainerOAAT
  from art.estimators.classification.pytorch import PyTorchClassifier
  from art.data_generators import DataGenerator
  from art.attacks.attack import EvasionAttack
  from art.utils import check_and_transform_label_format, random_sphere
  from art.config import ART_NUMPY_DTYPE
label_desc: Use image node_id 7 for calling the AdversarialTrainerOAATPyTorch obj's underlying member method code with example usage: obj._modify_classifier(p_classifier, list_keys, w_perturb, op) without return types