class_docstr: Implementation of the attack from Moosavi-Dezfooli et al. (2015).
  
  | Paper link: https://arxiv.org/abs/1511.04599
class_docstr_tok: ["Implementation","of","the","attack","from","Moosavi-Dezfooli","et","al",".","(","2015",")",".","|","Paper","link",":","https",":","\/\/arxiv.org\/abs\/1511.04599"]
docstr: Create a DeepFool attack instance.
  
  :param classifier: A trained classifier.
  :param max_iter: The maximum number of iterations.
  :param epsilon: Overshoot parameter.
  :param nb_grads: The number of class gradients (top nb_grads w.r.t. prediction) to compute. This way only the
                   most likely classes are considered, speeding up the computation.
  :param batch_size: Batch size
  :param verbose: Show progress bars.
docstr_tok: ["Create","a","DeepFool","attack","instance",".",":","param","classifier",":","A","trained","classifier",".",":","param","max_iter",":","The","maximum","number","of","iterations",".",":","param","epsilon",":","Overshoot","parameter",".",":","param","nb_grads",":","The","number","of","class","gradients","(","top","nb_grads","w.r.t",".","prediction",")","to","compute",".","This","way","only","the","most","likely","classes","are","considered",",","speeding","up","the","computation",".",":","param","batch_size",":","Batch","size",":","param","verbose",":","Show","progress","bars","."]
code: def __init__(
      self,
      classifier: "CLASSIFIER_CLASS_LOSS_GRADIENTS_TYPE",
      max_iter: int = 100,
      epsilon: float = 1e-6,
      nb_grads: int = 10,
      batch_size: int = 1,
      verbose: bool = True,
  ) -> None:
      """
      Create a DeepFool attack instance.
  
      :param classifier: A trained classifier.
      :param max_iter: The maximum number of iterations.
      :param epsilon: Overshoot parameter.
      :param nb_grads: The number of class gradients (top nb_grads w.r.t. prediction) to compute. This way only the
                       most likely classes are considered, speeding up the computation.
      :param batch_size: Batch size
      :param verbose: Show progress bars.
      """
      super().__init__(estimator=classifier)
      self.max_iter = max_iter
      self.epsilon = epsilon
      self.nb_grads = nb_grads
      self.batch_size = batch_size
      self.verbose = verbose
      self._check_params()
      if self.estimator.clip_values is None:
          logger.warning(
              "The `clip_values` attribute of the estimator is `None`, therefore this instance of DeepFool will by "
              "default generate adversarial perturbations scaled for input values in the range [0, 1] but not clip "
              "the adversarial example."
          )
  
file_path: adversarial-robustness-toolbox/art/attacks/evasion/deepfool.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import Optional, TYPE_CHECKING
  import numpy
  from tqdm.auto import trange
  from art.config import ART_NUMPY_DTYPE
  from art.estimators.estimator import BaseEstimator
  from art.estimators.classification.classifier import ClassGradientsMixin
  from art.attacks.attack import EvasionAttack
  from art.utils import is_probability
label_desc: Use image node_id 1 to create a new DeepFool object from inherited base classes: EvasionAttack with example: obj = DeepFool(classifier, max_iter, epsilon, nb_grads, batch_size, verbose)