code: def __init__(
      self, in_channel, out_channel, stride, expand_ratio, **kwargs
  ):
      super(InvertedResidual, self).__init__(**kwargs)
      self.hidden_channel = in_channel * expand_ratio
      self.use_shortcut = stride == 1 and in_channel == out_channel
  
      layer_list = []
      if expand_ratio != 1:
          # 1x1 pointwise conv
          layer_list.append(
              ConvBNReLU(
                  out_channel=self.hidden_channel,
                  kernel_size=1,
                  name="expand",
              )
          )
      layer_list.extend(
          [
              # 3x3 depthwise conv
              layers.DepthwiseConv2D(
                  kernel_size=3,
                  padding="SAME",
                  strides=stride,
                  use_bias=False,
                  name="depthwise",
              ),
              layers.BatchNormalization(
                  momentum=0.9, epsilon=1e-5, name="depthwise/BatchNorm"
              ),
              layers.ReLU(max_value=6.0),
              # 1x1 pointwise conv(linear)
              layers.Conv2D(
                  filters=out_channel,
                  kernel_size=1,
                  strides=1,
                  padding="SAME",
                  use_bias=False,
                  name="project",
              ),
              layers.BatchNormalization(
                  momentum=0.9, epsilon=1e-5, name="project/BatchNorm"
              ),
          ]
      )
      self.main_branch = Sequential(layer_list, name="expanded_conv")
  
file_path: deep-learning-for-image-processing/tensorflow_classification/ConfusionMatrix/model.py
imports: from tensorflow.keras import layers, Model, Sequential
label_desc: Use image node_id 1 to create a new InvertedResidual object from inherited base classes: layers with example: obj = InvertedResidual(in_channel, out_channel, stride, expand_ratio)