class_docstr: Upsampling (by either bilinear interpolation or transpose convolutions) followed by concatenation of feature map
  from contracting path, followed by double 3x3 convolution.
  
  >>> Up(8, 4)  # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
  Up(
    (upsample): ConvTranspose2d(8, 4, kernel_size=(2, 2), stride=(2, 2))
    (conv): DoubleConv(
      (net): Sequential(...)
    )
  )
class_docstr_tok: ["Upsampling","(","by","either","bilinear","interpolation","or","transpose","convolutions",")","followed","by","concatenation","of","feature","map","from","contracting","path",",","followed","by","double","3x3","convolution",".",">",">",">","Up","(","8",",","4",")","#","doctest",":","+ELLIPSIS","+NORMALIZE_WHITESPACE","Up","(","(","upsample",")",":","ConvTranspose2d","(","8",",","4",",","kernel_size=","(","2",",","2",")",",","stride=","(","2",",","2",")",")","(","conv",")",":","DoubleConv","(","(","net",")",":","Sequential","(","...",")",")",")"]
code: def __init__(self, in_ch: int, out_ch: int, bilinear: bool = False):
      super().__init__()
      self.upsample = None
      if bilinear:
          self.upsample = nn.Sequential(
              nn.Upsample(
                  scale_factor=2, mode="bilinear", align_corners=True
              ),
              nn.Conv2d(in_ch, in_ch // 2, kernel_size=1),
          )
      else:
          self.upsample = nn.ConvTranspose2d(
              in_ch, in_ch // 2, kernel_size=2, stride=2
          )
  
      self.conv = DoubleConv(in_ch, out_ch)
  
imports: import os
  import random
  from argparse import ArgumentParser, Namespace
  import numpy
  import torch
  import torch.nn.functional
  import torchvision.transforms
  from lightning.pytorch import LightningModule, Trainer, cli_lightning_logo
  from PIL import Image
  from torch import nn
  from torch.utils.data import DataLoader, Dataset
label_desc: Use image node_id 1 to create a new Up object from inherited base classes: nn with example: obj = Up(in_ch, out_ch, bilinear)