class_docstr: Spatially Transformed Attack (Xiao et al. 2018)
  https://openreview.net/forum?id=HyydRMZC-
  
  :param predict: forward pass function.
  :param num_classes: number of clasess.
  :param confidence: confidence of the adversarial examples.
  :param initial_const: initial value of the constant c
  :param max_iterations: the maximum number of iterations
  :param search_steps: number of search times to find the optimum
  :param loss_fn: loss function
  :param clip_min: mininum value per input dimension.
  :param clip_max: maximum value per input dimension.
  :param abort_early: if set to true, abort early if getting stuck in local
      min
  :param targeted: if the attack is targeted
class_docstr_tok: ["Spatially","Transformed","Attack","(","Xiao","et","al",".","2018",")","https",":","\/\/openreview.net\/forum","?","id=HyydRMZC-",":","param","predict",":","forward","pass","function",".",":","param","num_classes",":","number","of","clasess",".",":","param","confidence",":","confidence","of","the","adversarial","examples",".",":","param","initial_const",":","initial","value","of","the","constant","c",":","param","max_iterations",":","the","maximum","number","of","iterations",":","param","search_steps",":","number","of","search","times","to","find","the","optimum",":","param","loss_fn",":","loss","function",":","param","clip_min",":","mininum","value","per","input","dimension",".",":","param","clip_max",":","maximum","value","per","input","dimension",".",":","param","abort_early",":","if","set","to","true",",","abort","early","if","getting","stuck","in","local","min",":","param","targeted",":","if","the","attack","is","targeted"]
code: def __init__(
      self,
      predict,
      num_classes,
      confidence=0,
      initial_const=1,
      max_iterations=1000,
      search_steps=1,
      loss_fn=None,
      clip_min=0.0,
      clip_max=1.0,
      abort_early=True,
      targeted=False,
  ):
      super(SpatialTransformAttack, self).__init__(
          predict, loss_fn, clip_min, clip_max
      )
      self.num_classes = num_classes
      self.confidence = confidence
      self.initial_const = initial_const
      self.max_iterations = max_iterations
      self.search_steps = search_steps
      self.abort_early = abort_early
      self.targeted = targeted
  
file_path: advertorch/advertorch/attacks/spatial.py
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.functional
  from advertorch.utils import calc_l2distsq
  from advertorch.utils import clamp
  from advertorch.utils import to_one_hot
  from .base import Attack
  from .base import LabelMixin
  from .utils import is_successful
label_desc: Use image node_id 1 to create a new SpatialTransformAttack object from inherited base classes: Attack, LabelMixin with example: obj = SpatialTransformAttack(predict, num_classes, confidence, initial_const, max_iterations, search_steps, loss_fn, clip_min, clip_max, abort_early, targeted)