class_docstr: Single Pixel Attack
  Algorithm 1 in https://arxiv.org/pdf/1612.06299.pdf
  
  :param predict: forward pass function.
  :param max_pixels: max number of pixels to perturb.
  :param clip_min: mininum value per input dimension.
  :param clip_max: maximum value per input dimension.
  :param loss_fn: loss function
  :param targeted: if the attack is targeted.
code: def __init__(
      self,
      predict,
      max_pixels=100,
      clip_min=0.0,
      loss_fn=None,
      clip_max=1.0,
      comply_with_foolbox=False,
      targeted=False,
  ):
      super(SinglePixelAttack, self).__init__(
          predict=predict,
          loss_fn=None,
          clip_min=clip_min,
          clip_max=clip_max,
      )
      self.max_pixels = max_pixels
      self.clip_min = clip_min
      self.clip_max = clip_max
      self.comply_with_foolbox = comply_with_foolbox
      self.targeted = targeted
  
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 SinglePixelAttack object from inherited base classes: Attack, LabelMixin with example: obj = SinglePixelAttack(predict, max_pixels, clip_min, loss_fn, clip_max, comply_with_foolbox, targeted)