class_docstr: This class implements a variant of Projected Gradient Descent for the l1-norm
  (Tramer and Boneh 2019). The l1-norm case is more tricky than the l-inf and l2
  cases covered by the ProjectedGradientDescent class, because the steepest
  descent direction for the l1-norm is too sparse (it updates a single
  coordinate in the adversarial perturbation in each step). This attack has an
  additional parameter that controls the sparsity of the update step. For
  moderately sparse update steps, the attack vastly outperforms Projected
  Steepest Descent and is competitive with other attacks targeted at the l1-norm
  such as the ElasticNetMethod attack (which is much more computationally
  expensive).
  Paper link (Tramer and Boneh 2019): https://arxiv.org/pdf/1904.13000.pdf
  
  :param model: cleverhans.model.Model
  :param sess: optional tf.Session
  :param dtypestr: dtype of the data
  :param kwargs: passed through to super constructor
class_docstr_tok: ["This","class","implements","a","variant","of","Projected","Gradient","Descent","for","the","l1-norm","(","Tramer","and","Boneh","2019",")",".","The","l1-norm","case","is","more","tricky","than","the","l-inf","and","l2","cases","covered","by","the","ProjectedGradientDescent","class",",","because","the","steepest","descent","direction","for","the","l1-norm","is","too","sparse","(","it","updates","a","single","coordinate","in","the","adversarial","perturbation","in","each","step",")",".","This","attack","has","an","additional","parameter","that","controls","the","sparsity","of","the","update","step",".","For","moderately","sparse","update","steps",",","the","attack","vastly","outperforms","Projected","Steepest","Descent","and","is","competitive","with","other","attacks","targeted","at","the","l1-norm","such","as","the","ElasticNetMethod","attack","(","which","is","much","more","computationally","expensive",")",".","Paper","link","(","Tramer","and","Boneh","2019",")",":","https",":","\/\/arxiv.org\/pdf\/1904.13000.pdf",":","param","model",":","cleverhans.model.Model",":","param","sess",":","optional","tf.Session",":","param","dtypestr",":","dtype","of","the","data",":","param","kwargs",":","passed","through","to","super","constructor"]
docstr: Create a SparseL1Descent instance.
  Note: the model parameter should be an instance of the
  cleverhans.model.Model abstraction provided by CleverHans.
docstr_tok: ["Create","a","SparseL1Descent","instance",".","Note",":","the","model","parameter","should","be","an","instance","of","the","cleverhans.model.Model","abstraction","provided","by","CleverHans","."]
code: def __init__(self, model, sess=None, dtypestr="float32", **kwargs):
      """
      Create a SparseL1Descent instance.
      Note: the model parameter should be an instance of the
      cleverhans.model.Model abstraction provided by CleverHans.
      """
  
      super(SparseL1Descent, self).__init__(
          model, sess=sess, dtypestr=dtypestr, **kwargs
      )
      self.feedable_kwargs = (
          "eps",
          "eps_iter",
          "y",
          "y_target",
          "clip_min",
          "clip_max",
          "grad_sparsity",
      )
      self.structural_kwargs = [
          "nb_iter",
          "rand_init",
          "clip_grad",
          "sanity_checks",
      ]
  
file_path: cleverhans/cleverhans_v3.1.0/cleverhans/attacks/sparse_l1_descent.py
imports: import warnings
  from distutils.version import LooseVersion
  import tensorflow
  from cleverhans.attacks.attack import Attack
  from cleverhans import utils_tf
  from cleverhans.utils_tf import clip_eta, random_lp_vector
  from cleverhans.compat import reduce_max, reduce_sum, softmax_cross_entropy_with_logits
label_desc: Use image node_id 1 to create a new SparseL1Descent object from inherited base classes: Attack with example: obj = SparseL1Descent(model, sess, dtypestr)