class_docstr: ### Simple MLP Generator
  
  This has three linear layers of increasing size with `LeakyReLU` activations.
  The final layer has a $tanh$ activation.
class_docstr_tok: ["#","#","#","Simple","MLP","Generator","This","has","three","linear","layers","of","increasing","size","with","`","LeakyReLU","`","activations",".","The","final","layer","has","a","$","tanh","$","activation","."]
code: def __init__(self):
      super().__init__()
      layer_sizes = [256, 512, 1024]
      layers = []
      d_prev = 100
      for size in layer_sizes:
          layers = layers + [nn.Linear(d_prev, size), nn.LeakyReLU(0.2)]
          d_prev = size
  
      self.layers = nn.Sequential(
          *layers, nn.Linear(d_prev, 28 * 28), nn.Tanh()
      )
  
      self.apply(weights_init)
  
imports: from typing import Any
  import torch
  import torch.nn
  import torch.utils.data
  from torchvision import transforms
  from labml import tracker, monit, experiment
  from labml.configs import option, calculate
  from labml_helpers.datasets.mnist import MNISTConfigs
  from labml_helpers.device import DeviceConfigs
  from labml_helpers.module import Module
  from labml_helpers.optimizer import OptimizerConfigs
  from labml_helpers.train_valid import TrainValidConfigs, hook_model_outputs, BatchIndex
  from labml_nn.gan.original import DiscriminatorLogitsLoss, GeneratorLogitsLoss
label_desc: Use image node_id 1 to create a new Generator object from inherited base classes: Module with example: obj = Generator()