class_docstr: Multi-Layer Perceptron Class
  
  **Parameters:**<br>
  `in_features`: int, dimension of input.<br>
  `out_features`: int, dimension of output.<br>
  `activation`: str, activation function to use.<br>
  `hidden_size`: int, dimension of hidden layers.<br>
  `num_layers`: int, number of hidden layers.<br>
  `dropout`: float, dropout rate.<br>
class_docstr_tok: ["Multi-Layer","Perceptron","Class","*","*","Parameters",":","*","*","<","br",">","`","in_features","`",":","int",",","dimension","of","input.","<","br",">","`","out_features","`",":","int",",","dimension","of","output.","<","br",">","`","activation","`",":","str",",","activation","function","to","use.","<","br",">","`","hidden_size","`",":","int",",","dimension","of","hidden","layers.","<","br",">","`","num_layers","`",":","int",",","number","of","hidden","layers.","<","br",">","`","dropout","`",":","float",",","dropout","rate.","<","br",">"]
code: def __init__(
      self,
      in_features,
      out_features,
      activation,
      hidden_size,
      num_layers,
      dropout,
  ):
      super().__init__()
      assert (
          activation in ACTIVATIONS
      ), f"{activation} is not in {ACTIVATIONS}"
  
      self.activation = getattr(nn, activation)()
  
      # MultiLayer Perceptron
      # Input layer
      layers = [
          nn.Linear(in_features=in_features, out_features=hidden_size),
          self.activation,
          nn.Dropout(dropout),
      ]
      # Hidden layers
      for i in range(num_layers - 2):
          layers += [
              nn.Linear(
                  in_features=hidden_size, out_features=hidden_size
              ),
              self.activation,
              nn.Dropout(dropout),
          ]
      # Output layer
      layers += [
          nn.Linear(in_features=hidden_size, out_features=out_features)
      ]
  
      # Store in layers as ModuleList
      self.layers = nn.Sequential(*layers)
  
imports: import math
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 1 to create a new MLP object from inherited base classes: nn with example: obj = MLP(in_features, out_features, activation, hidden_size, num_layers, dropout)