class_docstr: A simple multi-layer perceptron module.
  
  This can be adapted for usage in different contexts, e.g. binary
  and multi-class classification, regression, etc.
  
  Parameters
  ----------
  input_units : int (default=20)
    Number of input units.
  
  output_units : int (default=2)
    Number of output units.
  
  hidden_units : int (default=10)
    Number of units in hidden layers.
  
  num_hidden : int (default=1)
    Number of hidden layers.
  
  nonlin : torch.nn.Module instance (default=torch.nn.ReLU())
    Non-linearity to apply after hidden layers.
  
  output_nonlin : torch.nn.Module instance or None (default=None)
    Non-linearity to apply after last layer, if any.
  
  dropout : float (default=0)
    Dropout rate. Dropout is applied between layers.
  
  squeeze_output : bool (default=False)
    Whether to squeeze output. Squeezing can be helpful if you wish
    your output to be 1-dimensional (e.g. for
    NeuralNetBinaryClassifier).
code: def __init__(
      self,
      input_units=20,
      output_units=2,
      hidden_units=10,
      num_hidden=1,
      nonlin=nn.ReLU(),
      output_nonlin=None,
      dropout=0,
      squeeze_output=False,
  ):
      super().__init__()
      self.input_units = input_units
      self.output_units = output_units
      self.hidden_units = hidden_units
      self.num_hidden = num_hidden
      self.nonlin = nonlin
      self.output_nonlin = output_nonlin
      self.dropout = dropout
      self.squeeze_output = squeeze_output
  
      self.reset_params()
  
file_path: skorch/skorch/toy.py
imports: from functools import partial
  from torch import nn
label_desc: Use image node_id 1 to create a new MLPModule object from inherited base classes: nn with example: obj = MLPModule(input_units, output_units, hidden_units, num_hidden, nonlin, output_nonlin, dropout, squeeze_output)