class_docstr: This is the discriminator.
class_docstr_tok: ["This","is","the","discriminator","."]
code: def __init__(self, input_shape: Tuple[int, int, int]):
      super().__init__()
      channels, height, width = input_shape
  
      # Output of the discriminator is also a map of probabilities,
      # whether each region of the image is real or generated
      self.output_shape = (1, height // 2**4, width // 2**4)
  
      self.layers = nn.Sequential(
          # Each of these blocks will shrink the height and width by a factor of 2
          DiscriminatorBlock(channels, 64, normalize=False),
          DiscriminatorBlock(64, 128),
          DiscriminatorBlock(128, 256),
          DiscriminatorBlock(256, 512),
          # Zero pad on top and left to keep the output height and width same
          # with the $4 \times 4$ kernel
          nn.ZeroPad2d((1, 0, 1, 0)),
          nn.Conv2d(512, 1, kernel_size=4, padding=1),
      )
  
      # Initialize weights to $\mathcal{N}(0, 0.2)$
      self.apply(weights_init_normal)
  
imports: import itertools
  import random
  import zipfile
  from typing import Tuple
  import torch
  import torch.nn
  import torchvision.transforms
  from PIL import Image
  from torch.utils.data import DataLoader, Dataset
  from torchvision.transforms import InterpolationMode
  from torchvision.utils import make_grid
  from labml import lab, tracker, experiment, monit
  from labml.configs import BaseConfigs
  from labml.utils.download import download_file
  from labml.utils.pytorch import get_modules
  from labml_helpers.device import DeviceConfigs
  from labml_helpers.module import Module
label_desc: Use image node_id 1 to create a new Discriminator object from inherited base classes: Module with example: obj = Discriminator(input_shape)