code: def __init__(self, in_channels, n_classes, base_n_filter=8):
      super(Modified3DUNet, self).__init__()
      self.in_channels = in_channels
      self.n_classes = n_classes
      self.base_n_filter = base_n_filter
  
      self.lrelu = nn.LeakyReLU()
      self.dropout3d = nn.Dropout3d(p=0.6)
      self.upsacle = nn.Upsample(scale_factor=2, mode="nearest")
      self.softmax = nn.Softmax(dim=1)
  
      # Level 1 context pathway
      self.conv3d_c1_1 = nn.Conv3d(
          self.in_channels,
          self.base_n_filter,
          kernel_size=3,
          stride=1,
          padding=1,
          bias=False,
      )
      self.conv3d_c1_2 = nn.Conv3d(
          self.base_n_filter,
          self.base_n_filter,
          kernel_size=3,
          stride=1,
          padding=1,
          bias=False,
      )
      self.lrelu_conv_c1 = self.lrelu_conv(
          self.base_n_filter, self.base_n_filter
      )
      self.inorm3d_c1 = nn.InstanceNorm3d(self.base_n_filter)
  
      # Level 2 context pathway
      self.conv3d_c2 = nn.Conv3d(
          self.base_n_filter,
          self.base_n_filter * 2,
          kernel_size=3,
          stride=2,
          padding=1,
          bias=False,
      )
      self.norm_lrelu_conv_c2 = self.norm_lrelu_conv(
          self.base_n_filter * 2, self.base_n_filter * 2
      )
      self.inorm3d_c2 = nn.InstanceNorm3d(self.base_n_filter * 2)
  
      # Level 3 context pathway
      self.conv3d_c3 = nn.Conv3d(
          self.base_n_filter * 2,
          self.base_n_filter * 4,
          kernel_size=3,
          stride=2,
          padding=1,
          bias=False,
      )
      self.norm_lrelu_conv_c3 = self.norm_lrelu_conv(
          self.base_n_filter * 4, self.base_n_filter * 4
      )
      self.inorm3d_c3 = nn.InstanceNorm3d(self.base_n_filter * 4)
  
      # Level 4 context pathway
      self.conv3d_c4 = nn.Conv3d(
          self.base_n_filter * 4,
          self.base_n_filter * 8,
          kernel_size=3,
          stride=2,
          padding=1,
          bias=False,
      )
      self.norm_lrelu_conv_c4 = self.norm_lrelu_conv(
          self.base_n_filter * 8, self.base_n_filter * 8
      )
      self.inorm3d_c4 = nn.InstanceNorm3d(self.base_n_filter * 8)
  
      # Level 5 context pathway, level 0 localization pathway
      self.conv3d_c5 = nn.Conv3d(
          self.base_n_filter * 8,
          self.base_n_filter * 16,
          kernel_size=3,
          stride=2,
          padding=1,
          bias=False,
      )
      self.norm_lrelu_conv_c5 = self.norm_lrelu_conv(
          self.base_n_filter * 16, self.base_n_filter * 16
      )
      self.norm_lrelu_upscale_conv_norm_lrelu_l0 = (
          self.norm_lrelu_upscale_conv_norm_lrelu(
              self.base_n_filter * 16, self.base_n_filter * 8
          )
      )
  
      self.conv3d_l0 = nn.Conv3d(
          self.base_n_filter * 8,
          self.base_n_filter * 8,
          kernel_size=1,
          stride=1,
          padding=0,
          bias=False,
      )
      self.inorm3d_l0 = nn.InstanceNorm3d(self.base_n_filter * 8)
  
      # Level 1 localization pathway
      self.conv_norm_lrelu_l1 = self.conv_norm_lrelu(
          self.base_n_filter * 16, self.base_n_filter * 16
      )
      self.conv3d_l1 = nn.Conv3d(
          self.base_n_filter * 16,
          self.base_n_filter * 8,
          kernel_size=1,
          stride=1,
          padding=0,
          bias=False,
      )
      self.norm_lrelu_upscale_conv_norm_lrelu_l1 = (
          self.norm_lrelu_upscale_conv_norm_lrelu(
              self.base_n_filter * 8, self.base_n_filter * 4
          )
      )
  
      # Level 2 localization pathway
      self.conv_norm_lrelu_l2 = self.conv_norm_lrelu(
          self.base_n_filter * 8, self.base_n_filter * 8
      )
      self.conv3d_l2 = nn.Conv3d(
          self.base_n_filter * 8,
          self.base_n_filter * 4,
          kernel_size=1,
          stride=1,
          padding=0,
          bias=False,
      )
      self.norm_lrelu_upscale_conv_norm_lrelu_l2 = (
          self.norm_lrelu_upscale_conv_norm_lrelu(
              self.base_n_filter * 4, self.base_n_filter * 2
          )
      )
  
      # Level 3 localization pathway
      self.conv_norm_lrelu_l3 = self.conv_norm_lrelu(
          self.base_n_filter * 4, self.base_n_filter * 4
      )
      self.conv3d_l3 = nn.Conv3d(
          self.base_n_filter * 4,
          self.base_n_filter * 2,
          kernel_size=1,
          stride=1,
          padding=0,
          bias=False,
      )
      self.norm_lrelu_upscale_conv_norm_lrelu_l3 = (
          self.norm_lrelu_upscale_conv_norm_lrelu(
              self.base_n_filter * 2, self.base_n_filter
          )
      )
  
      # Level 4 localization pathway
      self.conv_norm_lrelu_l4 = self.conv_norm_lrelu(
          self.base_n_filter * 2, self.base_n_filter * 2
      )
      self.conv3d_l4 = nn.Conv3d(
          self.base_n_filter * 2,
          self.n_classes,
          kernel_size=1,
          stride=1,
          padding=0,
          bias=False,
      )
  
      self.ds2_1x1_conv3d = nn.Conv3d(
          self.base_n_filter * 8,
          self.n_classes,
          kernel_size=1,
          stride=1,
          padding=0,
          bias=False,
      )
      self.ds3_1x1_conv3d = nn.Conv3d(
          self.base_n_filter * 4,
          self.n_classes,
          kernel_size=1,
          stride=1,
          padding=0,
          bias=False,
      )
  
file_path: NiftyNet/demos/PyTorchNiftyNet/libs/model.py
imports: import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 1 to create a new Modified3DUNet object from inherited base classes: nn with example: obj = Modified3DUNet(in_channels, n_classes, base_n_filter)