code: def __build_anchors(anchor_parameters, features):
      """Builds anchors for the shape of the features from FPN.
  
      Args
          anchor_parameters : Parameteres that determine how anchors are generated.
          features          : The FPN features.
  
      Returns
          A tensor containing the anchors for the FPN features.
  
          The shape is:
          ```
          (batch_size, num_anchors, 4)
          ```
      """
      anchors = [
          layers.Anchors(
              size=anchor_parameters.sizes[i],
              stride=anchor_parameters.strides[i],
              ratios=anchor_parameters.ratios,
              scales=anchor_parameters.scales,
              name="anchors_{}".format(i),
          )(f)
          for i, f in enumerate(features)
      ]
  
      return keras.layers.Concatenate(axis=1, name="anchors")(anchors)
  
file_path: ImageAI/imageai_tf_deprecated/Detection/keras_retinanet/models/retinanet.py
imports: from tensorflow import keras
  from ..None import initializers
  from ..None import layers
  from ..utils.anchors import AnchorParameters
  from .None import assert_training_model
label_desc: Use image node_id 7 for calling a global function with example usage: __build_anchors(anchor_parameters, features) and returns: keras