class_docstr: Multi-Layer Perceptron with custom parameters.
  It can be configured to have multiple layers and dropout.
  
  **Example**::
  
      >>> from avalanche.models import SimpleMLP
      >>> n_classes = 10 # e.g. MNIST
      >>> model = SimpleMLP(num_classes=n_classes)
      >>> print(model) # View model details
class_docstr_tok: ["Multi-Layer","Perceptron","with","custom","parameters",".","It","can","be","configured","to","have","multiple","layers","and","dropout",".","*","*","Example","*","*",":",":",">",">",">","from","avalanche.models","import","SimpleMLP",">",">",">","n_classes","=","10","#","e.g",".","MNIST",">",">",">","model","=","SimpleMLP","(","num_classes=n_classes",")",">",">",">","print","(","model",")","#","View","model","details"]
docstr: :param num_classes: output size
  :param input_size: input size
  :param hidden_size: hidden layer size
  :param hidden_layers: number of hidden layers
  :param drop_rate: dropout rate. 0 to disable
docstr_tok: [":","param","num_classes",":","output","size",":","param","input_size",":","input","size",":","param","hidden_size",":","hidden","layer","size",":","param","hidden_layers",":","number","of","hidden","layers",":","param","drop_rate",":","dropout","rate",".","0","to","disable"]
code: def __init__(
      self,
      num_classes=10,
      input_size=28 * 28,
      hidden_size=512,
      hidden_layers=1,
      drop_rate=0.5,
  ):
      """
      :param num_classes: output size
      :param input_size: input size
      :param hidden_size: hidden layer size
      :param hidden_layers: number of hidden layers
      :param drop_rate: dropout rate. 0 to disable
      """
      super().__init__()
  
      layers = nn.Sequential(
          *(
              nn.Linear(input_size, hidden_size),
              nn.ReLU(inplace=True),
              nn.Dropout(p=drop_rate),
          )
      )
      for layer_idx in range(hidden_layers - 1):
          layers.add_module(
              f"fc{layer_idx + 1}",
              nn.Sequential(
                  *(
                      nn.Linear(hidden_size, hidden_size),
                      nn.ReLU(inplace=True),
                      nn.Dropout(p=drop_rate),
                  )
              ),
          )
  
      self.features = nn.Sequential(*layers)
      self.classifier = nn.Linear(hidden_size, num_classes)
      self._input_size = input_size
  
file_path: avalanche/avalanche/models/simple_mlp.py
imports: import torch.nn
  from avalanche.models.dynamic_modules import MultiTaskModule, MultiHeadClassifier
  from avalanche.models.base_model import BaseModel
label_desc: Use image node_id 1 to create a new SimpleMLP object from inherited base classes: nn, BaseModel with example: obj = SimpleMLP(num_classes, input_size, hidden_size, hidden_layers, drop_rate)