code: def __init__(self, in_size, out_size, mlp_size, num_layers, tanh):
      super().__init__()
  
      model = [torch.nn.Linear(in_size, mlp_size), LipSwish()]
      for _ in range(num_layers - 1):
          model.append(torch.nn.Linear(mlp_size, mlp_size))
          ###################
          # LipSwish activations are useful to constrain the Lipschitz constant of the discriminator.
          # (For simplicity we additionally use them in the generator, but that's less important.)
          ###################
          model.append(LipSwish())
      model.append(torch.nn.Linear(mlp_size, out_size))
      if tanh:
          model.append(torch.nn.Tanh())
      self._model = torch.nn.Sequential(*model)
  
imports: import fire
  import matplotlib.pyplot
  import torch
  import torch.optim.swa_utils
  import torchcde
  import torchsde
  import tqdm
label_desc: Use image node_id 1 to create a new MLP object from inherited base classes: torch.nn with example: obj = MLP(in_size, out_size, mlp_size, num_layers, tanh)