class_docstr: Implementation of the Jacobian-based Saliency Map Attack (Papernot et al. 2016).
  
  | Paper link: https://arxiv.org/abs/1511.07528
class_docstr_tok: ["Implementation","of","the","Jacobian-based","Saliency","Map","Attack","(","Papernot","et","al",".","2016",")",".","|","Paper","link",":","https",":","\/\/arxiv.org\/abs\/1511.07528"]
docstr: Compute the saliency map of `x`. Return the top 2 coefficients in `search_space` that maximize / minimize
  the saliency map.
  
  :param x: A batch of input samples.
  :param target: Target class for `x`.
  :param search_space: The set of valid pairs of feature indices to search.
  :return: The top 2 coefficients in `search_space` that maximize / minimize the saliency map.
docstr_tok: ["Compute","the","saliency","map","of","`","x","`",".","Return","the","top","2","coefficients","in","`","search_space","`","that","maximize","\/","minimize","the","saliency","map",".",":","param","x",":","A","batch","of","input","samples",".",":","param","target",":","Target","class","for","`","x","`",".",":","param","search_space",":","The","set","of","valid","pairs","of","feature","indices","to","search",".",":","return",":","The","top","2","coefficients","in","`","search_space","`","that","maximize","\/","minimize","the","saliency","map","."]
code: def _saliency_map(
      self,
      x: np.ndarray,
      target: Union[np.ndarray, int],
      search_space: np.ndarray,
  ) -> np.ndarray:
      """
      Compute the saliency map of `x`. Return the top 2 coefficients in `search_space` that maximize / minimize
      the saliency map.
  
      :param x: A batch of input samples.
      :param target: Target class for `x`.
      :param search_space: The set of valid pairs of feature indices to search.
      :return: The top 2 coefficients in `search_space` that maximize / minimize the saliency map.
      """
      grads = self.estimator.class_gradient(x, label=target)
      grads = np.reshape(grads, (-1, self._nb_features))
  
      # Remove gradients for already used features
      used_features = 1 - search_space
      coeff = 2 * int(self.theta > 0) - 1
      grads[used_features == 1] = -np.inf * coeff
  
      if self.theta > 0:
          ind = np.argpartition(grads, -2, axis=1)[:, -2:]
      else:  # pragma: no cover
          ind = np.argpartition(-grads, -2, axis=1)[:, -2:]
  
      return ind
  
file_path: adversarial-robustness-toolbox/art/attacks/evasion/saliency_map.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import Optional, Union, TYPE_CHECKING
  import numpy
  from tqdm.auto import trange
  from art.attacks.attack import EvasionAttack
  from art.config import ART_NUMPY_DTYPE
  from art.estimators.estimator import BaseEstimator
  from art.estimators.classification.classifier import ClassGradientsMixin
  from art.utils import check_and_transform_label_format
label_desc: Use image node_id 3 for calling the SaliencyMapMethod obj's underlying member method code with example usage: obj._saliency_map(x, target, search_space) and returns: ind