class_docstr: @inproceedings{Yulitehrnet21,
  title={Lite-HRNet: A Lightweight High-Resolution Network},
      author={Yu, Changqian and Xiao, Bin and Gao, Changxin and Yuan, Lu and Zhang, Lei and Sang, Nong and Wang, Jingdong},
      booktitle={CVPR},year={2021}
  }
  Args:
      network_type (str): the network_type should be one of ["lite_18", "lite_30", "naive", "wider_naive"],
          "naive": Simply combining the shuffle block in ShuffleNet and the highresolution design pattern in HRNet.
          "wider_naive": Naive network with wider channels in each block.
          "lite_18": Lite-HRNet-18, which replaces the pointwise convolution in a shuffle block by conditional channel weighting.
          "lite_30": Lite-HRNet-30, with more blocks compared with Lite-HRNet-18.
      freeze_at (int): the stage to freeze
      freeze_norm (bool): whether to freeze norm in HRNet
      norm_decay (float): weight decay for normalization layer weights
      return_idx (List): the stage to return
class_docstr_tok: ["@","inproceedings","{","Yulitehrnet21",",","title=","{","Lite-HRNet",":","A","Lightweight","High-Resolution","Network","}",",","author=","{","Yu",",","Changqian","and","Xiao",",","Bin","and","Gao",",","Changxin","and","Yuan",",","Lu","and","Zhang",",","Lei","and","Sang",",","Nong","and","Wang",",","Jingdong","}",",","booktitle=","{","CVPR","}",",","year=","{","2021","}","}","Args",":","network_type","(","str",")",":","the","network_type","should","be","one","of","[","``","lite_18","''",",","``","lite_30","''",",","``","naive","''",",","``","wider_naive","''","]",",","``","naive","''",":","Simply","combining","the","shuffle","block","in","ShuffleNet","and","the","highresolution","design","pattern","in","HRNet",".","``","wider_naive","''",":","Naive","network","with","wider","channels","in","each","block",".","``","lite_18","''",":","Lite-HRNet-18",",","which","replaces","the","pointwise","convolution","in","a","shuffle","block","by","conditional","channel","weighting",".","``","lite_30","''",":","Lite-HRNet-30",",","with","more","blocks","compared","with","Lite-HRNet-18",".","freeze_at","(","int",")",":","the","stage","to","freeze","freeze_norm","(","bool",")",":","whether","to","freeze","norm","in","HRNet","norm_decay","(","float",")",":","weight","decay","for","normalization","layer","weights","return_idx","(","List",")",":","the","stage","to","return"]
code: def __init__(
      self,
      network_type,
      freeze_at=0,
      freeze_norm=True,
      norm_decay=0.0,
      return_idx=[0, 1, 2, 3],
  ):
      super(LiteHRNet, self).__init__()
      if isinstance(return_idx, Integral):
          return_idx = [return_idx]
      assert network_type in [
          "lite_18",
          "lite_30",
          "naive",
          "wider_naive",
      ], "the network_type should be one of [lite_18, lite_30, naive, wider_naive]"
      assert len(return_idx) > 0, "need one or more return index"
      self.freeze_at = freeze_at
      self.freeze_norm = freeze_norm
      self.norm_decay = norm_decay
      self.return_idx = return_idx
      self.norm_type = "bn"
  
      self.module_configs = {
          "lite_18": {
              "num_modules": [2, 4, 2],
              "num_branches": [2, 3, 4],
              "num_blocks": [2, 2, 2],
              "module_type": ["LITE", "LITE", "LITE"],
              "reduce_ratios": [8, 8, 8],
              "num_channels": [
                  [40, 80],
                  [40, 80, 160],
                  [40, 80, 160, 320],
              ],
          },
          "lite_30": {
              "num_modules": [3, 8, 3],
              "num_branches": [2, 3, 4],
              "num_blocks": [2, 2, 2],
              "module_type": ["LITE", "LITE", "LITE"],
              "reduce_ratios": [8, 8, 8],
              "num_channels": [
                  [40, 80],
                  [40, 80, 160],
                  [40, 80, 160, 320],
              ],
          },
          "naive": {
              "num_modules": [2, 4, 2],
              "num_branches": [2, 3, 4],
              "num_blocks": [2, 2, 2],
              "module_type": ["NAIVE", "NAIVE", "NAIVE"],
              "reduce_ratios": [1, 1, 1],
              "num_channels": [
                  [30, 60],
                  [30, 60, 120],
                  [30, 60, 120, 240],
              ],
          },
          "wider_naive": {
              "num_modules": [2, 4, 2],
              "num_branches": [2, 3, 4],
              "num_blocks": [2, 2, 2],
              "module_type": ["NAIVE", "NAIVE", "NAIVE"],
              "reduce_ratios": [1, 1, 1],
              "num_channels": [
                  [40, 80],
                  [40, 80, 160],
                  [40, 80, 160, 320],
              ],
          },
      }
  
      self.stages_config = self.module_configs[network_type]
  
      self.stem = Stem(3, 32, 32, 1)
      num_channels_pre_layer = [32]
      for stage_idx in range(3):
          num_channels = self.stages_config["num_channels"][stage_idx]
          setattr(
              self,
              "transition{}".format(stage_idx),
              self._make_transition_layer(
                  num_channels_pre_layer,
                  num_channels,
                  self.freeze_norm,
                  self.norm_decay,
              ),
          )
          stage, num_channels_pre_layer = self._make_stage(
              self.stages_config,
              stage_idx,
              num_channels,
              True,
              self.freeze_norm,
              self.norm_decay,
          )
          setattr(self, "stage{}".format(stage_idx), stage)
      self.head_layer = IterativeHead(
          num_channels_pre_layer,
          "bn",
          self.freeze_norm,
          self.norm_decay,
      )
  
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from numbers import Integral
  from paddle import ParamAttr
  from paddle.regularizer import L2Decay
  from paddle.nn.initializer import Normal, Constant
  from ppdet.core.workspace import register
  from ppdet.modeling.shape_spec import ShapeSpec
  from ppdet.modeling.ops import channel_shuffle
  from ..None import layers
label_desc: Use image node_id 1 to create a new LiteHRNet object from inherited base classes: nn with example: obj = LiteHRNet(network_type, freeze_at, freeze_norm, norm_decay, return_idx)