class_docstr: Densenet-BC model from the
  `"Densely Connected Convolutional Networks" <https://arxiv.org/pdf/1608.06993.pdf>`_ paper.
  
  Parameters
  ----------
  num_init_features : int
      Number of filters to learn in the first convolution layer.
  growth_rate : int
      Number of filters to add each layer (`k` in the paper).
  block_config : list of int
      List of integers for numbers of layers in each pooling block.
  bn_size : int, default 4
      Multiplicative factor for number of bottle neck layers.
      (i.e. bn_size * k features in the bottleneck layer)
  dropout : float, default 0
      Rate of dropout after each dense layer.
  classes : int, default 1000
      Number of classification classes.
  norm_layer : object
      Normalization layer used (default: :class:`mxnet.gluon.nn.BatchNorm`)
      Can be :class:`mxnet.gluon.nn.BatchNorm` or :class:`mxnet.gluon.contrib.nn.SyncBatchNorm`.
  norm_kwargs : dict
      Additional `norm_layer` arguments, for example `num_devices=4`
      for :class:`mxnet.gluon.contrib.nn.SyncBatchNorm`.
class_docstr_tok: ["Densenet-BC","model","from","the","`","``","Densely","Connected","Convolutional","Networks","''","<","https",":","\/\/arxiv.org\/pdf\/1608.06993.pdf",">","`","_","paper",".","Parameters","--","--","--","--","--","num_init_features",":","int","Number","of","filters","to","learn","in","the","first","convolution","layer",".","growth_rate",":","int","Number","of","filters","to","add","each","layer","(","`","k","`","in","the","paper",")",".","block_config",":","list","of","int","List","of","integers","for","numbers","of","layers","in","each","pooling","block",".","bn_size",":","int",",","default","4","Multiplicative","factor","for","number","of","bottle","neck","layers",".","(","i.e",".","bn_size","*","k","features","in","the","bottleneck","layer",")","dropout",":","float",",","default","0","Rate","of","dropout","after","each","dense","layer",".","classes",":","int",",","default","1000","Number","of","classification","classes",".","norm_layer",":","object","Normalization","layer","used","(","default",":",":","class",":","`","mxnet.gluon.nn.BatchNorm","`",")","Can","be",":","class",":","`","mxnet.gluon.nn.BatchNorm","`","or",":","class",":","`","mxnet.gluon.contrib.nn.SyncBatchNorm","`",".","norm_kwargs",":","dict","Additional","`","norm_layer","`","arguments",",","for","example","`","num_devices=4","`","for",":","class",":","`","mxnet.gluon.contrib.nn.SyncBatchNorm","`","."]
code: def __init__(
      self,
      num_init_features,
      growth_rate,
      block_config,
      bn_size=4,
      dropout=0,
      classes=1000,
      norm_layer=BatchNorm,
      norm_kwargs=None,
      **kwargs,
  ):
      super(DenseNet, self).__init__(**kwargs)
      with self.name_scope():
          self.features = nn.HybridSequential(prefix="")
          self.features.add(
              nn.Conv2D(
                  num_init_features,
                  kernel_size=7,
                  strides=2,
                  padding=3,
                  use_bias=False,
              )
          )
          self.features.add(
              norm_layer(**({} if norm_kwargs is None else norm_kwargs))
          )
          self.features.add(nn.Activation("relu"))
          self.features.add(
              nn.MaxPool2D(pool_size=3, strides=2, padding=1)
          )
          # Add dense blocks
          num_features = num_init_features
          for i, num_layers in enumerate(block_config):
              self.features.add(
                  _make_dense_block(
                      num_layers,
                      bn_size,
                      growth_rate,
                      dropout,
                      i + 1,
                      norm_layer,
                      norm_kwargs,
                  )
              )
              num_features = num_features + num_layers * growth_rate
              if i != len(block_config) - 1:
                  self.features.add(
                      _make_transition(
                          num_features // 2, norm_layer, norm_kwargs
                      )
                  )
                  num_features = num_features // 2
          self.features.add(
              norm_layer(**({} if norm_kwargs is None else norm_kwargs))
          )
          self.features.add(nn.Activation("relu"))
          self.features.add(nn.AvgPool2D(pool_size=7))
          self.features.add(nn.Flatten())
  
          self.output = nn.Dense(classes)
  
file_path: gluon-cv/gluoncv/model_zoo/densenet.py
imports: from mxnet.context import cpu
  from mxnet.gluon.block import HybridBlock
  from mxnet.gluon import nn
  from mxnet.gluon.nn import BatchNorm
  from mxnet.gluon.contrib.nn import HybridConcurrent, Identity
label_desc: Use image node_id 1 to create a new DenseNet object from inherited base classes: HybridBlock with example: obj = DenseNet(num_init_features, growth_rate, block_config, bn_size, dropout, classes, norm_layer, norm_kwargs)