class_docstr: Inherited class from Attack and cleverhans.attacks.FastGradientMethod.
  
  This attack was originally implemented by Goodfellow et al. (2015) 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
class_docstr_tok: ["Inherited","class","from","Attack","and","cleverhans.attacks.FastGradientMethod",".","This","attack","was","originally","implemented","by","Goodfellow","et","al",".","(","2015",")","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"]
docstr: Generates the adversarial sample for the given input.
  :param x: The model's inputs.
  :param eps: (optional float) attack step size (input variation)
  :param ord: (optional) Order of the norm (mimics NumPy).
              Possible values: np.inf, 1 or 2.
  :param y: (optional) A tf variable` with the model labels. Only provide
            this parameter if you'd like to use true labels when crafting
            adversarial samples. Otherwise, model predictions are used as
            labels to avoid the "label leaking" effect (explained in this
            paper: https://arxiv.org/abs/1611.01236). Default is None.
            Labels should be one-hot-encoded.
  :param y_target: (optional) A tf variable` with the labels to target.
                      Leave y_target=None if y is also set.
                      Labels should be one-hot-encoded.
  :param clip_min: (optional float) Minimum input component value
  :param clip_max: (optional float) Maximum input component value
docstr_tok: ["Generates","the","adversarial","sample","for","the","given","input",".",":","param","x",":","The","model","'s","inputs",".",":","param","eps",":","(","optional","float",")","attack","step","size","(","input","variation",")",":","param","ord",":","(","optional",")","Order","of","the","norm","(","mimics","NumPy",")",".","Possible","values",":","np.inf",",","1","or","2.",":","param","y",":","(","optional",")","A","tf","variable","`","with","the","model","labels",".","Only","provide","this","parameter","if","you","'d","like","to","use","true","labels","when","crafting","adversarial","samples",".","Otherwise",",","model","predictions","are","used","as","labels","to","avoid","the","``","label","leaking","''","effect","(","explained","in","this","paper",":","https",":","\/\/arxiv.org\/abs\/1611.01236",")",".","Default","is","None",".","Labels","should","be","one-hot-encoded",".",":","param","y_target",":","(","optional",")","A","tf","variable","`","with","the","labels","to","target",".","Leave","y_target=None","if","y","is","also","set",".","Labels","should","be","one-hot-encoded",".",":","param","clip_min",":","(","optional","float",")","Minimum","input","component","value",":","param","clip_max",":","(","optional","float",")","Maximum","input","component","value"]
code: def generate(self, x, **kwargs):
      """
      Generates the adversarial sample for the given input.
      :param x: The model's inputs.
      :param eps: (optional float) attack step size (input variation)
      :param ord: (optional) Order of the norm (mimics NumPy).
                  Possible values: np.inf, 1 or 2.
      :param y: (optional) A tf variable` with the model labels. Only provide
                this parameter if you'd like to use true labels when crafting
                adversarial samples. Otherwise, model predictions are used as
                labels to avoid the "label leaking" effect (explained in this
                paper: https://arxiv.org/abs/1611.01236). Default is None.
                Labels should be one-hot-encoded.
      :param y_target: (optional) A tf variable` with the labels to target.
                          Leave y_target=None if y is also set.
                          Labels should be one-hot-encoded.
      :param clip_min: (optional float) Minimum input component value
      :param clip_max: (optional float) Maximum input component value
      """
      # Parse and save attack-specific parameters
      assert self.parse_params(**kwargs)
      labels, _nb_classes = self.get_or_guess_labels(x, kwargs)
      return self.fgm(
          x, labels=labels, targeted=(self.y_target is not None)
      )
  
imports: from distutils.version import LooseVersion
  import numpy
  import tensorflow
  from cleverhans import attacks
  from cleverhans import utils
  from cleverhans.model import CallableModelWrapper, wrapper_warning
  from cleverhans.model import Model
  from cleverhans.loss import LossCrossEntropy
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: self