code: def efficient_net(
      width_coefficient,
      depth_coefficient,
      input_shape=(224, 224, 3),
      dropout_rate=0.2,
      drop_connect_rate=0.2,
      activation="swish",
      model_name="efficientnet",
      include_top=True,
      num_classes=1000,
  ):
      """Instantiates the EfficientNet architecture using given scaling coefficients.
  
      Reference:
      - [EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks](
          https://arxiv.org/abs/1905.11946) (ICML 2019)
  
      Optionally loads weights pre-trained on ImageNet.
      Note that the data format convention used by the model is
      the one specified in your Keras config at `~/.keras/keras.json`.
  
      Arguments:
        width_coefficient: float, scaling coefficient for network width.
        depth_coefficient: float, scaling coefficient for network depth.
        input_shape: tuple, default input image shape(not including the batch size).
        dropout_rate: float, dropout rate before final classifier layer.
        drop_connect_rate: float, dropout rate at skip connections.
        activation: activation function.
        model_name: string, model name.
        include_top: whether to include the fully-connected
            layer at the top of the network.
        num_classes: optional number of classes to classify images
            into, only to be specified if `include_top` is True, and
            if no `weights` argument is specified.
  
      Returns:
        A `keras.Model` instance.
      """
  
      # kernel_size, repeats, in_channel, out_channel, exp_ratio, strides, SE
      block_args = [
          [3, 1, 32, 16, 1, 1, True],
          [3, 2, 16, 24, 6, 2, True],
          [5, 2, 24, 40, 6, 2, True],
          [3, 3, 40, 80, 6, 2, True],
          [5, 3, 80, 112, 6, 1, True],
          [5, 4, 112, 192, 6, 2, True],
          [3, 1, 192, 320, 6, 1, True],
      ]
  
      def round_filters(filters, divisor=8):
          """Round number of filters based on depth multiplier."""
          filters *= width_coefficient
          new_filters = max(
              divisor, int(filters + divisor / 2) // divisor * divisor
          )
          # Make sure that round down does not go down by more than 10%.
          if new_filters < 0.9 * filters:
              new_filters += divisor
          return int(new_filters)
  
      def round_repeats(repeats):
          """Round number of repeats based on depth multiplier."""
          return int(math.ceil(depth_coefficient * repeats))
  
      img_input = layers.Input(shape=input_shape)
  
      # data preprocessing
      x = layers.experimental.preprocessing.Rescaling(1.0 / 255.0)(
          img_input
      )
      x = layers.experimental.preprocessing.Normalization()(x)
  
      # first conv2d
      x = layers.ZeroPadding2D(
          padding=correct_pad(input_shape[:2], 3), name="stem_conv_pad"
      )(x)
      x = layers.Conv2D(
          filters=round_filters(32),
          kernel_size=3,
          strides=2,
          padding="valid",
          use_bias=False,
          kernel_initializer=CONV_KERNEL_INITIALIZER,
          name="stem_conv",
      )(x)
      x = layers.BatchNormalization(name="stem_bn")(x)
      x = layers.Activation(activation, name="stem_activation")(x)
  
      # build blocks
      b = 0
      num_blocks = float(sum(round_repeats(i[1]) for i in block_args))
      for i, args in enumerate(block_args):
          assert args[1] > 0
          # Update block input and output filters based on depth multiplier.
          args[2] = round_filters(args[2])  # input_channel
          args[3] = round_filters(args[3])  # output_channel
  
          for j in range(round_repeats(args[1])):
              x = block(
                  x,
                  activation=activation,
                  drop_rate=drop_connect_rate * b / num_blocks,
                  name="block{}{}_".format(i + 1, chr(j + 97)),
                  kernel_size=args[0],
                  input_channel=args[2] if j == 0 else args[3],
                  output_channel=args[3],
                  expand_ratio=args[4],
                  strides=args[5] if j == 0 else 1,
                  use_se=args[6],
              )
              b += 1
  
      # build top
      x = layers.Conv2D(
          round_filters(1280),
          kernel_size=1,
          padding="same",
          use_bias=False,
          kernel_initializer=CONV_KERNEL_INITIALIZER,
          name="top_conv",
      )(x)
      x = layers.BatchNormalization(name="top_bn")(x)
      x = layers.Activation(activation, name="top_activation")(x)
      if include_top:
          x = layers.GlobalAveragePooling2D(name="avg_pool")(x)
          if dropout_rate > 0:
              x = layers.Dropout(dropout_rate, name="top_dropout")(x)
          x = layers.Dense(
              units=num_classes,
              activation="softmax",
              kernel_initializer=DENSE_KERNEL_INITIALIZER,
              name="predictions",
          )(x)
  
      model = Model(img_input, x, name=model_name)
  
      return model
  
file_path: deep-learning-for-image-processing/tensorflow_classification/Test9_efficientNet/model.py
imports: import math
  from typing import Union
  from tensorflow.keras import layers, Model
label_desc: Use image node_id 3 for calling a global function with example usage: efficient_net(width_coefficient, depth_coefficient, input_shape, dropout_rate, drop_connect_rate, activation, model_name, include_top, num_classes) and returns: model, int, int