class_docstr: Implementation of the ShapeShifter attack. This is a robust physical adversarial attack on Faster R-CNN object
  detector and is developed in TensorFlow.
  
  | Paper link: https://arxiv.org/abs/1804.05810
class_docstr_tok: ["Implementation","of","the","ShapeShifter","attack",".","This","is","a","robust","physical","adversarial","attack","on","Faster","R-CNN","object","detector","and","is","developed","in","TensorFlow",".","|","Paper","link",":","https",":","\/\/arxiv.org\/abs\/1804.05810"]
docstr: Apply attack-specific checks.
docstr_tok: ["Apply","attack-specific","checks","."]
code: def _check_params(self) -> None:
      """
      Apply attack-specific checks.
      """
      if not hasattr(self.random_transform, "__call__"):
          raise ValueError(
              "The applied random transformation function must be of type Callable."
          )
  
      if not isinstance(self.box_classifier_weight, float):
          raise ValueError(
              "The weight of box classifier loss must be of type float."
          )
      if self.box_classifier_weight < 0.0:
          raise ValueError(
              "The weight of box classifier loss must be greater than or equal to 0.0."
          )
  
      if not isinstance(self.box_localizer_weight, float):
          raise ValueError(
              "The weight of box localizer loss must be of type float."
          )
      if self.box_localizer_weight < 0.0:
          raise ValueError(
              "The weight of box localizer loss must be greater than or equal to 0.0."
          )
  
      if not isinstance(self.rpn_classifier_weight, float):
          raise ValueError(
              "The weight of RPN classifier loss must be of type float."
          )
      if self.rpn_classifier_weight < 0.0:
          raise ValueError(
              "The weight of RPN classifier loss must be greater than or equal to 0.0."
          )
  
      if not isinstance(self.rpn_localizer_weight, float):
          raise ValueError(
              "The weight of RPN localizer loss must be of type float."
          )
      if self.rpn_localizer_weight < 0.0:
          raise ValueError(
              "The weight of RPN localizer loss must be greater than or equal to 0.0."
          )
  
      if not isinstance(self.box_iou_threshold, float):
          raise ValueError(
              "The box intersection over union threshold must be of type float."
          )
      if self.box_iou_threshold < 0.0:
          raise ValueError(
              "The box intersection over union threshold must be greater than or equal to 0.0."
          )
  
      if not isinstance(self.box_victim_weight, float):
          raise ValueError(
              "The weight of box victim loss must be of type float."
          )
      if self.box_victim_weight < 0.0:
          raise ValueError(
              "The weight of box victim loss must be greater than or equal to 0.0."
          )
  
      if not isinstance(self.box_target_weight, float):
          raise ValueError(
              "The weight of box target loss must be of type float."
          )
      if self.box_target_weight < 0.0:
          raise ValueError(
              "The weight of box target loss must be greater than or equal to 0.0."
          )
  
      if not isinstance(self.box_victim_cw_weight, float):
          raise ValueError(
              "The weight of box victim CW loss must be of type float."
          )
      if self.box_victim_cw_weight < 0.0:
          raise ValueError(
              "The weight of box victim CW loss must be greater than or equal to 0.0."
          )
  
      if not isinstance(self.box_victim_cw_confidence, float):
          raise ValueError(
              "The confidence of box victim CW loss must be of type float."
          )
      if self.box_victim_cw_confidence < 0.0:
          raise ValueError(
              "The confidence of box victim CW loss must be greater than or equal to 0.0."
          )
  
      if not isinstance(self.box_target_cw_weight, float):
          raise ValueError(
              "The weight of box target CW loss must be of type float."
          )
      if self.box_target_cw_weight < 0.0:
          raise ValueError(
              "The weight of box target CW loss must be greater than or equal to 0.0."
          )
  
      if not isinstance(self.box_target_cw_confidence, float):
          raise ValueError(
              "The confidence of box target CW loss must be of type float."
          )
      if self.box_target_cw_confidence < 0.0:
          raise ValueError(
              "The confidence of box target CW loss must be greater than or equal to 0.0."
          )
  
      if not isinstance(self.rpn_iou_threshold, float):
          raise ValueError(
              "The RPN intersection over union threshold must be of type float."
          )
      if self.rpn_iou_threshold < 0.0:
          raise ValueError(
              "The RPN intersection over union threshold must be greater than or equal to 0.0."
          )
  
      if not isinstance(self.rpn_background_weight, float):
          raise ValueError(
              "The weight of RPN background loss must be of type float."
          )
      if self.rpn_background_weight < 0.0:
          raise ValueError(
              "The weight of RPN background loss must be greater than or equal to 0.0."
          )
  
      if not isinstance(self.rpn_foreground_weight, float):
          raise ValueError(
              "The weight of RPN foreground loss must be of type float."
          )
      if self.rpn_foreground_weight < 0.0:
          raise ValueError(
              "The weight of RPN foreground loss must be greater than or equal to 0.0."
          )
  
      if not isinstance(self.rpn_cw_weight, float):
          raise ValueError(
              "The weight of RPN CW loss must be of type float."
          )
      if self.rpn_cw_weight < 0.0:
          raise ValueError(
              "The weight of RPN CW loss must be greater than or equal to 0.0."
          )
  
      if not isinstance(self.rpn_cw_confidence, float):
          raise ValueError(
              "The confidence of RPN CW loss must be of type float."
          )
      if self.rpn_cw_confidence < 0.0:
          raise ValueError(
              "The confidence of RPN CW loss must be greater than or equal to 0.0."
          )
  
      if not isinstance(self.similarity_weight, float):
          raise ValueError(
              "The weight of similarity loss must be of type float."
          )
      if self.similarity_weight < 0.0:
          raise ValueError(
              "The weight of similarity loss must be greater than or equal to 0.0."
          )
  
      if not isinstance(self.learning_rate, float):
          raise ValueError("The learning rate must be of type float.")
      if self.learning_rate <= 0.0:
          raise ValueError(
              "The learning rate must be greater than 0.0."
          )
  
      if self.optimizer not in [
          "RMSPropOptimizer",
          "MomentumOptimizer",
          "GradientDescentOptimizer",
          "AdamOptimizer",
      ]:
          raise ValueError(
              "Optimizer only includes one of the following choices: `GradientDescentOptimizer`, "
              "`MomentumOptimizer`, `RMSPropOptimizer`, `AdamOptimizer`."
          )
  
      if self.optimizer in ["RMSPropOptimizer", "MomentumOptimizer"]:
          if not isinstance(self.momentum, float):
              raise ValueError("The momentum must be of type float.")
          if self.momentum <= 0.0:
              raise ValueError("The momentum must be greater than 0.0.")
  
      if self.optimizer == "RMSPropOptimizer":
          if not isinstance(self.decay, float):
              raise ValueError(
                  "The learning rate decay must be of type float."
              )
          if self.decay <= 0.0:
              raise ValueError(
                  "The learning rate decay must be greater than 0.0."
              )
          if self.decay >= 1.0:
              raise ValueError(
                  "The learning rate decay must be smaller than 1.0."
              )
  
      if not isinstance(self.sign_gradients, bool):
          raise ValueError(
              "The choice of whether to use the sign of gradients for the optimization must be of type bool."
          )
  
      if not isinstance(self.random_size, int):
          raise ValueError(
              "The random sample size must be of type int."
          )
      if self.random_size <= 0:
          raise ValueError(
              "The random sample size must be greater than 0."
          )
  
      if not isinstance(self.max_iter, int):
          raise ValueError(
              "The maximum number of iterations must be of type int."
          )
      if self.max_iter <= 0:
          raise ValueError(
              "The maximum number of iterations must be greater than 0."
          )
  
      if not isinstance(self.texture_as_input, bool):
          raise ValueError(
              "The choice of whether textures are used as inputs instead of images must be of type bool."
          )
  
      if not isinstance(self.use_spectral, bool):
          raise ValueError(
              "The choice of whether to use spectral with textures must be of type bool."
          )
  
      if not isinstance(self.soft_clip, bool):
          raise ValueError(
              "The choice of whether to apply soft clipping on textures must be of type bool."
          )
  
file_path: adversarial-robustness-toolbox/art/attacks/evasion/shapeshifter.py
imports: import logging
  from typing import List, Dict, Optional, Tuple, TYPE_CHECKING
  import numpy
  from art.attacks.attack import EvasionAttack
  from art.estimators.object_detection.tensorflow_faster_rcnn import TensorFlowFasterRCNN
label_desc: Use image node_id 11 for calling the ShapeShifter obj's underlying member method code with example usage: obj._check_params() without return types