code: def EfficientNet(
      width_coefficient,
      depth_coefficient,
      default_resolution,
      dropout_rate=0.2,
      drop_connect_rate=0.2,
      depth_divisor=8,
      blocks_args=DEFAULT_BLOCKS_ARGS,
      model_name="efficientnet",
      include_top=True,
      weights="imagenet",
      input_tensor=None,
      input_shape=None,
      pooling=None,
      classes=1000,
      **kwargs,
  ):
      """Instantiates the EfficientNet architecture using given scaling coefficients.
      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.
          default_resolution: int, default input image size.
          dropout_rate: float, dropout rate before final classifier layer.
          drop_connect_rate: float, dropout rate at skip connections.
          depth_divisor: int.
          blocks_args: A list of BlockArgs to construct block modules.
          model_name: string, model name.
          include_top: whether to include the fully-connected
              layer at the top of the network.
          weights: one of `None` (random initialization),
                'imagenet' (pre-training on ImageNet),
                or the path to the weights file to be loaded.
          input_tensor: optional Keras tensor
              (i.e. output of `layers.Input()`)
              to use as image input for the model.
          input_shape: optional shape tuple, only to be specified
              if `include_top` is False.
              It should have exactly 3 inputs channels.
          pooling: optional pooling mode for feature extraction
              when `include_top` is `False`.
              - `None` means that the output of the model will be
                  the 4D tensor output of the
                  last convolutional layer.
              - `avg` means that global average pooling
                  will be applied to the output of the
                  last convolutional layer, and thus
                  the output of the model will be a 2D tensor.
              - `max` means that global max pooling will
                  be applied.
          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.
      # Raises
          ValueError: in case of invalid argument for `weights`,
              or invalid input shape.
      """
      global backend, layers, models, keras_utils
      backend, layers, models, keras_utils = get_submodules_from_kwargs(
          kwargs
      )
  
      if not (
          weights in {"imagenet", "noisy-student", None}
          or os.path.exists(weights)
      ):
          raise ValueError(
              "The `weights` argument should be either "
              "`None` (random initialization), `imagenet` "
              "(pre-training on ImageNet), "
              "or the path to the weights file to be loaded."
          )
  
      if weights == "imagenet" and include_top and classes != 1000:
          raise ValueError(
              'If using `weights` as `"imagenet"` with `include_top`'
              " as true, `classes` should be 1000"
          )
  
      # Determine proper input shape
      input_shape = _obtain_input_shape(
          input_shape,
          default_size=default_resolution,
          min_size=32,
          data_format=backend.image_data_format(),
          require_flatten=include_top,
          weights=weights,
      )
  
      if input_tensor is None:
          img_input = layers.Input(shape=input_shape)
      else:
          if backend.backend() == "tensorflow":
              from tensorflow.python.keras.backend import (
                  is_keras_tensor,
              )
          else:
              is_keras_tensor = backend.is_keras_tensor
          if not is_keras_tensor(input_tensor):
              img_input = layers.Input(
                  tensor=input_tensor, shape=input_shape
              )
          else:
              img_input = input_tensor
  
      bn_axis = (
          3 if backend.image_data_format() == "channels_last" else 1
      )
      activation = get_swish(**kwargs)
  
      # Build stem
      x = img_input
      x = layers.Conv2D(
          round_filters(32, width_coefficient, depth_divisor),
          3,
          strides=(2, 2),
          padding="same",
          use_bias=False,
          kernel_initializer=CONV_KERNEL_INITIALIZER,
          name="stem_conv",
      )(x)
      x = layers.BatchNormalization(axis=bn_axis, name="stem_bn")(x)
      x = layers.Activation(activation, name="stem_activation")(x)
  
      # Build blocks
      num_blocks_total = sum(
          round_repeats(block_args.num_repeat, depth_coefficient)
          for block_args in blocks_args
      )
      block_num = 0
      for idx, block_args in enumerate(blocks_args):
          assert block_args.num_repeat > 0
          # Update block input and output filters based on depth multiplier.
          block_args = block_args._replace(
              input_filters=round_filters(
                  block_args.input_filters,
                  width_coefficient,
                  depth_divisor,
              ),
              output_filters=round_filters(
                  block_args.output_filters,
                  width_coefficient,
                  depth_divisor,
              ),
              num_repeat=round_repeats(
                  block_args.num_repeat, depth_coefficient
              ),
          )
  
          # The first block needs to take care of stride and filter size increase.
          drop_rate = (
              drop_connect_rate * float(block_num) / num_blocks_total
          )
          x = mb_conv_block(
              x,
              block_args,
              activation=activation,
              drop_rate=drop_rate,
              prefix="block{}a_".format(idx + 1),
          )
          block_num += 1
          if block_args.num_repeat > 1:
              # pylint: disable=protected-access
              block_args = block_args._replace(
                  input_filters=block_args.output_filters,
                  strides=[1, 1],
              )
              # pylint: enable=protected-access
              for bidx in xrange(block_args.num_repeat - 1):
                  drop_rate = (
                      drop_connect_rate
                      * float(block_num)
                      / num_blocks_total
                  )
                  block_prefix = "block{}{}_".format(
                      idx + 1, string.ascii_lowercase[bidx + 1]
                  )
                  x = mb_conv_block(
                      x,
                      block_args,
                      activation=activation,
                      drop_rate=drop_rate,
                      prefix=block_prefix,
                  )
                  block_num += 1
  
      # Build top
      x = layers.Conv2D(
          round_filters(1280, width_coefficient, depth_divisor),
          1,
          padding="same",
          use_bias=False,
          kernel_initializer=CONV_KERNEL_INITIALIZER,
          name="top_conv",
      )(x)
      x = layers.BatchNormalization(axis=bn_axis, 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 and dropout_rate > 0:
              x = layers.Dropout(dropout_rate, name="top_dropout")(x)
          x = layers.Dense(
              classes,
              activation="softmax",
              kernel_initializer=DENSE_KERNEL_INITIALIZER,
              name="probs",
          )(x)
      else:
          if pooling == "avg":
              x = layers.GlobalAveragePooling2D(name="avg_pool")(x)
          elif pooling == "max":
              x = layers.GlobalMaxPooling2D(name="max_pool")(x)
  
      # Ensure that the model takes into account
      # any potential predecessors of `input_tensor`.
      if input_tensor is not None:
          inputs = keras_utils.get_source_inputs(input_tensor)
      else:
          inputs = img_input
  
      # Create model.
      model = models.Model(inputs, x, name=model_name)
  
      # Load weights.
      if weights == "imagenet":
          if include_top:
              file_name = (
                  model_name
                  + "_weights_tf_dim_ordering_tf_kernels_autoaugment.h5"
              )
              file_hash = IMAGENET_WEIGHTS_HASHES[model_name][0]
          else:
              file_name = (
                  model_name
                  + "_weights_tf_dim_ordering_tf_kernels_autoaugment_notop.h5"
              )
              file_hash = IMAGENET_WEIGHTS_HASHES[model_name][1]
          weights_path = keras_utils.get_file(
              file_name,
              IMAGENET_WEIGHTS_PATH + file_name,
              cache_subdir="models",
              file_hash=file_hash,
          )
          model.load_weights(weights_path)
  
      elif weights == "noisy-student":
          if include_top:
              file_name = "{}_{}.h5".format(model_name, weights)
              file_hash = NS_WEIGHTS_HASHES[model_name][0]
          else:
              file_name = "{}_{}_notop.h5".format(model_name, weights)
              file_hash = NS_WEIGHTS_HASHES[model_name][1]
          weights_path = keras_utils.get_file(
              file_name,
              NS_WEIGHTS_PATH + file_name,
              cache_subdir="models",
              file_hash=file_hash,
          )
          model.load_weights(weights_path)
  
      elif weights is not None:
          model.load_weights(weights)
  
      return model
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import math
  import string
  import collections
  from six.moves import xrange
  from keras_applications.imagenet_utils import _obtain_input_shape
  from keras_applications.imagenet_utils import preprocess_input
  from .None import get_submodules_from_kwargs
  from .weights import IMAGENET_WEIGHTS_PATH, IMAGENET_WEIGHTS_HASHES, NS_WEIGHTS_HASHES, NS_WEIGHTS_PATH
label_desc: Use image node_id 7 for calling a global function with example usage: EfficientNet(width_coefficient, depth_coefficient, default_resolution, dropout_rate, drop_connect_rate, depth_divisor, blocks_args, model_name, include_top, weights, input_tensor, input_shape, pooling, classes) and returns: model