class_docstr: Keras layer for generating achors for a given shape.
      
class_docstr_tok: ["Keras","layer","for","generating","achors","for","a","given","shape","."]
docstr: Initializer for an Anchors layer.
  
  Args
      size: The base size of the anchors to generate.
      stride: The stride of the anchors to generate.
      ratios: The ratios of the anchors to generate (defaults to AnchorParameters.default.ratios).
      scales: The scales of the anchors to generate (defaults to AnchorParameters.default.scales).
docstr_tok: ["Initializer","for","an","Anchors","layer",".","Args","size",":","The","base","size","of","the","anchors","to","generate",".","stride",":","The","stride","of","the","anchors","to","generate",".","ratios",":","The","ratios","of","the","anchors","to","generate","(","defaults","to","AnchorParameters.default.ratios",")",".","scales",":","The","scales","of","the","anchors","to","generate","(","defaults","to","AnchorParameters.default.scales",")","."]
code: def __init__(
      self, size, stride, ratios=None, scales=None, *args, **kwargs
  ):
      """Initializer for an Anchors layer.
  
      Args
          size: The base size of the anchors to generate.
          stride: The stride of the anchors to generate.
          ratios: The ratios of the anchors to generate (defaults to AnchorParameters.default.ratios).
          scales: The scales of the anchors to generate (defaults to AnchorParameters.default.scales).
      """
      self.size = size
      self.stride = stride
      self.ratios = ratios
      self.scales = scales
  
      if ratios is None:
          self.ratios = utils_anchors.AnchorParameters.default.ratios
      elif isinstance(ratios, list):
          self.ratios = np.array(ratios)
      if scales is None:
          self.scales = utils_anchors.AnchorParameters.default.scales
      elif isinstance(scales, list):
          self.scales = np.array(scales)
  
      self.num_anchors = len(self.ratios) * len(self.scales)
      self.anchors = utils_anchors.generate_anchors(
          base_size=self.size,
          ratios=self.ratios,
          scales=self.scales,
      ).astype(np.float32)
  
      super(Anchors, self).__init__(*args, **kwargs)
  
imports: import tensorflow
  from tensorflow import keras
  from ..None import backend
  from ..utils import anchors
  import numpy
label_desc: Use image node_id 1 to create a new Anchors object from inherited base classes: keras.layers with example: obj = Anchors(size, stride, ratios, scales)