class_docstr: Description
  -----------
  An MLP module.
  
  Parameters
  ----------
  input_d : int
      Number of input features.
  output_d : int
      Number of output features.
  hidden_d : int
      Size of hidden layers.
  num_layers : int
      Number of mlp layers.
  dropout : float
      The dropout rate in mlp layers.
  norm : str
      The type of norm layers inside mlp layers. Can be ``'batch'``, ``'layer'`` or ``'none'``.
  init_activate : bool
      If add a relu at the beginning.
class_docstr_tok: ["Description","--","--","--","--","--","-","An","MLP","module",".","Parameters","--","--","--","--","--","input_d",":","int","Number","of","input","features",".","output_d",":","int","Number","of","output","features",".","hidden_d",":","int","Size","of","hidden","layers",".","num_layers",":","int","Number","of","mlp","layers",".","dropout",":","float","The","dropout","rate","in","mlp","layers",".","norm",":","str","The","type","of","norm","layers","inside","mlp","layers",".","Can","be","``","'batch","'","``",",","``","'layer","'","``","or","``","'none","'","``",".","init_activate",":","bool","If","add","a","relu","at","the","beginning","."]
code: def __init__(
      self,
      input_d,
      hidden_d,
      output_d,
      num_layers,
      dropout,
      norm,
      init_activate,
  ):
      super().__init__()
  
      self.init_activate = init_activate
      self.norm = norm
      self.dropout = dropout
  
      self.layers = nn.ModuleList([])
  
      if num_layers == 1:
          self.layers.append(nn.Linear(input_d, output_d))
      elif num_layers > 1:
          self.layers.append(nn.Linear(input_d, hidden_d))
          for _ in range(num_layers - 2):
              self.layers.append(nn.Linear(hidden_d, hidden_d))
          self.layers.append(nn.Linear(hidden_d, output_d))
  
      # how many norm layers we have
      self.norm_cnt = num_layers - 1 + int(init_activate)
      if norm == "batch":
          self.norms = nn.ModuleList(
              [nn.BatchNorm1d(hidden_d) for _ in range(self.norm_cnt)]
          )
      elif norm == "layer":
          self.norms = nn.ModuleList(
              [nn.LayerNorm(hidden_d) for _ in range(self.norm_cnt)]
          )
  
      self.reset_params()
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from ....None import function
label_desc: Use image node_id 1 to create a new MLP object from inherited base classes: nn with example: obj = MLP(input_d, hidden_d, output_d, num_layers, dropout, norm, init_activate)