class_docstr: Implementation of the EAD Attack with EN Decision Rule. [#Chen18]_
  
  Args:
      binary_search_steps : Number of steps to perform in the binary search
          over the const c.
      steps : Number of optimization steps within each binary search step.
      initial_stepsize : Initial stepsize to update the examples.
      confidence : Confidence required for an example to be marked as adversarial.
          Controls the gap between example and decision boundary.
      initial_const : Initial value of the const c with which the binary search starts.
      regularization : Controls the L1 regularization.
      decision_rule : Rule according to which the best adversarial examples are selected.
          They either minimize the L1 or ElasticNet distance.
      abort_early : Stop inner search as soons as an adversarial example has been found.
          Does not affect the binary search over the const c.
  
  References:
      .. [#Chen18] Pin-Yu Chen, Yash Sharma, Huan Zhang, Jinfeng Yi, Cho-Jui Hsieh,
      "EAD: Elastic-Net Attacks to Deep Neural Networks via Adversarial Examples",
      https://www.aaai.org/ocs/index.php/AAAI/AAAI18/paper/viewPaper/16893
class_docstr_tok: ["Implementation","of","the","EAD","Attack","with","EN","Decision","Rule",".","[","#","Chen18","]","_","Args",":","binary_search_steps",":","Number","of","steps","to","perform","in","the","binary","search","over","the","const","c.","steps",":","Number","of","optimization","steps","within","each","binary","search","step",".","initial_stepsize",":","Initial","stepsize","to","update","the","examples",".","confidence",":","Confidence","required","for","an","example","to","be","marked","as","adversarial",".","Controls","the","gap","between","example","and","decision","boundary",".","initial_const",":","Initial","value","of","the","const","c","with","which","the","binary","search","starts",".","regularization",":","Controls","the","L1","regularization",".","decision_rule",":","Rule","according","to","which","the","best","adversarial","examples","are","selected",".","They","either","minimize","the","L1","or","ElasticNet","distance",".","abort_early",":","Stop","inner","search","as","soons","as","an","adversarial","example","has","been","found",".","Does","not","affect","the","binary","search","over","the","const","c.","References",":","..","[","#","Chen18","]","Pin-Yu","Chen",",","Yash","Sharma",",","Huan","Zhang",",","Jinfeng","Yi",",","Cho-Jui","Hsieh",",","``","EAD",":","Elastic-Net","Attacks","to","Deep","Neural","Networks","via","Adversarial","Examples","''",",","https",":","\/\/www.aaai.org\/ocs\/index.php\/AAAI\/AAAI18\/paper\/viewPaper\/16893"]
code: def __init__(
      self,
      binary_search_steps: int = 9,
      steps: int = 10000,
      initial_stepsize: float = 1e-2,
      confidence: float = 0.0,
      initial_const: float = 1e-3,
      regularization: float = 1e-2,
      decision_rule: Union[Literal["EN"], Literal["L1"]] = "EN",
      abort_early: bool = True,
  ):
      if decision_rule not in ("EN", "L1"):
          raise ValueError("invalid decision rule")
  
      self.binary_search_steps = binary_search_steps
      self.steps = steps
      self.confidence = confidence
      self.initial_stepsize = initial_stepsize
      self.regularization = regularization
      self.initial_const = initial_const
      self.abort_early = abort_early
      self.decision_rule = decision_rule
  
file_path: foolbox/foolbox/attacks/ead.py
imports: from typing import Union, Tuple, Any, Optional
  from typing_extensions import Literal
  import math
  import eagerpy
  from ..models import Model
  from ..criteria import Misclassification, TargetedMisclassification
  from ..distances import l1
  from ..devutils import atleast_kd, flatten
  from .base import MinimizationAttack
  from .base import get_criterion
  from .base import T
  from .base import raise_if_kwargs
  from .base import verify_input_bounds
label_desc: Use image node_id 1 to create a new EADAttack object from inherited base classes: MinimizationAttack with example: obj = EADAttack(binary_search_steps, steps, initial_stepsize, confidence, initial_const, regularization, decision_rule, abort_early)