class_docstr: Implementation of the spatial transformation attack using translation and rotation of inputs. The attack conducts
  black-box queries to the target model in a grid search over possible translations and rotations to find optimal
  attack parameters.
  
  | Paper link: https://arxiv.org/abs/1712.02779
docstr: :param classifier: A trained classifier.
  :param max_translation: The maximum translation in any direction as percentage of image size. The value is
         expected to be in the range `[0, 100]`.
  :param num_translations: The number of translations to search on grid spacing per direction.
  :param max_rotation: The maximum rotation in either direction in degrees. The value is expected to be in the
         range `[0, 180]`.
  :param num_rotations: The number of rotations to search on grid spacing.
  :param verbose: Show progress bars.
docstr_tok: [":","param","classifier",":","A","trained","classifier",".",":","param","max_translation",":","The","maximum","translation","in","any","direction","as","percentage","of","image","size",".","The","value","is","expected","to","be","in","the","range","`","[","0",",","100","]","`",".",":","param","num_translations",":","The","number","of","translations","to","search","on","grid","spacing","per","direction",".",":","param","max_rotation",":","The","maximum","rotation","in","either","direction","in","degrees",".","The","value","is","expected","to","be","in","the","range","`","[","0",",","180","]","`",".",":","param","num_rotations",":","The","number","of","rotations","to","search","on","grid","spacing",".",":","param","verbose",":","Show","progress","bars","."]
code: def __init__(
      self,
      classifier: "CLASSIFIER_NEURALNETWORK_TYPE",
      max_translation: float = 0.0,
      num_translations: int = 1,
      max_rotation: float = 0.0,
      num_rotations: int = 1,
      verbose: bool = True,
  ) -> None:
      """
      :param classifier: A trained classifier.
      :param max_translation: The maximum translation in any direction as percentage of image size. The value is
             expected to be in the range `[0, 100]`.
      :param num_translations: The number of translations to search on grid spacing per direction.
      :param max_rotation: The maximum rotation in either direction in degrees. The value is expected to be in the
             range `[0, 180]`.
      :param num_rotations: The number of rotations to search on grid spacing.
      :param verbose: Show progress bars.
      """
      super().__init__(estimator=classifier)
      self.max_translation = max_translation
      self.num_translations = num_translations
      self.max_rotation = max_rotation
      self.num_rotations = num_rotations
      self.verbose = verbose
      self._check_params()
  
      self.fooling_rate: Optional[float] = None
      self.attack_trans_x: Optional[int] = None
      self.attack_trans_y: Optional[int] = None
      self.attack_rot: Optional[float] = None
  
file_path: adversarial-robustness-toolbox/art/attacks/evasion/spatial_transformation.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import Optional, TYPE_CHECKING
  import numpy
  from scipy.ndimage import rotate, shift
  from tqdm.auto import tqdm
  from art.attacks.attack import EvasionAttack
  from art.estimators.estimator import BaseEstimator, NeuralNetworkMixin
label_desc: Use image node_id 1 to create a new SpatialTransformation object from inherited base classes: EvasionAttack with example: obj = SpatialTransformation(classifier, max_translation, num_translations, max_rotation, num_rotations, verbose)