code: def default_regression_model(
      num_values,
      num_anchors,
      pyramid_feature_size=256,
      regression_feature_size=256,
      name="regression_submodel",
  ):
      """Creates the default regression submodel.
  
      Args
          num_values              : Number of values to regress.
          num_anchors             : Number of anchors to regress for each feature level.
          pyramid_feature_size    : The number of filters to expect from the feature pyramid levels.
          regression_feature_size : The number of filters to use in the layers in the regression submodel.
          name                    : The name of the submodel.
  
      Returns
          A keras.models.Model that predicts regression values for each anchor.
      """
      # All new conv layers except the final one in the
      # RetinaNet (classification) subnets are initialized
      # with bias b = 0 and a Gaussian weight fill with stddev = 0.01.
      options = {
          "kernel_size": 3,
          "strides": 1,
          "padding": "same",
          "kernel_initializer": keras.initializers.RandomNormal(
              mean=0.0, stddev=0.01, seed=None
          ),
          "bias_initializer": "zeros",
      }
  
      if keras.backend.image_data_format() == "channels_first":
          inputs = keras.layers.Input(
              shape=(pyramid_feature_size, None, None)
          )
      else:
          inputs = keras.layers.Input(
              shape=(None, None, pyramid_feature_size)
          )
      outputs = inputs
      for i in range(4):
          outputs = keras.layers.Conv2D(
              filters=regression_feature_size,
              activation="relu",
              name="pyramid_regression_{}".format(i),
              **options,
          )(outputs)
  
      outputs = keras.layers.Conv2D(
          num_anchors * num_values, name="pyramid_regression", **options
      )(outputs)
      if keras.backend.image_data_format() == "channels_first":
          outputs = keras.layers.Permute(
              (2, 3, 1), name="pyramid_regression_permute"
          )(outputs)
      outputs = keras.layers.Reshape(
          (-1, num_values), name="pyramid_regression_reshape"
      )(outputs)
  
      return keras.models.Model(
          inputs=inputs, outputs=outputs, name=name
      )
  
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 2 for calling a global function with example usage: default_regression_model(num_values, num_anchors, pyramid_feature_size, regression_feature_size, name) and returns: keras