class_docstr: This attack was originally proposed by Carlini and Wagner. It is an
  iterative attack that finds adversarial examples on many defenses that
  are robust to other attacks.
  Paper link: https://arxiv.org/abs/1608.04644
  
  At a high level, this attack is an iterative attack using Adam and
  a specially-chosen loss function to find adversarial examples with
  lower distortion than other attacks. This comes at the cost of speed,
  as this attack is often much slower than others.
  
  :param model: cleverhans.model.Model
  :param sess: tf.Session
  :param dtypestr: dtype of the data
  :param kwargs: passed through to super constructor
class_docstr_tok: ["This","attack","was","originally","proposed","by","Carlini","and","Wagner",".","It","is","an","iterative","attack","that","finds","adversarial","examples","on","many","defenses","that","are","robust","to","other","attacks",".","Paper","link",":","https",":","\/\/arxiv.org\/abs\/1608.04644","At","a","high","level",",","this","attack","is","an","iterative","attack","using","Adam","and","a","specially-chosen","loss","function","to","find","adversarial","examples","with","lower","distortion","than","other","attacks",".","This","comes","at","the","cost","of","speed",",","as","this","attack","is","often","much","slower","than","others",".",":","param","model",":","cleverhans.model.Model",":","param","sess",":","tf.Session",":","param","dtypestr",":","dtype","of","the","data",":","param","kwargs",":","passed","through","to","super","constructor"]
docstr: :param y: (optional) A tensor with the true labels for an untargeted
            attack. If None (and y_target is None) then use the
            original labels the classifier assigns.
  :param y_target: (optional) A tensor with the target labels for a
            targeted attack.
  :param confidence: Confidence of adversarial examples: higher produces
                     examples with larger l2 distortion, but more
                     strongly classified as adversarial.
  :param batch_size: Number of attacks to run simultaneously.
  :param learning_rate: The learning rate for the attack algorithm.
                        Smaller values produce better results but are
                        slower to converge.
  :param binary_search_steps: The number of times we perform binary
                              search to find the optimal tradeoff-
                              constant between norm of the purturbation
                              and confidence of the classification.
  :param max_iterations: The maximum number of iterations. Setting this
                         to a larger value will produce lower distortion
                         results. Using only a few iterations requires
                         a larger learning rate, and will produce larger
                         distortion results.
  :param abort_early: If true, allows early aborts if gradient descent
                      is unable to make progress (i.e., gets stuck in
                      a local minimum).
  :param initial_const: The initial tradeoff-constant to use to tune the
                        relative importance of size of the perturbation
                        and confidence of classification.
                        If binary_search_steps is large, the initial
                        constant is not important. A smaller value of
                        this constant gives lower distortion results.
  :param clip_min: (optional float) Minimum input component value
  :param clip_max: (optional float) Maximum input component value
docstr_tok: [":","param","y",":","(","optional",")","A","tensor","with","the","true","labels","for","an","untargeted","attack",".","If","None","(","and","y_target","is","None",")","then","use","the","original","labels","the","classifier","assigns",".",":","param","y_target",":","(","optional",")","A","tensor","with","the","target","labels","for","a","targeted","attack",".",":","param","confidence",":","Confidence","of","adversarial","examples",":","higher","produces","examples","with","larger","l2","distortion",",","but","more","strongly","classified","as","adversarial",".",":","param","batch_size",":","Number","of","attacks","to","run","simultaneously",".",":","param","learning_rate",":","The","learning","rate","for","the","attack","algorithm",".","Smaller","values","produce","better","results","but","are","slower","to","converge",".",":","param","binary_search_steps",":","The","number","of","times","we","perform","binary","search","to","find","the","optimal","tradeoff-","constant","between","norm","of","the","purturbation","and","confidence","of","the","classification",".",":","param","max_iterations",":","The","maximum","number","of","iterations",".","Setting","this","to","a","larger","value","will","produce","lower","distortion","results",".","Using","only","a","few","iterations","requires","a","larger","learning","rate",",","and","will","produce","larger","distortion","results",".",":","param","abort_early",":","If","true",",","allows","early","aborts","if","gradient","descent","is","unable","to","make","progress","(","i.e.",",","gets","stuck","in","a","local","minimum",")",".",":","param","initial_const",":","The","initial","tradeoff-constant","to","use","to","tune","the","relative","importance","of","size","of","the","perturbation","and","confidence","of","classification",".","If","binary_search_steps","is","large",",","the","initial","constant","is","not","important",".","A","smaller","value","of","this","constant","gives","lower","distortion","results",".",":","param","clip_min",":","(","optional","float",")","Minimum","input","component","value",":","param","clip_max",":","(","optional","float",")","Maximum","input","component","value"]
code: def parse_params(
      self,
      y=None,
      y_target=None,
      batch_size=1,
      confidence=0,
      learning_rate=5e-3,
      binary_search_steps=5,
      max_iterations=1000,
      abort_early=True,
      initial_const=1e-2,
      clip_min=0,
      clip_max=1,
  ):
      """
      :param y: (optional) A tensor with the true labels for an untargeted
                attack. If None (and y_target is None) then use the
                original labels the classifier assigns.
      :param y_target: (optional) A tensor with the target labels for a
                targeted attack.
      :param confidence: Confidence of adversarial examples: higher produces
                         examples with larger l2 distortion, but more
                         strongly classified as adversarial.
      :param batch_size: Number of attacks to run simultaneously.
      :param learning_rate: The learning rate for the attack algorithm.
                            Smaller values produce better results but are
                            slower to converge.
      :param binary_search_steps: The number of times we perform binary
                                  search to find the optimal tradeoff-
                                  constant between norm of the purturbation
                                  and confidence of the classification.
      :param max_iterations: The maximum number of iterations. Setting this
                             to a larger value will produce lower distortion
                             results. Using only a few iterations requires
                             a larger learning rate, and will produce larger
                             distortion results.
      :param abort_early: If true, allows early aborts if gradient descent
                          is unable to make progress (i.e., gets stuck in
                          a local minimum).
      :param initial_const: The initial tradeoff-constant to use to tune the
                            relative importance of size of the perturbation
                            and confidence of classification.
                            If binary_search_steps is large, the initial
                            constant is not important. A smaller value of
                            this constant gives lower distortion results.
      :param clip_min: (optional float) Minimum input component value
      :param clip_max: (optional float) Maximum input component value
      """
  
      # ignore the y and y_target argument
      self.batch_size = batch_size
      self.confidence = confidence
      self.learning_rate = learning_rate
      self.binary_search_steps = binary_search_steps
      self.max_iterations = max_iterations
      self.abort_early = abort_early
      self.initial_const = initial_const
      self.clip_min = clip_min
      self.clip_max = clip_max
  
file_path: cleverhans/cleverhans_v3.1.0/cleverhans/attacks/carlini_wagner_l2.py
imports: import logging
  import numpy
  import tensorflow
  from cleverhans.attacks.attack import Attack
  from cleverhans.compat import reduce_sum, reduce_max
  from cleverhans.model import CallableModelWrapper, Model, wrapper_warning_logits
  from cleverhans import utils
label_desc: Use image node_id 3 for calling the CarliniWagnerL2 obj's underlying member method code with example usage: obj.parse_params(y, y_target, batch_size, confidence, learning_rate, binary_search_steps, max_iterations, abort_early, initial_const, clip_min, clip_max) without return types