class_docstr: Enables different values in a categorical features to have different embeddings.
class_docstr_tok: ["Enables","different","values","in","a","categorical","features","to","have","different","embeddings","."]
code: def __init__(
      self,
      continuous_dim: int,
      categorical_embedding_dims: Tuple[int, int],
      max_onehot_cardinality: int = 4,
      embedding_dropout: float = 0.0,
      batch_norm_continuous_input: bool = False,
      virtual_batch_size: int = None,
  ):
      super().__init__()
      self.continuous_dim = continuous_dim
      self.categorical_embedding_dims = categorical_embedding_dims
      self.categorical_dim = len(categorical_embedding_dims)
      self.batch_norm_continuous_input = batch_norm_continuous_input
  
      binary_feat_idx = []
      onehot_feat_idx = []
      embedding_feat_idx = []
      embd_layers = {}
      one_hot_layers = {}
      for i, (cardinality, embed_dim) in enumerate(
          categorical_embedding_dims
      ):
          # conditions based on enhanced cardinality (including missing/new value placeholder)
          if cardinality == 2:
              binary_feat_idx.append(i)
          elif cardinality <= max_onehot_cardinality:
              onehot_feat_idx.append(i)
              one_hot_layers[str(i)] = OneHot(cardinality)
          else:
              embedding_feat_idx.append(i)
              embd_layers[str(i)] = nn.Embedding(cardinality, embed_dim)
  
      if self.categorical_dim > 0:
          # Embedding layers
          self.embedding_layer = nn.ModuleDict(embd_layers)
          self.one_hot_layers = nn.ModuleDict(one_hot_layers)
      self._onehot_feat_idx = onehot_feat_idx
      self._binary_feat_idx = binary_feat_idx
      self._embedding_feat_idx = embedding_feat_idx
  
      if embedding_dropout > 0 and len(embedding_feat_idx) > 0:
          self.embd_dropout = nn.Dropout(embedding_dropout)
      else:
          self.embd_dropout = None
      # Continuous Layers
      if batch_norm_continuous_input:
          self.normalizing_batch_norm = BatchNorm1d(
              continuous_dim, virtual_batch_size
          )
  
file_path: pytorch_tabular/src/pytorch_tabular/ssl_models/common/layers.py
imports: from collections import OrderedDict
  from typing import Any, Dict, Tuple
  import torch
  from torch import nn
  from pytorch_tabular.models.common.layers.batch_norm import BatchNorm1d
  from pytorch_tabular.ssl_models.common.utils import OneHot
label_desc: Use image node_id 1 to create a new MixedEmbedding1dLayer object from inherited base classes: nn with example: obj = MixedEmbedding1dLayer(continuous_dim, categorical_embedding_dims, max_onehot_cardinality, embedding_dropout, batch_norm_continuous_input, virtual_batch_size)