class_docstr: `LowProFool` attack.
  
  | Paper link: https://arxiv.org/abs/1911.03274
class_docstr_tok: ["`","LowProFool","`","attack",".","|","Paper","link",":","https",":","\/\/arxiv.org\/abs\/1911.03274"]
docstr: Create a LowProFool instance.
  
  :param classifier: Appropriate classifier's instance
  :param n_steps: Number of iterations to follow
  :param threshold: Lowest prediction probability of a valid adversary
  :param lambd: Amount of lp-norm impact on objective function
  :param eta: Rate of updating the perturbation vectors
  :param eta_decay: Step-by-step decrease of eta
  :param eta_min: Minimal eta value
  :param norm: Parameter `p` for Lp-space norm (norm=2 - euclidean norm)
  :param importance: Function to calculate feature importance with
      or vector of those precomputed; possibilities:
      > 'pearson' - Pearson correlation (string)
      > function  - Custom function (callable object)
      > vector    - Vector of feature importance (np.ndarray)
  :param verbose: Verbose mode / Show progress bars.
docstr_tok: ["Create","a","LowProFool","instance",".",":","param","classifier",":","Appropriate","classifier","'s","instance",":","param","n_steps",":","Number","of","iterations","to","follow",":","param","threshold",":","Lowest","prediction","probability","of","a","valid","adversary",":","param","lambd",":","Amount","of","lp-norm","impact","on","objective","function",":","param","eta",":","Rate","of","updating","the","perturbation","vectors",":","param","eta_decay",":","Step-by-step","decrease","of","eta",":","param","eta_min",":","Minimal","eta","value",":","param","norm",":","Parameter","`","p","`","for","Lp-space","norm","(","norm=2","-","euclidean","norm",")",":","param","importance",":","Function","to","calculate","feature","importance","with","or","vector","of","those","precomputed",";","possibilities",":",">","'pearson","'","-","Pearson","correlation","(","string",")",">","function","-","Custom","function","(","callable","object",")",">","vector","-","Vector","of","feature","importance","(","np.ndarray",")",":","param","verbose",":","Verbose","mode","\/","Show","progress","bars","."]
code: def __init__(
      self,
      classifier: "CLASSIFIER_CLASS_LOSS_GRADIENTS_TYPE",
      n_steps: int = 100,
      threshold: Union[float, None] = 0.5,
      lambd: float = 1.5,
      eta: float = 0.2,
      eta_decay: float = 0.98,
      eta_min: float = 1e-7,
      norm: Union[int, float, str] = 2,
      importance: Union[Callable, str, np.ndarray] = "pearson",
      verbose: bool = False,
  ) -> None:
      """
      Create a LowProFool instance.
  
      :param classifier: Appropriate classifier's instance
      :param n_steps: Number of iterations to follow
      :param threshold: Lowest prediction probability of a valid adversary
      :param lambd: Amount of lp-norm impact on objective function
      :param eta: Rate of updating the perturbation vectors
      :param eta_decay: Step-by-step decrease of eta
      :param eta_min: Minimal eta value
      :param norm: Parameter `p` for Lp-space norm (norm=2 - euclidean norm)
      :param importance: Function to calculate feature importance with
          or vector of those precomputed; possibilities:
          > 'pearson' - Pearson correlation (string)
          > function  - Custom function (callable object)
          > vector    - Vector of feature importance (np.ndarray)
      :param verbose: Verbose mode / Show progress bars.
      """
      super().__init__(estimator=classifier)
  
      self.n_steps = n_steps
      self.threshold = threshold
      self.lambd = lambd
      self.eta = eta
      self.eta_decay = eta_decay
      self.eta_min = eta_min
      self.norm = norm
      self.importance = importance
      self.verbose = verbose
  
      self._targeted = True
      self.n_classes = self.estimator.nb_classes
      self.n_features = self.estimator.input_shape[0]
      self.importance_vec = None
      if self.estimator.clip_values is None:
          logger.warning(  # pragma: no cover
              "The `clip_values` attribute of the estimator is `None`, therefore this instance of LowProFool will by "
              "default generate adversarial perturbations without clipping them."
          )
  
      self._check_params()
  
      if isinstance(self.importance, np.ndarray):
          self.importance_vec = self.importance
  
      if eta_decay < 1 and eta_min > 0:
          steps_before_min_eta_reached = np.ceil(
              np.log(eta_min / eta) / np.log(eta_decay)
          )
  
          if steps_before_min_eta_reached / self.n_steps < 0.8:
              logger.warning(  # pragma: no cover
                  "The given combination of 'n_steps', 'eta', 'eta_decay' and 'eta_min' effectively sets learning "
                  "rate to its minimal value after about %d steps out of all %d.",
                  steps_before_min_eta_reached,
                  self.n_steps,
              )
  
imports: import logging
  from typing import Callable, Optional, Union, TYPE_CHECKING
  import numpy
  from scipy.stats import pearsonr
  from tqdm.auto import trange
  from art.attacks.attack import EvasionAttack
  from art.estimators.estimator import LossGradientsMixin
  from art.estimators.estimator import BaseEstimator
  from art.estimators.classification.classifier import ClassifierMixin
label_desc: Use image node_id 1 to create a new LowProFool object from inherited base classes: EvasionAttack with example: obj = LowProFool(classifier, n_steps, threshold, lambd, eta, eta_decay, eta_min, norm, importance, verbose)