class_docstr: Reimplementation of highres3dnet based on
  Li et al., "On the compactness, efficiency, and representation of 3D
  convolutional networks: Brain parcellation as a pretext task", IPMI '17
  
  Adapted from:
  https://github.com/NifTK/NiftyNet/blob/v0.6.0/niftynet/network/highres3dnet.py
  https://github.com/fepegar/highresnet
  
  Args:
      spatial_dims: number of spatial dimensions of the input image.
      in_channels: number of input channels.
      out_channels: number of output channels.
      norm_type: feature normalization type and arguments.
          Defaults to ``("batch", {"affine": True})``.
      acti_type: activation type and arguments.
          Defaults to ``("relu", {"inplace": True})``.
      dropout_prob: probability of the feature map to be zeroed
          (only applies to the penultimate conv layer).
      bias: whether to have a bias term in convolution blocks. Defaults to False.
          According to `Performance Tuning Guide <https://pytorch.org/tutorials/recipes/recipes/tuning_guide.html>`_,
          if a conv layer is directly followed by a batch norm layer, bias should be False.
      layer_params: specifying key parameters of each layer/block.
      channel_matching: {``"pad"``, ``"project"``}
          Specifies handling residual branch and conv branch channel mismatches. Defaults to ``"pad"``.
  
          - ``"pad"``: with zero padding.
          - ``"project"``: with a trainable conv with kernel size one.
class_docstr_tok: ["Reimplementation","of","highres3dnet","based","on","Li","et","al.",",","``","On","the","compactness",",","efficiency",",","and","representation","of","3D","convolutional","networks",":","Brain","parcellation","as","a","pretext","task","''",",","IPMI","'17","Adapted","from",":","https",":","\/\/github.com\/NifTK\/NiftyNet\/blob\/v0.6.0\/niftynet\/network\/highres3dnet.py","https",":","\/\/github.com\/fepegar\/highresnet","Args",":","spatial_dims",":","number","of","spatial","dimensions","of","the","input","image",".","in_channels",":","number","of","input","channels",".","out_channels",":","number","of","output","channels",".","norm_type",":","feature","normalization","type","and","arguments",".","Defaults","to","``","(","``","batch","''",",","{","``","affine","''",":","True","}",")","``",".","acti_type",":","activation","type","and","arguments",".","Defaults","to","``","(","``","relu","''",",","{","``","inplace","''",":","True","}",")","``",".","dropout_prob",":","probability","of","the","feature","map","to","be","zeroed","(","only","applies","to","the","penultimate","conv","layer",")",".","bias",":","whether","to","have","a","bias","term","in","convolution","blocks",".","Defaults","to","False",".","According","to","`","Performance","Tuning","Guide","<","https",":","\/\/pytorch.org\/tutorials\/recipes\/recipes\/tuning_guide.html",">","`","_",",","if","a","conv","layer","is","directly","followed","by","a","batch","norm","layer",",","bias","should","be","False",".","layer_params",":","specifying","key","parameters","of","each","layer\/block",".","channel_matching",":","{","``","``","pad","''","``",",","``","``","project","''","``","}","Specifies","handling","residual","branch","and","conv","branch","channel","mismatches",".","Defaults","to","``","``","pad","''","``",".","-","``","``","pad","''","``",":","with","zero","padding",".","-","``","``","project","''","``",":","with","a","trainable","conv","with","kernel","size","one","."]
code: def __init__(
      self,
      spatial_dims: int = 3,
      in_channels: int = 1,
      out_channels: int = 1,
      norm_type: str | tuple = ("batch", {"affine": True}),
      acti_type: str | tuple = ("relu", {"inplace": True}),
      dropout_prob: tuple | str | float | None = 0.0,
      bias: bool = False,
      layer_params: Sequence[dict] = DEFAULT_LAYER_PARAMS_3D,
      channel_matching: ChannelMatching | str = ChannelMatching.PAD,
  ) -> None:
      super().__init__()
      blocks = nn.ModuleList()
  
      # initial conv layer
      params = layer_params[0]
      _in_chns, _out_chns = in_channels, params["n_features"]
      blocks.append(
          Convolution(
              spatial_dims=spatial_dims,
              in_channels=_in_chns,
              out_channels=_out_chns,
              kernel_size=params["kernel_size"],
              adn_ordering="NA",
              act=acti_type,
              norm=norm_type,
              bias=bias,
          )
      )
  
      # residual blocks
      for idx, params in enumerate(
          layer_params[1:-2]
      ):  # res blocks except the 1st and last two conv layers.
          _in_chns, _out_chns = _out_chns, params["n_features"]
          _dilation = 2**idx
          for _ in range(params["repeat"]):
              blocks.append(
                  HighResBlock(
                      spatial_dims=spatial_dims,
                      in_channels=_in_chns,
                      out_channels=_out_chns,
                      kernels=params["kernels"],
                      dilation=_dilation,
                      norm_type=norm_type,
                      acti_type=acti_type,
                      bias=bias,
                      channel_matching=channel_matching,
                  )
              )
              _in_chns = _out_chns
  
      # final conv layers
      params = layer_params[-2]
      _in_chns, _out_chns = _out_chns, params["n_features"]
      blocks.append(
          Convolution(
              spatial_dims=spatial_dims,
              in_channels=_in_chns,
              out_channels=_out_chns,
              kernel_size=params["kernel_size"],
              adn_ordering="NAD",
              act=acti_type,
              norm=norm_type,
              bias=bias,
              dropout=dropout_prob,
          )
      )
  
      params = layer_params[-1]
      _in_chns = _out_chns
      blocks.append(
          Convolution(
              spatial_dims=spatial_dims,
              in_channels=_in_chns,
              out_channels=out_channels,
              kernel_size=params["kernel_size"],
              adn_ordering="NAD",
              act=acti_type,
              norm=norm_type,
              bias=bias,
              dropout=dropout_prob,
          )
      )
  
      self.blocks = nn.Sequential(*blocks)
  
file_path: MONAI/monai/networks/nets/highresnet.py
imports: from __future__ import annotations
  from collections.abc import Sequence
  import torch
  import torch.nn
  from monai.networks.blocks import ADN, Convolution
  from monai.networks.layers.simplelayers import ChannelPad
  from monai.utils import ChannelMatching
label_desc: Use image node_id 1 to create a new HighResNet object from inherited base classes: nn with example: obj = HighResNet(spatial_dims, in_channels, out_channels, norm_type, acti_type, dropout_prob, bias, layer_params, channel_matching)