code: def __init__(
      self,
      width_coefficient: float,
      depth_coefficient: float,
      num_classes: int = 1000,
      dropout_rate: float = 0.2,
      drop_connect_rate: float = 0.2,
      block: Optional[Callable[..., nn.Module]] = None,
      norm_layer: Optional[Callable[..., nn.Module]] = None,
  ):
      super(EfficientNet, self).__init__()
  
      # kernel_size, in_channel, out_channel, exp_ratio, strides, use_SE, drop_connect_rate, repeats
      default_cnf = [
          [3, 32, 16, 1, 1, True, drop_connect_rate, 1],
          [3, 16, 24, 6, 2, True, drop_connect_rate, 2],
          [5, 24, 40, 6, 2, True, drop_connect_rate, 2],
          [3, 40, 80, 6, 2, True, drop_connect_rate, 3],
          [5, 80, 112, 6, 1, True, drop_connect_rate, 3],
          [5, 112, 192, 6, 2, True, drop_connect_rate, 4],
          [3, 192, 320, 6, 1, True, drop_connect_rate, 1],
      ]
  
      def round_repeats(repeats):
          """Round number of repeats based on depth multiplier."""
          return int(math.ceil(depth_coefficient * repeats))
  
      if block is None:
          block = InvertedResidual
  
      if norm_layer is None:
          norm_layer = partial(nn.BatchNorm2d, eps=1e-3, momentum=0.1)
  
      adjust_channels = partial(
          InvertedResidualConfig.adjust_channels,
          width_coefficient=width_coefficient,
      )
  
      # build inverted_residual_setting
      bneck_conf = partial(
          InvertedResidualConfig, width_coefficient=width_coefficient
      )
  
      b = 0
      num_blocks = float(sum(round_repeats(i[-1]) for i in default_cnf))
      inverted_residual_setting = []
      for stage, args in enumerate(default_cnf):
          cnf = copy.copy(args)
          for i in range(round_repeats(cnf.pop(-1))):
              if i > 0:
                  # strides equal 1 except first cnf
                  cnf[-3] = 1  # strides
                  cnf[1] = cnf[2]  # input_channel equal output_channel
  
              cnf[-1] = (
                  args[-2] * b / num_blocks
              )  # update dropout ratio
              index = str(stage + 1) + chr(i + 97)  # 1a, 2a, 2b, ...
              inverted_residual_setting.append(bneck_conf(*cnf, index))
              b += 1
  
      # create layers
      layers = OrderedDict()
  
      # first conv
      layers.update(
          {
              "stem_conv": ConvBNActivation(
                  in_planes=3,
                  out_planes=adjust_channels(32),
                  kernel_size=3,
                  stride=2,
                  norm_layer=norm_layer,
              )
          }
      )
  
      # building inverted residual blocks
      for cnf in inverted_residual_setting:
          layers.update({cnf.index: block(cnf, norm_layer)})
  
      # build top
      last_conv_input_c = inverted_residual_setting[-1].out_c
      last_conv_output_c = adjust_channels(1280)
      layers.update(
          {
              "top": ConvBNActivation(
                  in_planes=last_conv_input_c,
                  out_planes=last_conv_output_c,
                  kernel_size=1,
                  norm_layer=norm_layer,
              )
          }
      )
  
      self.features = nn.Sequential(layers)
      self.avgpool = nn.AdaptiveAvgPool2d(1)
  
      classifier = []
      if dropout_rate > 0:
          classifier.append(nn.Dropout(p=dropout_rate, inplace=True))
      classifier.append(nn.Linear(last_conv_output_c, num_classes))
      self.classifier = nn.Sequential(*classifier)
  
      # initial weights
      for m in self.modules():
          if isinstance(m, nn.Conv2d):
              nn.init.kaiming_normal_(m.weight, mode="fan_out")
              if m.bias is not None:
                  nn.init.zeros_(m.bias)
          elif isinstance(m, nn.BatchNorm2d):
              nn.init.ones_(m.weight)
              nn.init.zeros_(m.bias)
          elif isinstance(m, nn.Linear):
              nn.init.normal_(m.weight, 0, 0.01)
              nn.init.zeros_(m.bias)
  
imports: import math
  import copy
  from functools import partial
  from collections import OrderedDict
  from typing import Optional, Callable
  import torch
  import torch.nn
  from torch import Tensor
  from torch.nn import functional
label_desc: Use image node_id 1 to create a new EfficientNet object from inherited base classes: nn with example: obj = EfficientNet(width_coefficient, depth_coefficient, num_classes, dropout_rate, drop_connect_rate, block, norm_layer)