class_docstr: Implements the Sign-OPT attack `SignOPTAttack`. This is a query-efficient
  hard-label adversarial attack.
  
  Paper link: https://arxiv.org/pdf/1909.10773.pdf
docstr: Create a Sign_OPT attack instance.
  
  :param estimator: A trained classifier.
  :param targeted: Should the attack target one specific class.
  :param epsilon: A very small smoothing parameter.
  :param num_trial: A number of trials to calculate a good starting point
  :param max_iter: Maximum number of iterations.
      Default value is for untargeted attack, increase to recommended 5000 for targeted attacks.
  :param query_limit: Limitation for number of queries to prediction model.
      Default value is for untargeted attack, increase to recommended 40000 for targeted attacks.
  :param k: Number of random directions (for estimating the gradient)
  :param alpha: The step length for line search
  :param beta: The tolerance for line search
  :param batch_size: The size of the batch used by the estimator during inference.
  :param verbose: Show detailed information
  :param eval_perform: Evaluate performance with Avg. L2 and Success Rate with randomly choosing 100 samples
docstr_tok: ["Create","a","Sign_OPT","attack","instance",".",":","param","estimator",":","A","trained","classifier",".",":","param","targeted",":","Should","the","attack","target","one","specific","class",".",":","param","epsilon",":","A","very","small","smoothing","parameter",".",":","param","num_trial",":","A","number","of","trials","to","calculate","a","good","starting","point",":","param","max_iter",":","Maximum","number","of","iterations",".","Default","value","is","for","untargeted","attack",",","increase","to","recommended","5000","for","targeted","attacks",".",":","param","query_limit",":","Limitation","for","number","of","queries","to","prediction","model",".","Default","value","is","for","untargeted","attack",",","increase","to","recommended","40000","for","targeted","attacks",".",":","param","k",":","Number","of","random","directions","(","for","estimating","the","gradient",")",":","param","alpha",":","The","step","length","for","line","search",":","param","beta",":","The","tolerance","for","line","search",":","param","batch_size",":","The","size","of","the","batch","used","by","the","estimator","during","inference",".",":","param","verbose",":","Show","detailed","information",":","param","eval_perform",":","Evaluate","performance","with","Avg",".","L2","and","Success","Rate","with","randomly","choosing","100","samples"]
code: def __init__(
      self,
      estimator: "CLASSIFIER_TYPE",
      targeted: bool = True,
      epsilon: float = 0.001,
      num_trial: int = 100,
      max_iter: int = 1000,
      query_limit: int = 20000,
      k: int = 200,
      alpha: float = 0.2,
      beta: float = 0.001,
      eval_perform: bool = False,
      batch_size: int = 64,
      verbose: bool = False,
  ) -> None:
      """
      Create a Sign_OPT attack instance.
  
      :param estimator: A trained classifier.
      :param targeted: Should the attack target one specific class.
      :param epsilon: A very small smoothing parameter.
      :param num_trial: A number of trials to calculate a good starting point
      :param max_iter: Maximum number of iterations.
          Default value is for untargeted attack, increase to recommended 5000 for targeted attacks.
      :param query_limit: Limitation for number of queries to prediction model.
          Default value is for untargeted attack, increase to recommended 40000 for targeted attacks.
      :param k: Number of random directions (for estimating the gradient)
      :param alpha: The step length for line search
      :param beta: The tolerance for line search
      :param batch_size: The size of the batch used by the estimator during inference.
      :param verbose: Show detailed information
      :param eval_perform: Evaluate performance with Avg. L2 and Success Rate with randomly choosing 100 samples
      """
  
      super().__init__(estimator=estimator)
      self.targeted = targeted
      self.epsilon = epsilon
      self.num_trial = num_trial
      self.max_iter = max_iter
      self.query_limit = query_limit
  
      self.k = k
      self.alpha = alpha
      self.beta = beta
  
      self.batch_size = batch_size
      self.verbose = verbose
  
      self.eval_perform = eval_perform
      if eval_perform:
          self.logs = np.zeros(100)
      if self.estimator.clip_values is not None:
          self.clip_min, self.clip_max = self.estimator.clip_values
          self.enable_clipped = True
      else:
          self.enable_clipped = False
      self._check_params()
  
imports: import logging
  from typing import Optional, TYPE_CHECKING, Tuple
  import time
  import numpy
  from tqdm.auto import tqdm
  from art.attacks.attack import EvasionAttack
  from art.config import ART_NUMPY_DTYPE
  from art.estimators.estimator import BaseEstimator
  from art.estimators.classification.classifier import ClassifierMixin
  from art.utils import compute_success, check_and_transform_label_format, get_labels_np_array
label_desc: Use image node_id 1 to create a new SignOPTAttack object from inherited base classes: EvasionAttack with example: obj = SignOPTAttack(estimator, targeted, epsilon, num_trial, max_iter, query_limit, k, alpha, beta, eval_perform, batch_size, verbose)