class_docstr: Darknet v3.
  
  Parameters
  ----------
  layers : iterable
      Description of parameter `layers`.
  channels : iterable
      Description of parameter `channels`.
  classes : int, default is 1000
      Number of classes, which determines the dense layer output channels.
  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`.
  
  Attributes
  ----------
  features : mxnet.gluon.nn.HybridSequential
      Feature extraction layers.
  output : mxnet.gluon.nn.Dense
      A classes(1000)-way Fully-Connected Layer.
class_docstr_tok: ["Darknet","v3",".","Parameters","--","--","--","--","--","layers",":","iterable","Description","of","parameter","`","layers","`",".","channels",":","iterable","Description","of","parameter","`","channels","`",".","classes",":","int",",","default","is","1000","Number","of","classes",",","which","determines","the","dense","layer","output","channels",".","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","`",".","Attributes","--","--","--","--","--","features",":","mxnet.gluon.nn.HybridSequential","Feature","extraction","layers",".","output",":","mxnet.gluon.nn.Dense","A","classes","(","1000",")","-way","Fully-Connected","Layer","."]
code: def __init__(
      self,
      layers,
      channels,
      classes=1000,
      norm_layer=BatchNorm,
      norm_kwargs=None,
      **kwargs,
  ):
      # Checking the kwargs
      for kwarg_key in kwargs:
          if kwarg_key not in ["prefix", "params"]:
              raise Warning(
                  "class DraknetV3 should only accept kwargs {'params', or 'prefix'}"
              )
      super(DarknetV3, self).__init__(
          kwargs.get("prefix", None), kwargs.get("params", None)
      )
      assert (
          len(layers) == len(channels) - 1
      ), "len(channels) should equal to len(layers) + 1, given {} vs {}".format(
          len(channels), len(layers)
      )
      with self.name_scope():
          self.features = nn.HybridSequential()
          # first 3x3 conv
          self.features.add(
              _conv2d(
                  channels[0],
                  3,
                  1,
                  1,
                  norm_layer=norm_layer,
                  norm_kwargs=norm_kwargs,
              )
          )
          for nlayer, channel in zip(layers, channels[1:]):
              assert (
                  channel % 2 == 0
              ), "channel {} cannot be divided by 2".format(channel)
              # add downsample conv with stride=2
              self.features.add(
                  _conv2d(
                      channel,
                      3,
                      1,
                      2,
                      norm_layer=norm_layer,
                      norm_kwargs=norm_kwargs,
                  )
              )
              # add nlayer basic blocks
              for _ in range(nlayer):
                  self.features.add(
                      DarknetBasicBlockV3(
                          channel // 2,
                          norm_layer=norm_layer,
                          norm_kwargs=norm_kwargs,
                      )
                  )
          # output
          self.output = nn.Dense(classes)
  
file_path: gluon-cv/gluoncv/model_zoo/yolo/darknet.py
imports: from __future__ import absolute_import
  import os
  import mxnet
  from mxnet import gluon
  from mxnet.gluon import nn
  from mxnet.gluon.nn import BatchNorm
label_desc: Use image node_id 1 to create a new DarknetV3 object from inherited base classes: gluon with example: obj = DarknetV3(layers, channels, classes, norm_layer, norm_kwargs)