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: Take in a dictionary of parameters and applies attack-specific checks
  before saving them as attributes.
  
  Attack-specific parameters:
  
  :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 loss_fn: Loss function that takes (labels, logits) as arguments and returns loss
  :param y: (optional) A tensor with the true 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 tensor 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
  :param clip_grad: (optional bool) Ignore gradient components
                    at positions where the input is already at the boundary
                    of the domain, and the update step will get clipped out.
  :param sanity_checks: bool, if True, include asserts
    (Turn them off to use less runtime / memory or for unit tests that
    intentionally pass strange input)
docstr_tok: ["Take","in","a","dictionary","of","parameters","and","applies","attack-specific","checks","before","saving","them","as","attributes",".","Attack-specific","parameters",":",":","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","loss_fn",":","Loss","function","that","takes","(","labels",",","logits",")","as","arguments","and","returns","loss",":","param","y",":","(","optional",")","A","tensor","with","the","true","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","tensor","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",":","param","clip_grad",":","(","optional","bool",")","Ignore","gradient","components","at","positions","where","the","input","is","already","at","the","boundary","of","the","domain",",","and","the","update","step","will","get","clipped","out",".",":","param","sanity_checks",":","bool",",","if","True",",","include","asserts","(","Turn","them","off","to","use","less","runtime","\/","memory","or","for","unit","tests","that","intentionally","pass","strange","input",")"]
code: def parse_params(
      self,
      eps=0.3,
      ord=np.inf,
      loss_fn=softmax_cross_entropy_with_logits,
      y=None,
      y_target=None,
      clip_min=None,
      clip_max=None,
      clip_grad=False,
      sanity_checks=True,
      **kwargs,
  ):
      """
      Take in a dictionary of parameters and applies attack-specific checks
      before saving them as attributes.
  
      Attack-specific parameters:
  
      :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 loss_fn: Loss function that takes (labels, logits) as arguments and returns loss
      :param y: (optional) A tensor with the true 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 tensor 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
      :param clip_grad: (optional bool) Ignore gradient components
                        at positions where the input is already at the boundary
                        of the domain, and the update step will get clipped out.
      :param sanity_checks: bool, if True, include asserts
        (Turn them off to use less runtime / memory or for unit tests that
        intentionally pass strange input)
      """
      # Save attack-specific parameters
  
      self.eps = eps
      self.ord = ord
      self.loss_fn = loss_fn
      self.y = y
      self.y_target = y_target
      self.clip_min = clip_min
      self.clip_max = clip_max
      self.clip_grad = clip_grad
      self.sanity_checks = sanity_checks
  
      if self.y is not None and self.y_target is not None:
          raise ValueError("Must not set both y and y_target")
      # Check if order of the norm is acceptable given current implementation
      if self.ord not in [np.inf, int(1), int(2)]:
          raise ValueError("Norm order must be either np.inf, 1, or 2.")
  
      if self.clip_grad and (
          self.clip_min is None or self.clip_max is None
      ):
          raise ValueError(
              "Must set clip_min and clip_max if clip_grad is set"
          )
  
      if len(kwargs.keys()) > 0:
          warnings.warn(
              "kwargs is unused and will be removed on or after "
              "2019-04-26."
          )
  
      return True
  
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 3 for calling the FastGradientMethod obj's underlying member method code with example usage: obj.parse_params(eps, ord, loss_fn, y, y_target, clip_min, clip_max, clip_grad, sanity_checks) and returns: True