class_docstr: Implementation of the attack from Moosavi-Dezfooli et al. (2016). Computes a fixed perturbation to be applied to all
  future inputs. To this end, it can use any adversarial attack method.
  
  | Paper link: https://arxiv.org/abs/1610.08401
class_docstr_tok: ["Implementation","of","the","attack","from","Moosavi-Dezfooli","et","al",".","(","2016",")",".","Computes","a","fixed","perturbation","to","be","applied","to","all","future","inputs",".","To","this","end",",","it","can","use","any","adversarial","attack","method",".","|","Paper","link",":","https",":","\/\/arxiv.org\/abs\/1610.08401"]
docstr: :param classifier: A trained classifier.
  :param attacker: Adversarial attack name. Default is 'deepfool'. Supported names: 'carlini', 'carlini_inf',
                   'deepfool', 'fgsm', 'bim', 'pgd', 'margin', 'ead', 'newtonfool', 'jsma', 'vat', 'simba'.
  :param attacker_params: Parameters specific to the adversarial attack. If this parameter is not specified,
                          the default parameters of the chosen attack will be used.
  :param delta: desired accuracy
  :param max_iter: The maximum number of iterations for computing universal perturbation.
  :param eps: Attack step size (input variation).
  :param norm: The norm of the adversarial perturbation. Possible values: "inf", np.inf, 2.
  :param batch_size: Batch size for model evaluations in UniversalPerturbation.
  :param verbose: Show progress bars.
docstr_tok: [":","param","classifier",":","A","trained","classifier",".",":","param","attacker",":","Adversarial","attack","name",".","Default","is","'deepfool","'",".","Supported","names",":","'carlini","'",",","'carlini_inf","'",",","'deepfool","'",",","'fgsm","'",",","'bim","'",",","'pgd","'",",","'margin","'",",","'ead","'",",","'newtonfool","'",",","'jsma","'",",","'vat","'",",","'simba","'",".",":","param","attacker_params",":","Parameters","specific","to","the","adversarial","attack",".","If","this","parameter","is","not","specified",",","the","default","parameters","of","the","chosen","attack","will","be","used",".",":","param","delta",":","desired","accuracy",":","param","max_iter",":","The","maximum","number","of","iterations","for","computing","universal","perturbation",".",":","param","eps",":","Attack","step","size","(","input","variation",")",".",":","param","norm",":","The","norm","of","the","adversarial","perturbation",".","Possible","values",":","``","inf","''",",","np.inf",",","2.",":","param","batch_size",":","Batch","size","for","model","evaluations","in","UniversalPerturbation",".",":","param","verbose",":","Show","progress","bars","."]
code: def __init__(
      self,
      classifier: "CLASSIFIER_TYPE",
      attacker: str = "deepfool",
      attacker_params: Optional[Dict[str, Any]] = None,
      delta: float = 0.2,
      max_iter: int = 20,
      eps: float = 10.0,
      norm: Union[int, float, str] = np.inf,
      batch_size: int = 32,
      verbose: bool = True,
  ) -> None:
      """
      :param classifier: A trained classifier.
      :param attacker: Adversarial attack name. Default is 'deepfool'. Supported names: 'carlini', 'carlini_inf',
                       'deepfool', 'fgsm', 'bim', 'pgd', 'margin', 'ead', 'newtonfool', 'jsma', 'vat', 'simba'.
      :param attacker_params: Parameters specific to the adversarial attack. If this parameter is not specified,
                              the default parameters of the chosen attack will be used.
      :param delta: desired accuracy
      :param max_iter: The maximum number of iterations for computing universal perturbation.
      :param eps: Attack step size (input variation).
      :param norm: The norm of the adversarial perturbation. Possible values: "inf", np.inf, 2.
      :param batch_size: Batch size for model evaluations in UniversalPerturbation.
      :param verbose: Show progress bars.
      """
      super().__init__(estimator=classifier)
      self.attacker = attacker
      self.attacker_params = attacker_params
      self.delta = delta
      self.max_iter = max_iter
      self.eps = eps
      self.norm = norm
      self.batch_size = batch_size
      self.verbose = verbose
      self._check_params()
  
      # Attack properties
      self._fooling_rate: Optional[float] = None
      self._converged: Optional[bool] = None
      self._noise: Optional[np.ndarray] = None
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import random
  import types
  from typing import Any, Dict, Optional, Union, TYPE_CHECKING
  import numpy
  from tqdm.auto import tqdm
  from art.attacks.attack import EvasionAttack
  from art.estimators.estimator import BaseEstimator
  from art.estimators.classification.classifier import ClassifierMixin
  from art.utils import projection, get_labels_np_array, check_and_transform_label_format
label_desc: Use image node_id 1 to create a new UniversalPerturbation object from inherited base classes: EvasionAttack with example: obj = UniversalPerturbation(classifier, attacker, attacker_params, delta, max_iter, eps, norm, batch_size, verbose)