class_docstr: Implementation of the Shadow Attack.
  
  | Paper link: https://arxiv.org/abs/2003.08937
class_docstr_tok: ["Implementation","of","the","Shadow","Attack",".","|","Paper","link",":","https",":","\/\/arxiv.org\/abs\/2003.08937"]
docstr: Create an instance of the :class:`.ShadowAttack`.
  
  :param estimator: A trained classifier.
  :param sigma: Standard deviation random Gaussian Noise.
  :param nb_steps: Number of SGD steps.
  :param learning_rate: Learning rate for SGD.
  :param lambda_tv: Scalar penalty weight for total variation of the perturbation.
  :param lambda_c: Scalar penalty weight for change in the mean of each color channel of the perturbation.
  :param lambda_s: Scalar penalty weight for similarity of color channels in perturbation.
  :param batch_size: The size of the training batch.
  :param targeted: True if the attack is targeted.
  :param verbose: Show progress bars.
docstr_tok: ["Create","an","instance","of","the",":","class",":","`",".ShadowAttack","`",".",":","param","estimator",":","A","trained","classifier",".",":","param","sigma",":","Standard","deviation","random","Gaussian","Noise",".",":","param","nb_steps",":","Number","of","SGD","steps",".",":","param","learning_rate",":","Learning","rate","for","SGD",".",":","param","lambda_tv",":","Scalar","penalty","weight","for","total","variation","of","the","perturbation",".",":","param","lambda_c",":","Scalar","penalty","weight","for","change","in","the","mean","of","each","color","channel","of","the","perturbation",".",":","param","lambda_s",":","Scalar","penalty","weight","for","similarity","of","color","channels","in","perturbation",".",":","param","batch_size",":","The","size","of","the","training","batch",".",":","param","targeted",":","True","if","the","attack","is","targeted",".",":","param","verbose",":","Show","progress","bars","."]
code: def __init__(
      self,
      estimator: Union[
          TensorFlowV2Classifier,
          TensorFlowV2RandomizedSmoothing,
          PyTorchClassifier,
          PyTorchRandomizedSmoothing,
      ],
      sigma: float = 0.5,
      nb_steps: int = 300,
      learning_rate: float = 0.1,
      lambda_tv: float = 0.3,
      lambda_c: float = 1.0,
      lambda_s: float = 0.5,
      batch_size: int = 400,
      targeted: bool = False,
      verbose: bool = True,
  ):
      """
      Create an instance of the :class:`.ShadowAttack`.
  
      :param estimator: A trained classifier.
      :param sigma: Standard deviation random Gaussian Noise.
      :param nb_steps: Number of SGD steps.
      :param learning_rate: Learning rate for SGD.
      :param lambda_tv: Scalar penalty weight for total variation of the perturbation.
      :param lambda_c: Scalar penalty weight for change in the mean of each color channel of the perturbation.
      :param lambda_s: Scalar penalty weight for similarity of color channels in perturbation.
      :param batch_size: The size of the training batch.
      :param targeted: True if the attack is targeted.
      :param verbose: Show progress bars.
      """
      super().__init__(estimator=estimator)
  
      self.sigma = sigma
      self.batch_size = batch_size
      self.nb_steps = nb_steps
      self.learning_rate = learning_rate
      self.lambda_tv = lambda_tv
      self.lambda_c = lambda_c
      self.lambda_s = lambda_s
      self._targeted = targeted
      self.verbose = verbose
      self._check_params()
  
      self.framework: Optional[str]
      if isinstance(
          self.estimator,
          (TensorFlowV2Classifier, TensorFlowV2RandomizedSmoothing),
      ):
          self.framework = "tensorflow"
      elif isinstance(
          self.estimator,
          (PyTorchClassifier, PyTorchRandomizedSmoothing),
      ):
          self.framework = "pytorch"
      else:
          self.framework = None
  
file_path: adversarial-robustness-toolbox/art/attacks/evasion/shadow_attack.py
imports: import logging
  from typing import Optional, Union
  import numpy
  from tqdm.auto import trange
  from art.config import ART_NUMPY_DTYPE
  from art.estimators.estimator import BaseEstimator, LossGradientsMixin
  from art.estimators.classification.classifier import ClassifierMixin
  from art.estimators.classification import TensorFlowV2Classifier, PyTorchClassifier
  from art.estimators.certification.randomized_smoothing import TensorFlowV2RandomizedSmoothing, PyTorchRandomizedSmoothing
  from art.attacks.attack import EvasionAttack
  from art.utils import get_labels_np_array, check_and_transform_label_format
label_desc: Use image node_id 1 to create a new ShadowAttack object from inherited base classes: EvasionAttack with example: obj = ShadowAttack(estimator, sigma, nb_steps, learning_rate, lambda_tv, lambda_c, lambda_s, batch_size, targeted, verbose)