code: def __init__(
      self,
      num_classes=4,
      in_channels=3,
      feature_scale=4,
      is_deconv=True,
      is_batchnorm=True,
      is_ds=True,
      **kwargs,
  ):
      super(UNet_Nested_dilated, self).__init__()
      self.is_deconv = is_deconv
      self.in_channels = in_channels
      self.is_batchnorm = is_batchnorm
      self.is_ds = is_ds
      self.feature_scale = feature_scale
  
      filters = [64, 128, 256, 512, 1024]
      filters = [int(x / self.feature_scale) for x in filters]
  
      # downsampling
      self.conv00 = unetConv2(
          self.in_channels, filters[0], self.is_batchnorm
      )
      self.maxpool0 = nn.MaxPool2d(kernel_size=2)
      self.conv10 = unetConv2(filters[0], filters[1], self.is_batchnorm)
      self.maxpool1 = nn.MaxPool2d(kernel_size=2)
      self.conv20 = unetConv2(filters[1], filters[2], self.is_batchnorm)
      self.maxpool2 = nn.MaxPool2d(kernel_size=2)
      self.conv30 = unetConv2(filters[2], filters[3], self.is_batchnorm)
      self.maxpool3 = nn.MaxPool2d(kernel_size=2)
      self.conv40 = unetConv2(filters[3], filters[4], self.is_batchnorm)
  
      self.dilated = unetConv2_dilation(
          filters[4], filters[4], self.is_batchnorm
      )
  
      self.cls = nn.Sequential(
          nn.Dropout(p=0.5),
          nn.Conv2d(256, 3, 1),
          nn.AdaptiveMaxPool2d(1),
          nn.Sigmoid(),
      )
  
      # upsampling
      self.up_concat01 = unetUp(filters[1], filters[0], self.is_deconv)
      self.up_concat11 = unetUp(filters[2], filters[1], self.is_deconv)
      self.up_concat21 = unetUp(filters[3], filters[2], self.is_deconv)
      self.up_concat31 = unetUp(filters[4], filters[3], self.is_deconv)
  
      self.up_concat02 = unetUp(
          filters[1], filters[0], self.is_deconv, 3
      )
      self.up_concat12 = unetUp(
          filters[2], filters[1], self.is_deconv, 3
      )
      self.up_concat22 = unetUp(
          filters[3], filters[2], self.is_deconv, 3
      )
  
      self.up_concat03 = unetUp(
          filters[1], filters[0], self.is_deconv, 4
      )
      self.up_concat13 = unetUp(
          filters[2], filters[1], self.is_deconv, 4
      )
  
      self.up_concat04 = unetUp(
          filters[1], filters[0], self.is_deconv, 5
      )
  
      # final conv (without any concat)
      self.final_1 = nn.Conv2d(filters[0], num_classes, 1)
      self.final_2 = nn.Conv2d(filters[0], num_classes, 1)
      self.final_3 = nn.Conv2d(filters[0], num_classes, 1)
      self.final_4 = nn.Conv2d(filters[0], num_classes, 1)
  
      # initialise weights
      for m in self.modules():
          if isinstance(m, nn.Conv2d):
              init_weights(m, init_type="kaiming")
          elif isinstance(m, nn.BatchNorm2d):
              init_weights(m, init_type="kaiming")
  
imports: import torch.nn
  import torch.nn.functional
  from torch.nn import init
  from .Unet_nested_layers import unetConv2, unetUp, unetConv2_dilation
label_desc: Use image node_id 1 to create a new UNet_Nested_dilated object from inherited base classes: nn with example: obj = UNet_Nested_dilated(num_classes, in_channels, feature_scale, is_deconv, is_batchnorm, is_ds)