class_docstr: This attack was originally implemented by Goodfellow et al. (2014) with the
  infinity norm (and is known as the "Fast Gradient Sign Method"). This
  implementation extends the attack to other norms, and is therefore called
  the Fast Gradient Method.
  Paper link: https://arxiv.org/abs/1412.6572
  
  :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","attack","was","originally","implemented","by","Goodfellow","et","al",".","(","2014",")","with","the","infinity","norm","(","and","is","known","as","the","``","Fast","Gradient","Sign","Method","''",")",".","This","implementation","extends","the","attack","to","other","norms",",","and","is","therefore","called","the","Fast","Gradient","Method",".","Paper","link",":","https",":","\/\/arxiv.org\/abs\/1412.6572",":","param","model",":","cleverhans.model.Model",":","param","sess",":","optional","tf.Session",":","param","dtypestr",":","dtype","of","the","data",":","param","kwargs",":","passed","through","to","super","constructor"]
docstr: Returns the graph for Fast Gradient Method adversarial examples.
  
  :param x: The model's symbolic inputs.
  :param kwargs: See `parse_params`
docstr_tok: ["Returns","the","graph","for","Fast","Gradient","Method","adversarial","examples",".",":","param","x",":","The","model","'s","symbolic","inputs",".",":","param","kwargs",":","See","`","parse_params","`"]
code: def generate(self, x, **kwargs):
      """
      Returns the graph for Fast Gradient Method adversarial examples.
  
      :param x: The model's symbolic inputs.
      :param kwargs: See `parse_params`
      """
      # Parse and save attack-specific parameters
      assert self.parse_params(**kwargs)
  
      labels, _nb_classes = self.get_or_guess_labels(x, kwargs)
  
      return fgm(
          x,
          self.model.get_logits(x),
          y=labels,
          eps=self.eps,
          ord=self.ord,
          loss_fn=self.loss_fn,
          clip_min=self.clip_min,
          clip_max=self.clip_max,
          clip_grad=self.clip_grad,
          targeted=(self.y_target is not None),
          sanity_checks=self.sanity_checks,
      )
  
file_path: cleverhans/cleverhans_v3.1.0/cleverhans/attacks/fast_gradient_method.py
imports: import warnings
  import numpy
  import tensorflow
  from cleverhans.attacks.attack import Attack
  from cleverhans.compat import reduce_max, reduce_sum, softmax_cross_entropy_with_logits
  from cleverhans import utils_tf
label_desc: Use image node_id 2 for calling the FastGradientMethod obj's underlying member method code with example usage: obj.generate(x) and returns: fgm