class_docstr: Decoder of Monodepth2
  
  Parameters
  ----------
  num_ch_enc : list
      The channels number of encoder.
  scales: list
      The scales used in the loss. (Default: range(4))
  num_output_channels: int
      The number of output channels. (Default: 1)
  use_skips: bool
      This will use skip architecture in the network. (Default: True)
class_docstr_tok: ["Decoder","of","Monodepth2","Parameters","--","--","--","--","--","num_ch_enc",":","list","The","channels","number","of","encoder",".","scales",":","list","The","scales","used","in","the","loss",".","(","Default",":","range","(","4",")",")","num_output_channels",":","int","The","number","of","output","channels",".","(","Default",":","1",")","use_skips",":","bool","This","will","use","skip","architecture","in","the","network",".","(","Default",":","True",")"]
code: def __init__(
      self,
      num_ch_enc,
      scales=range(4),
      num_output_channels=1,
      use_skips=True,
  ):
      super(DepthDecoder, self).__init__()
  
      self.num_output_channels = num_output_channels
      self.use_skips = use_skips
      self.upsample_mode = "nearest"
      self.scales = scales
  
      self.num_ch_enc = num_ch_enc
      self.num_ch_dec = np.array([16, 32, 64, 128, 256])
  
      # decoder
      with self.name_scope():
          self.convs = OrderedDict()
          for i in range(4, -1, -1):
              # upconv_0
              num_ch_in = (
                  self.num_ch_enc[-1]
                  if i == 4
                  else self.num_ch_dec[i + 1]
              )
              num_ch_out = self.num_ch_dec[i]
              self.convs[("upconv", i, 0)] = ConvBlock(
                  num_ch_in, num_ch_out
              )
  
              # upconv_1
              num_ch_in = self.num_ch_dec[i]
              if self.use_skips and i > 0:
                  num_ch_in += self.num_ch_enc[i - 1]
              num_ch_out = self.num_ch_dec[i]
              self.convs[("upconv", i, 1)] = ConvBlock(
                  num_ch_in, num_ch_out
              )
  
          for s in self.scales:
              self.convs[("dispconv", s)] = Conv3x3(
                  self.num_ch_dec[s], self.num_output_channels
              )
  
          # register blocks
          for k in self.convs:
              self.register_child(self.convs[k])
          self.decoder = nn.HybridSequential()
          self.decoder.add(*list(self.convs.values()))
  
          self.sigmoid = nn.Activation("sigmoid")
  
file_path: gluon-cv/gluoncv/model_zoo/monodepthv2/depth_decoder.py
imports: from __future__ import absolute_import, division, print_function
  from collections import OrderedDict
  import numpy
  import mxnet
  import mxnet.gluon.nn
  from .layers import ConvBlock, Conv3x3
label_desc: Use image node_id 1 to create a new DepthDecoder object from inherited base classes: nn with example: obj = DepthDecoder(num_ch_enc, scales, num_output_channels, use_skips)