class_docstr: Adversarially chosen rotations and translations. [#Engs]
  This implementation is based on the reference implementation by
  Madry et al.: https://github.com/MadryLab/adversarial_spatial
  
  References:
  .. [#Engs] Logan Engstrom*, Brandon Tran*, Dimitris Tsipras*,
         Ludwig Schmidt, Aleksander Mądry: "A Rotation and a
         Translation Suffice: Fooling CNNs with Simple Transformations",
         http://arxiv.org/abs/1712.02779
class_docstr_tok: ["Adversarially","chosen","rotations","and","translations",".","[","#","Engs","]","This","implementation","is","based","on","the","reference","implementation","by","Madry","et","al",".",":","https",":","\/\/github.com\/MadryLab\/adversarial_spatial","References",":","..","[","#","Engs","]","Logan","Engstrom","*",",","Brandon","Tran","*",",","Dimitris","Tsipras","*",",","Ludwig","Schmidt",",","Aleksander","M\u0105dry",":","``","A","Rotation","and","a","Translation","Suffice",":","Fooling","CNNs","with","Simple","Transformations","''",",","http",":","\/\/arxiv.org\/abs\/1712.02779"]
code: def __init__(
      self,
      max_translation: float = 3,
      max_rotation: float = 30,
      num_translations: int = 5,
      num_rotations: int = 5,
      grid_search: bool = True,
      random_steps: int = 100,
  ):
      self.max_trans = max_translation
      self.max_rot = max_rotation
  
      self.grid_search = grid_search
  
      # grid search true
      self.num_trans = num_translations
      self.num_rots = num_rotations
  
      # grid search false
      self.random_steps = random_steps
  
file_path: foolbox/foolbox/attacks/spatial_attack.py
imports: from typing import Union, Any, Tuple, Generator
  import eagerpy
  import numpy
  from ..devutils import atleast_kd
  from ..criteria import Criterion
  from .base import Model
  from .base import T
  from .base import get_is_adversarial
  from .base import get_criterion
  from .base import Attack
  from .spatial_attack_transformations import rotate_and_shift
  from .base import raise_if_kwargs
  from .base import verify_input_bounds
label_desc: Use image node_id 1 to create a new SpatialAttack object from inherited base classes: Attack with example: obj = SpatialAttack(max_translation, max_rotation, num_translations, num_rotations, grid_search, random_steps)