class_docstr: The elastic net attack of Pin-Yu Chen et al. (2018).
  
  | Paper link: https://arxiv.org/abs/1709.04114
docstr: Create an ElasticNet 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 binary_search_steps: Number of times to adjust constant with binary search (positive value).
  :param max_iter: The maximum number of iterations.
  :param beta: Hyperparameter trading off L2 minimization for L1 minimization.
  :param initial_const: The initial trade-off constant `c` to use to tune the relative importance of distance
         and confidence. If `binary_search_steps` is large, the initial constant is not important, as discussed in
         Carlini and Wagner (2016).
  :param batch_size: Internal size of batches on which adversarial samples are generated.
  :param decision_rule: Decision rule. 'EN' means Elastic Net rule, 'L1' means L1 rule, 'L2' means L2 rule.
  :param verbose: Show progress bars.
docstr_tok: ["Create","an","ElasticNet","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","binary_search_steps",":","Number","of","times","to","adjust","constant","with","binary","search","(","positive","value",")",".",":","param","max_iter",":","The","maximum","number","of","iterations",".",":","param","beta",":","Hyperparameter","trading","off","L2","minimization","for","L1","minimization",".",":","param","initial_const",":","The","initial","trade-off","constant","`","c","`","to","use","to","tune","the","relative","importance","of","distance","and","confidence",".","If","`","binary_search_steps","`","is","large",",","the","initial","constant","is","not","important",",","as","discussed","in","Carlini","and","Wagner","(","2016",")",".",":","param","batch_size",":","Internal","size","of","batches","on","which","adversarial","samples","are","generated",".",":","param","decision_rule",":","Decision","rule",".","'EN","'","means","Elastic","Net","rule",",","'L1","'","means","L1","rule",",","'L2","'","means","L2","rule",".",":","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 = 1e-2,
      binary_search_steps: int = 9,
      max_iter: int = 100,
      beta: float = 1e-3,
      initial_const: float = 1e-3,
      batch_size: int = 1,
      decision_rule: str = "EN",
      verbose: bool = True,
  ) -> None:
      """
      Create an ElasticNet 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 binary_search_steps: Number of times to adjust constant with binary search (positive value).
      :param max_iter: The maximum number of iterations.
      :param beta: Hyperparameter trading off L2 minimization for L1 minimization.
      :param initial_const: The initial trade-off constant `c` to use to tune the relative importance of distance
             and confidence. If `binary_search_steps` is large, the initial constant is not important, as discussed in
             Carlini and Wagner (2016).
      :param batch_size: Internal size of batches on which adversarial samples are generated.
      :param decision_rule: Decision rule. 'EN' means Elastic Net rule, 'L1' means L1 rule, 'L2' means L2 rule.
      :param verbose: Show progress bars.
      """
      super().__init__(estimator=classifier)
      self.confidence = confidence
      self._targeted = targeted
      self.learning_rate = learning_rate
      self.binary_search_steps = binary_search_steps
      self.max_iter = max_iter
      self.beta = beta
      self.initial_const = initial_const
      self.batch_size = batch_size
      self.decision_rule = decision_rule
      self.verbose = verbose
      self._check_params()
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import Optional, Tuple, TYPE_CHECKING
  import numpy
  import six
  from tqdm.auto import trange
  from art.config import ART_NUMPY_DTYPE
  from art.attacks.attack import EvasionAttack
  from art.estimators.estimator import BaseEstimator
  from art.estimators.classification.classifier import ClassGradientsMixin
  from art.utils import compute_success, get_labels_np_array, check_and_transform_label_format
label_desc: Use image node_id 1 to create a new ElasticNet object from inherited base classes: EvasionAttack with example: obj = ElasticNet(classifier, confidence, targeted, learning_rate, binary_search_steps, max_iter, beta, initial_const, batch_size, decision_rule, verbose)