class_docstr: Optimized Densenet-BC model
class_docstr_tok: ["Optimized","Densenet-BC","model"]
code: def __init__(
      self,
      growth_rate=32,
      block_config=(6, 12, 24, 16),
      num_init_features=64,
      bn_size=4,
      drop_rate=0,
      num_classes=1000,
      **kwargs,
  ):
      super(OptDenseNet, self).__init__()
  
      # First convolution
      self.features = nn.Sequential(
          OrderedDict(
              [
                  (
                      "conv0",
                      nn.Conv2d(
                          3,
                          num_init_features,
                          kernel_size=7,
                          stride=2,
                          padding=3,
                          bias=False,
                      ),
                  ),
                  ("norm0", nn.BatchNorm2d(num_init_features)),
                  ("relu0", nn.ReLU(inplace=True)),
                  (
                      "pool0",
                      nn.MaxPool2d(kernel_size=3, stride=2, padding=1),
                  ),
              ]
          )
      )
  
      num_features = num_init_features
      for i, num_layers in enumerate(block_config):
          num_input_features = num_features
          for j in range(num_layers):
              layer = _DenseLayer(
                  num_input_features + j * growth_rate,
                  growth_rate,
                  bn_size,
                  drop_rate,
              )
              self.features.add_module(
                  "denseblock{}_layer{}".format((i + 1), (j + 1)), layer
              )
  
          num_features = num_features + num_layers * growth_rate
          if i != len(block_config) - 1:
              trans = _Transition(
                  num_input_features=num_features,
                  num_output_features=num_features // 2,
              )
              self.features.add_module("transition%d" % (i + 1), trans)
              num_features = num_features // 2
  
      self.features.add_module("norm5", nn.BatchNorm2d(num_features))
      self.classifier = nn.Linear(num_features, num_classes)
  
imports: from collections import OrderedDict
  import torch
  import torch.nn
  import torch.nn.functional
  from torch.utils.checkpoint import checkpoint_sequential
label_desc: Use image node_id 1 to create a new OptDenseNet object from inherited base classes: nn with example: obj = OptDenseNet(growth_rate, block_config, num_init_features, bn_size, drop_rate, num_classes)