class_docstr: MLP model using ReLU. Useful for testing on CPUs.
docstr: Instantiates a MLP from a configuration.
  
  Args:
      config: A configuration for a MLP.
          See :func:`__init__` for parameters expected in the config.
  
  Returns:
      A MLP instance.
docstr_tok: ["Instantiates","a","MLP","from","a","configuration",".","Args",":","config",":","A","configuration","for","a","MLP",".","See",":","func",":","`","__init__","`","for","parameters","expected","in","the","config",".","Returns",":","A","MLP","instance","."]
code: def from_config(cls, config: Dict[str, Any]) -> "MLP":
      """Instantiates a MLP from a configuration.
  
      Args:
          config: A configuration for a MLP.
              See :func:`__init__` for parameters expected in the config.
  
      Returns:
          A MLP instance.
      """
      assert (
          key in config
          for key in ["input_dim", "output_dim", "hidden_dims"]
      )
  
      output_dim = config["output_dim"]
      return cls(
          input_dim=config["input_dim"],
          output_dim=output_dim,
          hidden_dims=config["hidden_dims"],
          dropout=config.get("dropout", 0),
          first_dropout=config.get("first_dropout", False),
          use_batchnorm=config.get("use_batchnorm", False),
          first_batchnorm=config.get("first_batchnorm", False),
      )
  
file_path: ClassyVision/classy_vision/models/mlp.py
imports: from typing import Any, Dict
  import torch.nn
  from .None import register_model
  from .classy_model import ClassyModel
label_desc: Use image node_id 2 for calling the MLP obj's underlying member method code with example usage: obj.from_config(cls, config) and returns: cls