class_docstr: FT-Transformer for categorical tabular features.
  The input dimension is automatically computed based on
  the number of categories in each categorical column.
class_docstr_tok: ["FT-Transformer","for","categorical","tabular","features",".","The","input","dimension","is","automatically","computed","based","on","the","number","of","categories","in","each","categorical","column","."]
docstr: Parameters
  ----------
  batch
      A dictionary containing the input mini-batch data.
      We need to use the keys with the model prefix to index required data.
  
  Returns
  -------
      A dictionary with logits and features.
code: def forward(self, batch: dict):
      """
  
      Parameters
      ----------
      batch
          A dictionary containing the input mini-batch data.
          We need to use the keys with the model prefix to index required data.
  
      Returns
      -------
          A dictionary with logits and features.
      """
      multimodal_features = []
      if self.categorical_feature_tokenizer:
          categorical_inputs = []
          for categorical_input in batch[self.categorical_key]:
              categorical_inputs.append(categorical_input)
          categorical_inputs = torch.stack(categorical_inputs, dim=1)
  
          categorical_features = self.categorical_feature_tokenizer(
              categorical_inputs
          )
          categorical_features = self.categorical_adapter(
              categorical_features
          )
          multimodal_features.append(categorical_features)
      if self.numerical_feature_tokenizer:
          numerical_features = self.numerical_feature_tokenizer(
              batch[self.numerical_key]
          )
          numerical_features = self.numerical_adapter(
              numerical_features
          )
          multimodal_features.append(numerical_features)
  
      multimodal_features = torch.cat(multimodal_features, dim=1)
      multimodal_features = self.cls_token(multimodal_features)
      features = self.transformer(multimodal_features)
      logits = self.head(features)
  
      if self.pooling_mode == "cls":
          features = features[:, -1, :]
      elif self.pooling_mode == "mean":
          features = features.mean(dim=1)
      else:
          raise NotImplementedError(
              f"Pooling mode={self.pooling_mode} is not supported."
          )
  
      output = {
          self.prefix: {
              LOGITS: logits,
              FEATURES: features,
          }
      }
  
      return output
  
imports: from typing import List, Optional
  import torch
  from torch import Tensor, nn
  from ..constants import CATEGORICAL, FEATURES, LABEL, LOGITS, NUMERICAL
  from .custom_transformer import CLSToken, Custom_Transformer, _TokenInitialization
  from .utils import init_weights
label_desc: Use image node_id 6 for calling the FT_Transformer obj's underlying member method code with example usage: obj.forward(batch) and returns: output