class_docstr: Local Search Attack
  Algorithm 3 in https://arxiv.org/pdf/1612.06299.pdf
  
  :param predict: forward pass function.
  :param clip_min: mininum value per input dimension.
  :param clip_max: maximum value per input dimension.
  :param p: parameter controls pixel complexity
  :param r: perturbation value
  :param loss_fn: loss function
  :param d: the half side length of the neighbourhood square
  :param t: the number of pixels perturbed at each round
  :param k: the threshold for k-misclassification
  :param round_ub: an upper bound on the number of rounds
code: def __init__(
      self,
      predict,
      clip_min=0.0,
      clip_max=1.0,
      p=1.0,
      r=1.5,
      loss_fn=None,
      d=5,
      t=5,
      k=1,
      round_ub=10,
      seed_ratio=0.1,
      max_nb_seeds=128,
      comply_with_foolbox=False,
      targeted=False,
  ):
      super(LocalSearchAttack, self).__init__(
          predict=predict,
          clip_max=clip_max,
          clip_min=clip_min,
          loss_fn=None,
      )
      self.p = p
      self.r = r
      self.d = d
      self.t = t
      self.k = k
      self.round_ub = round_ub
      self.seed_ratio = seed_ratio
      self.max_nb_seeds = max_nb_seeds
      self.comply_with_foolbox = comply_with_foolbox
      self.targeted = targeted
  
      if clip_min is None or clip_max is None:
          raise ValueError(
              "{} {}".format(
                  LocalSearchAttack,
                  "must have clip_min and clip_max specified as scalar values.",
              )
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import numpy
  import torch
  import torch.nn
  from advertorch.utils import clamp
  from advertorch.utils import replicate_input
  from .base import Attack
  from .base import LabelMixin
  from .utils import is_successful
label_desc: Use image node_id 1 to create a new LocalSearchAttack object from inherited base classes: Attack, LabelMixin with example: obj = LocalSearchAttack(predict, clip_min, clip_max, p, r, loss_fn, d, t, k, round_ub, seed_ratio, max_nb_seeds, comply_with_foolbox, targeted)