code: def __init__(
      self,
      anchors,
      max_grid,
      batch_size,
      warmup_batches,
      ignore_thresh,
      grid_scale,
      obj_scale,
      noobj_scale,
      xywh_scale,
      class_scale,
      **kwargs,
  ):
      # make the model settings persistent
      self.ignore_thresh = ignore_thresh
      self.warmup_batches = warmup_batches
      self.anchors = tf.constant(
          anchors, dtype="float", shape=[1, 1, 1, 3, 2]
      )
      self.grid_scale = grid_scale
      self.obj_scale = obj_scale
      self.noobj_scale = noobj_scale
      self.xywh_scale = xywh_scale
      self.class_scale = class_scale
  
      # make a persistent mesh grid
      max_grid_h, max_grid_w = max_grid
  
      cell_x = tf.cast(
          tf.reshape(
              tf.tile(tf.range(max_grid_w), [max_grid_h]),
              (1, max_grid_h, max_grid_w, 1, 1),
          ),
          dtype=tf.float32,
      )
      cell_y = tf.transpose(cell_x, (0, 2, 1, 3, 4))
      self.cell_grid = tf.tile(
          tf.concat([cell_x, cell_y], -1), [batch_size, 1, 1, 3, 1]
      )
  
      super(YoloLayer, self).__init__(**kwargs)
  
imports: from tensorflow.keras.layers import Conv2D, MaxPool2D, Add, ZeroPadding2D, UpSampling2D, Concatenate, LeakyReLU, Lambda
  from tensorflow.keras.layers import LeakyReLU
  from tensorflow.keras.layers import BatchNormalization
  from tensorflow.keras.regularizers import l2
  from tensorflow.keras.models import Model
  from tensorflow.keras import Input
  from tensorflow.keras.layers import add, concatenate
  from tensorflow.keras.layers import Layer
  import tensorflow
label_desc: Use image node_id 1 to create a new YoloLayer object from inherited base classes: Layer with example: obj = YoloLayer(anchors, max_grid, batch_size, warmup_batches, ignore_thresh, grid_scale, obj_scale, noobj_scale, xywh_scale, class_scale)