class_docstr: InvertedResidual for mobilenet
  
  Args:
  ----
      conf: configuration object for inverted residual
code: def __init__(
      self,
      conf: InvertedResidualConfig,
      **kwargs: Any,
  ) -> None:
      _kwargs = (
          {"input_shape": kwargs.pop("input_shape")}
          if isinstance(kwargs.get("input_shape"), tuple)
          else {}
      )
      super().__init__(**kwargs)
  
      act_fn = hard_swish if conf.use_hs else tf.nn.relu
  
      _is_s1 = (
          isinstance(conf.stride, tuple) and conf.stride == (1, 1)
      ) or conf.stride == 1
      self.use_res_connect = (
          _is_s1 and conf.input_channels == conf.out_channels
      )
  
      _layers = []
      # expand
      if conf.expanded_channels != conf.input_channels:
          _layers.extend(
              conv_sequence(
                  conf.expanded_channels,
                  act_fn,
                  kernel_size=1,
                  bn=True,
                  **_kwargs,
              )
          )
  
      # depth-wise
      _layers.extend(
          conv_sequence(
              conf.expanded_channels,
              act_fn,
              kernel_size=conf.kernel,
              strides=conf.stride,
              bn=True,
              groups=conf.expanded_channels,
          )
      )
  
      if conf.use_se:
          _layers.append(SqueezeExcitation(conf.expanded_channels))
  
      # project
      _layers.extend(
          conv_sequence(
              conf.out_channels,
              None,
              kernel_size=1,
              bn=True,
          )
      )
  
      self.block = Sequential(_layers)
  
imports: from copy import deepcopy
  from typing import Any, Dict, List, Optional, Tuple, Union
  import tensorflow
  from tensorflow.keras import layers
  from tensorflow.keras.models import Sequential
  from ....datasets import VOCABS
  from ...utils import conv_sequence, load_pretrained_params
label_desc: Use image node_id 1 to create a new InvertedResidual object from inherited base classes: layers with example: obj = InvertedResidual(conf)