class_docstr: This is a modified version of the L_2 optimized attack of Carlini and Wagner (2016). It controls the L_Inf
  norm, i.e. the maximum perturbation applied to each pixel.
docstr: Create a Carlini&Wagner L_Inf attack instance.
  
  :param classifier: A trained classifier.
  :param confidence: Confidence of adversarial examples: a higher value produces examples that are farther away,
          from the original input, but classified with higher confidence as the target class.
  :param targeted: Should the attack target one specific class.
  :param learning_rate: The initial learning rate for the attack algorithm. Smaller values produce better
          results but are slower to converge.
  :param max_iter: The maximum number of iterations.
  :param decrease_factor: The rate of shrinking tau, values in `0 < decrease_factor < 1` where larger is more
                          accurate.
  :param initial_const: The initial value of constant `c`.
  :param largest_const: The largest value of constant `c`.
  :param const_factor: The rate of increasing constant `c` with `const_factor > 1`, where smaller more accurate.
  :param batch_size: Size of the batch on which adversarial samples are generated.
  :param verbose: Show progress bars.
docstr_tok: ["Create","a","Carlini","&","Wagner","L_Inf","attack","instance",".",":","param","classifier",":","A","trained","classifier",".",":","param","confidence",":","Confidence","of","adversarial","examples",":","a","higher","value","produces","examples","that","are","farther","away",",","from","the","original","input",",","but","classified","with","higher","confidence","as","the","target","class",".",":","param","targeted",":","Should","the","attack","target","one","specific","class",".",":","param","learning_rate",":","The","initial","learning","rate","for","the","attack","algorithm",".","Smaller","values","produce","better","results","but","are","slower","to","converge",".",":","param","max_iter",":","The","maximum","number","of","iterations",".",":","param","decrease_factor",":","The","rate","of","shrinking","tau",",","values","in","`","0","<","decrease_factor","<","1","`","where","larger","is","more","accurate",".",":","param","initial_const",":","The","initial","value","of","constant","`","c","`",".",":","param","largest_const",":","The","largest","value","of","constant","`","c","`",".",":","param","const_factor",":","The","rate","of","increasing","constant","`","c","`","with","`","const_factor",">","1","`",",","where","smaller","more","accurate",".",":","param","batch_size",":","Size","of","the","batch","on","which","adversarial","samples","are","generated",".",":","param","verbose",":","Show","progress","bars","."]
code: def __init__(
      self,
      classifier: "CLASSIFIER_CLASS_LOSS_GRADIENTS_TYPE",
      confidence: float = 0.0,
      targeted: bool = False,
      learning_rate: float = 0.01,
      max_iter: int = 10,
      decrease_factor: float = 0.9,
      initial_const: float = 1e-5,
      largest_const: float = 20.0,
      const_factor: float = 2.0,
      batch_size: int = 1,
      verbose: bool = True,
  ) -> None:
      """
      Create a Carlini&Wagner L_Inf attack instance.
  
      :param classifier: A trained classifier.
      :param confidence: Confidence of adversarial examples: a higher value produces examples that are farther away,
              from the original input, but classified with higher confidence as the target class.
      :param targeted: Should the attack target one specific class.
      :param learning_rate: The initial learning rate for the attack algorithm. Smaller values produce better
              results but are slower to converge.
      :param max_iter: The maximum number of iterations.
      :param decrease_factor: The rate of shrinking tau, values in `0 < decrease_factor < 1` where larger is more
                              accurate.
      :param initial_const: The initial value of constant `c`.
      :param largest_const: The largest value of constant `c`.
      :param const_factor: The rate of increasing constant `c` with `const_factor > 1`, where smaller more accurate.
      :param batch_size: Size of the batch on which adversarial samples are generated.
      :param verbose: Show progress bars.
      """
      super().__init__(estimator=classifier)
  
      self.confidence = confidence
      self._targeted = targeted
      self.learning_rate = learning_rate
      self.max_iter = max_iter
      self.decrease_factor = decrease_factor
      self.initial_const = initial_const
      self.largest_const = largest_const
      self.const_factor = const_factor
      self.batch_size = batch_size
      self.verbose = verbose
      self._check_params()
  
      # There is one internal hyperparameter:
      # Smooth arguments of arctanh by multiplying with this constant to avoid division by zero:
      self._tanh_smoother = 0.999999
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import Optional, Tuple, TYPE_CHECKING
  import numpy
  from tqdm.auto import trange
  from art.config import ART_NUMPY_DTYPE
  from art.optimizers import Adam
  from art.estimators.estimator import BaseEstimator
  from art.estimators.classification.classifier import ClassGradientsMixin
  from art.attacks.attack import EvasionAttack
  from art.utils import compute_success, get_labels_np_array, tanh_to_original, original_to_tanh
  from art.utils import check_and_transform_label_format
label_desc: Use image node_id 1 to create a new CarliniLInfMethod object from inherited base classes: EvasionAttack with example: obj = CarliniLInfMethod(classifier, confidence, targeted, learning_rate, max_iter, decrease_factor, initial_const, largest_const, const_factor, batch_size, verbose)