class_docstr: Optimizer for gradient-free attacks in https://arxiv.org/abs/1802.05666.
  
  Gradients estimates are computed using Simultaneous Perturbation Stochastic Approximation (SPSA),
  combined with the ADAM update rule (https://arxiv.org/abs/1412.6980).
class_docstr_tok: ["Optimizer","for","gradient-free","attacks","in","https",":","\/\/arxiv.org\/abs\/1802.05666",".","Gradients","estimates","are","computed","using","Simultaneous","Perturbation","Stochastic","Approximation","(","SPSA",")",",","combined","with","the","ADAM","update","rule","(","https",":","\/\/arxiv.org\/abs\/1412.6980",")","."]
docstr: Analogous to tf.Optimizer.minimize
  
  :param loss_fn: tf Tensor, representing the loss to minimize
  :param x: list of Tensor, analogous to tf.Optimizer's var_list
  :param optim_state: A possibly nested dict, containing any optimizer state.
  
  Returns:
    new_x: list of Tensor, updated version of `x`
    new_optim_state: dict, updated version of `optim_state`
docstr_tok: ["Analogous","to","tf.Optimizer.minimize",":","param","loss_fn",":","tf","Tensor",",","representing","the","loss","to","minimize",":","param","x",":","list","of","Tensor",",","analogous","to","tf.Optimizer","'s","var_list",":","param","optim_state",":","A","possibly","nested","dict",",","containing","any","optimizer","state",".","Returns",":","new_x",":","list","of","Tensor",",","updated","version","of","`","x","`","new_optim_state",":","dict",",","updated","version","of","`","optim_state","`"]
code: def minimize(self, loss_fn, x, optim_state):
      """Analogous to tf.Optimizer.minimize
  
      :param loss_fn: tf Tensor, representing the loss to minimize
      :param x: list of Tensor, analogous to tf.Optimizer's var_list
      :param optim_state: A possibly nested dict, containing any optimizer state.
  
      Returns:
        new_x: list of Tensor, updated version of `x`
        new_optim_state: dict, updated version of `optim_state`
      """
      grads = self._compute_gradients(loss_fn, x)
      return self._apply_gradients(grads, x, optim_state)
  
file_path: cleverhans/cleverhans/tf2/attacks/spsa.py
imports: import tensorflow
label_desc: Use image node_id 6 for calling the SPSAAdam obj's underlying member method code with example usage: obj.minimize(loss_fn, x, optim_state) and returns: self