class_docstr: Transformer model for tabular data, can also be used for semi-supervised learning.
  This is the internal transformer model embedding that will have further fully connected layers (TabNet) to
  actually produce predictions.
code: def __init__(
      self,
      n_cont_embeddings,
      n_layers,
      n_heads,
      hidden_dim,
      tab_readout,
      column_embedding,
      orig_emb_resid,
      fix_attention,
      n_shared_embs=8,
      shared_embedding_added=False,
      **kwargs,
  ):
      super().__init__(
          n_cont_features=kwargs["n_cont_features"],
          norm_class_name=kwargs["norm_class_name"],
          cat_feat_origin_cards=kwargs["cat_feat_origin_cards"],
          max_emb_dim=kwargs["max_emb_dim"],
          p_dropout=kwargs["p_dropout"],
          one_hot_embeddings=kwargs["one_hot_embeddings"],
          drop_whole_embeddings=kwargs["drop_whole_embeddings"],
      )
  
      from .modified_transformer import TransformerEncoderLayerModified
  
      self.n_cont_embeddings = n_cont_embeddings
      self.hidden_dim = hidden_dim
      self.readout = tab_readout
      self.orig_emb_resid = orig_emb_resid
  
      # Overwriting some TabModelBase options
  
      self.cat_initializers = nn.ModuleDict()
      if isinstance(self.cat_feat_origin_cards, list):
          self.n_embeddings = len(self.cat_feat_origin_cards) + (
              n_cont_embeddings if self.n_cont_features else 0
          )
      else:
          self.n_embeddings = None
  
      self.cat_initializers = nn.ModuleDict()
  
      from .tab_transformer_encoder import EmbeddingInitializer
  
      for col_name, card in self.cat_feat_origin_cards:
          self.cat_initializers[col_name] = EmbeddingInitializer(
              num_embeddings=card,
              max_emb_dim=self.max_emb_dim,
              p_dropout=self.p_dropout,
              minimize_emb_dim=False,
              drop_whole_embeddings=self.drop_whole_embeddings,
              one_hot=False,
              out_dim=self.hidden_dim,
              shared_embedding=column_embedding,
              n_shared_embs=n_shared_embs,
              shared_embedding_added=shared_embedding_added,
          )
      if self.n_cont_features:
          self.cont_norm = self.get_norm(self.n_cont_features)
          self.cont_initializer = nn.Linear(
              self.n_cont_features, hidden_dim * n_cont_embeddings
          )
          self.cont_init_norm = self.get_norm(
              hidden_dim * n_cont_embeddings
          )
  
      if self.readout == "readout_emb":
          self.readout_emb = nn.Parameter(
              torch.zeros(1, hidden_dim).uniform_(-1, 1)
          )  # We do the readout from a learned embedding
          self.n_embeddings += 1
  
      if fix_attention is True:
          self.n_cat_embeddings = len(self.cat_feat_origin_cards)
          self.tfmr_layers = nn.ModuleList(
              [
                  TransformerEncoderLayerModified(
                      d_model=hidden_dim,
                      n_cat_embeddings=self.n_cat_embeddings,
                      nhead=n_heads,
                      dim_feedforward=4 * hidden_dim,
                      dropout=self.p_dropout,
                      activation="gelu",
                  )
                  for _ in range(n_layers)
              ]
          )
      else:
          self.tfmr_layers = nn.ModuleList(
              [
                  nn.TransformerEncoderLayer(
                      d_model=hidden_dim,
                      nhead=n_heads,
                      dim_feedforward=4 * hidden_dim,
                      dropout=self.p_dropout,
                      activation="gelu",
                  )
                  for _ in range(n_layers)
              ]
          )
  
file_path: autogluon/tabular/src/autogluon/tabular/models/tab_transformer/tab_transformer.py
imports: import copy
  import torch
  import torch.nn
  from .tab_model_base import TabModelBase
label_desc: Use image node_id 1 to create a new TabTransformer object from inherited base classes: TabModelBase with example: obj = TabTransformer(n_cont_embeddings, n_layers, n_heads, hidden_dim, tab_readout, column_embedding, orig_emb_resid, fix_attention, n_shared_embs, shared_embedding_added)