class_docstr: MLP for categorical input. The input dimension is automatically computed based on
  the number of categories in each categorical column.
docstr: Parameters
  ----------
  prefix
      The model prefix.
  num_categories
      A list of integers. Each one is the number of categories in one categorical column.
  out_features
      Dimension of output features.
  num_layers
      Number of MLP layers.
  activation
      Name of activation function.
  dropout_prob
      Dropout probability.
  normalization
      Name of normalization function.
  num_classes
      Number of classes. 1 for a regression task.
docstr_tok: ["Parameters","--","--","--","--","--","prefix","The","model","prefix",".","num_categories","A","list","of","integers",".","Each","one","is","the","number","of","categories","in","one","categorical","column",".","out_features","Dimension","of","output","features",".","num_layers","Number","of","MLP","layers",".","activation","Name","of","activation","function",".","dropout_prob","Dropout","probability",".","normalization","Name","of","normalization","function",".","num_classes","Number","of","classes",".","1","for","a","regression","task","."]
code: def __init__(
      self,
      prefix: str,
      num_categories: List[int],
      out_features: Optional[int] = None,
      num_layers: Optional[int] = 1,
      activation: Optional[str] = "gelu",
      dropout_prob: Optional[float] = 0.5,
      normalization: Optional[str] = "layer_norm",
      num_classes: Optional[int] = 0,
  ):
      """
      Parameters
      ----------
      prefix
          The model prefix.
      num_categories
          A list of integers. Each one is the number of categories in one categorical column.
      out_features
          Dimension of output features.
      num_layers
          Number of MLP layers.
      activation
          Name of activation function.
      dropout_prob
          Dropout probability.
      normalization
          Name of normalization function.
      num_classes
          Number of classes. 1 for a regression task.
      """
      super().__init__()
      self.out_features = out_features
      max_embedding_dim = 100
      embed_exponent = 0.56
      size_factor = 1.0
      self.column_embeddings = nn.ModuleList()
      self.column_mlps = nn.ModuleList()
      assert isinstance(num_categories, list)
  
      for num_categories_per_col in num_categories:
          embedding_dim_per_col = int(
              size_factor
              * max(
                  2,
                  min(
                      max_embedding_dim,
                      1.6 * num_categories_per_col**embed_exponent,
                  ),
              )
          )
          self.column_embeddings.append(
              nn.Embedding(
                  num_embeddings=num_categories_per_col,
                  embedding_dim=embedding_dim_per_col,
              )
          )
  
          self.column_mlps.append(
              MLP(
                  in_features=embedding_dim_per_col,
                  hidden_features=out_features,
                  out_features=out_features,
                  num_layers=num_layers,
                  activation=activation,
                  dropout_prob=dropout_prob,
                  normalization=normalization,
              )
          )
  
      self.aggregator_mlp = MLP(
          in_features=out_features * len(num_categories),
          hidden_features=out_features * len(num_categories),
          out_features=out_features,
          num_layers=num_layers,
          activation=activation,
          dropout_prob=dropout_prob,
          normalization=normalization,
      )
  
      self.head = (
          nn.Linear(out_features, num_classes)
          if num_classes > 0
          else nn.Identity()
      )
      # init weights
      self.apply(init_weights)
  
      self.prefix = prefix
  
      self.name_to_id = self.get_layer_ids()
      self.head_layer_names = [
          n for n, layer_id in self.name_to_id.items() if layer_id == 0
      ]
  
file_path: autogluon/multimodal/src/autogluon/multimodal/models/categorical_mlp.py
imports: from typing import List, Optional
  import torch
  from torch import nn
  from ..constants import CATEGORICAL, FEATURES, LABEL, LOGITS
  from .mlp import MLP
  from .utils import init_weights
label_desc: Use image node_id 1 to create a new CategoricalMLP object from inherited base classes: nn with example: obj = CategoricalMLP(prefix, num_categories, out_features, num_layers, activation, dropout_prob, normalization, num_classes)