class_docstr: Jacobian Saliency Map Attack
  This includes Algorithm 1 and 3 in v1, https://arxiv.org/abs/1511.07528v1
  
  :param predict: forward pass function.
  :param num_classes: number of clasess.
  :param clip_min: mininum value per input dimension.
  :param clip_max: maximum value per input dimension.
  :param gamma: highest percentage of pixels can be modified
  :param theta: perturb length, range is either [theta, 0], [0, theta]
class_docstr_tok: ["Jacobian","Saliency","Map","Attack","This","includes","Algorithm","1","and","3","in","v1",",","https",":","\/\/arxiv.org\/abs\/1511.07528v1",":","param","predict",":","forward","pass","function",".",":","param","num_classes",":","number","of","clasess",".",":","param","clip_min",":","mininum","value","per","input","dimension",".",":","param","clip_max",":","maximum","value","per","input","dimension",".",":","param","gamma",":","highest","percentage","of","pixels","can","be","modified",":","param","theta",":","perturb","length",",","range","is","either","[","theta",",","0","]",",","[","0",",","theta","]"]
code: def perturb(self, x, y=None):
      x, y = self._verify_and_process_inputs(x, y)
      xadv = x
      batch_size = x.shape[0]
      dim_x = int(np.prod(x.shape[1:]))
      max_iters = int(dim_x * self.gamma / 2)
      search_space = x.new_ones(batch_size, dim_x).int()
      curr_step = 0
      yadv = self._get_predicted_label(xadv)
  
      # Algorithm 1
      while (y != yadv).any() and curr_step < max_iters:
          grads_target, grads_other = self._compute_forward_derivative(
              xadv, y
          )
  
          # Algorithm 3
          p1, p2, valid = self._saliency_map(
              search_space, grads_target, grads_other, y
          )
  
          cond = (y != yadv) & valid
  
          self._update_search_space(search_space, p1, p2, cond)
  
          xadv = self._modify_xadv(xadv, batch_size, cond, p1, p2)
          yadv = self._get_predicted_label(xadv)
  
          curr_step += 1
  
      xadv = clamp(xadv, min=self.clip_min, max=self.clip_max)
      return xadv
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import numpy
  import torch
  from advertorch.utils import clamp
  from advertorch.utils import jacobian
  from .base import Attack
  from .base import LabelMixin
label_desc: Use image node_id 8 for calling the JacobianSaliencyMapAttack obj's underlying member method code with example usage: obj.perturb(x, y) and returns: xadv