class_docstr: ### Convolutional Generator Network
  
  This is similar to the de-convolutional network used for CelebA faces,
  but modified for MNIST images.
  
  ![DCGan Architecture](https://pytorch.org/tutorials/_images/dcgan_generator.png)
class_docstr_tok: ["#","#","#","Convolutional","Generator","Network","This","is","similar","to","the","de-convolutional","network","used","for","CelebA","faces",",","but","modified","for","MNIST","images",".","!","[","DCGan","Architecture","]","(","https",":","\/\/pytorch.org\/tutorials\/_images\/dcgan_generator.png",")"]
code: def __init__(self):
      super().__init__()
      # The input is $1 \times 1$ with 100 channels
      self.layers = nn.Sequential(
          # This gives $3 \times 3$ output
          nn.ConvTranspose2d(100, 1024, 3, 1, 0, bias=False),
          nn.BatchNorm2d(1024),
          nn.ReLU(True),
          # This gives $7 \times 7$
          nn.ConvTranspose2d(1024, 512, 3, 2, 0, bias=False),
          nn.BatchNorm2d(512),
          nn.ReLU(True),
          # This gives $14 \times 14$
          nn.ConvTranspose2d(512, 256, 4, 2, 1, bias=False),
          nn.BatchNorm2d(256),
          nn.ReLU(True),
          # This gives $28 \times 28$
          nn.ConvTranspose2d(256, 1, 4, 2, 1, bias=False),
          nn.Tanh(),
      )
  
      self.apply(_weights_init)
  
file_path: annotated_deep_learning_paper_implementations/labml_nn/gan/dcgan/__init__.py
imports: import torch.nn
  from labml import experiment
  from labml.configs import calculate
  from labml_helpers.module import Module
  from labml_nn.gan.original.experiment import Configs
label_desc: Use image node_id 1 to create a new Generator object from inherited base classes: Module with example: obj = Generator()