class_docstr: This implements the SPSA adversary, as in https://arxiv.org/abs/1802.05666
  (Uesato et al. 2018). SPSA is a gradient-free optimization method, which
  is useful when the model is non-differentiable, or more generally, the
  gradients do not point in useful directions.
  
  :param model: cleverhans.model.Model
  :param sess: optional tf.Session
  :param dtypestr: dtype of the data
  :param kwargs: passed through to super constructor
code: def __init__(self, model, sess=None, dtypestr="float32", **kwargs):
      super(SPSA, self).__init__(model, sess, dtypestr, **kwargs)
  
      self.feedable_kwargs = (
          "eps",
          "clip_min",
          "clip_max",
          "y",
          "y_target",
      )
      self.structural_kwargs = [
          "nb_iter",
          "spsa_samples",
          "spsa_iters",
          "early_stop_loss_threshold",
          "is_debug",
          "is_targeted",
      ]
  
      assert isinstance(self.model, Model)
  
imports: import warnings
  import numpy
  from six.moves import xrange
  import tensorflow
  import tensorflow_addons
  from cleverhans.attacks.attack import Attack
  from cleverhans.compat import reduce_mean, reduce_sum, reduce_max
  from cleverhans.model import Model
  from cleverhans import utils_tf
label_desc: Use image node_id 1 to create a new SPSA object from inherited base classes: Attack with example: obj = SPSA(model, sess, dtypestr)