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: Gradient of the weighted Lp-space norm with regards to the data vector.
  
  :param perturbations: Perturbations of samples towards being adversarial.
  :return: Weighted Lp-norm gradients array.
docstr_tok: ["Gradient","of","the","weighted","Lp-space","norm","with","regards","to","the","data","vector",".",":","param","perturbations",":","Perturbations","of","samples","towards","being","adversarial",".",":","return",":","Weighted","Lp-norm","gradients","array","."]
code: def __weighted_lp_norm_gradient(
      self, perturbations: np.ndarray
  ) -> np.ndarray:
      """
      Gradient of the weighted Lp-space norm with regards to the data vector.
  
      :param perturbations: Perturbations of samples towards being adversarial.
      :return: Weighted Lp-norm gradients array.
      """
      norm = self.norm
  
      if (
          isinstance(norm, (int, float))
          and norm < np.inf
          and self.importance_vec is not None
      ):
          numerator = (
              self.importance_vec
              * self.importance_vec
              * perturbations
              * np.power(np.abs(perturbations), norm - 2)
          )
          denominator = np.power(
              np.sum(
                  np.power(self.importance_vec * perturbations, norm)
              ),
              (norm - 1) / norm,
          )
  
          numerator = np.where(
              denominator > 1e-10,
              numerator,
              np.zeros(numerator.shape[1]),
          )
          denominator = np.where(denominator <= 1e-10, 1.0, denominator)
  
          return numerator / denominator
  
      # L-infinity norm (norm in ["inf", np.inf]).
      numerator = np.array(self.importance_vec * perturbations)
      optimum = np.max(np.abs(numerator))
      return np.where(abs(numerator) == optimum, np.sign(numerator), 0)
  
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 3 for calling the LowProFool obj's underlying member method code with example usage: obj.__weighted_lp_norm_gradient(perturbations) and returns: np, unknown