docstr: Parameters
  ----------
  in_features
      Input feature size.
  embedding_arch
      A list containing the names of embedding layers.
      Currently support:
          {'linear', 'shared_linear', 'autodis', 'positional', 'relu', 'leaky_relu', 'layernorm'}
      To use the embedding schemes summarized in Table 3 of 'On Embeddings for Numerical Features in Tabular Deep Learning' (https://arxiv.org/abs/2203.05556)
      By setting the embedding_arch as follows:
          1. `L`: ['linear']
          2. `LR`: ['linear', 'relu']
          3. `LRLR`: ['linear', 'relu', 'linear', 'relu']
          4. `P`: ['positional']
          5. `PL`: ['positional', 'linear']
          6. `PLR`: ['positional', 'linear', 'relu']
          7. `PLRLR`: ['positional', 'linear', 'relu', 'linear', 'relu']
          8. `AutoDis`: ['autodis']
          9. `Leaky Gates` in [ref.3]: ['linear', 'leaky_relu']
      Notably, in `L` (i.e. embedding_arch=['linear']) for numerical transformer,
      it identical as the original feature_tokenzier in FT_Transformer (c.f. Figure 2.a in https://arxiv.org/pdf/2106.11959.pdf).
  d_embedding:
      Dimension of the embeddings.
      The output shape should be [batch_size, number_of_numerical_featurs, d_embedding]
  memory_efficient:
      Use efficient linear layer scheme if True. Default is False.
  
  Reference:
  ----------
  1. Code: https://github.com/Yura52/tabular-dl-num-embeddings
  2. Paper: On Embeddings for Numerical Features in Tabular Deep Learning, https://arxiv.org/abs/2203.05556
  3. Paper: Simple Modifications to Improve Tabular Neural Networks: https://arxiv.org/pdf/2108.03214
code: def __init__(
      self,
      in_features: int,
      embedding_arch: List[str],
      d_embedding: Optional[int] = None,
      memory_efficient: Optional[bool] = False,
  ):
      """
      Parameters
      ----------
      in_features
          Input feature size.
      embedding_arch
          A list containing the names of embedding layers.
          Currently support:
              {'linear', 'shared_linear', 'autodis', 'positional', 'relu', 'leaky_relu', 'layernorm'}
          To use the embedding schemes summarized in Table 3 of 'On Embeddings for Numerical Features in Tabular Deep Learning' (https://arxiv.org/abs/2203.05556)
          By setting the embedding_arch as follows:
              1. `L`: ['linear']
              2. `LR`: ['linear', 'relu']
              3. `LRLR`: ['linear', 'relu', 'linear', 'relu']
              4. `P`: ['positional']
              5. `PL`: ['positional', 'linear']
              6. `PLR`: ['positional', 'linear', 'relu']
              7. `PLRLR`: ['positional', 'linear', 'relu', 'linear', 'relu']
              8. `AutoDis`: ['autodis']
              9. `Leaky Gates` in [ref.3]: ['linear', 'leaky_relu']
          Notably, in `L` (i.e. embedding_arch=['linear']) for numerical transformer,
          it identical as the original feature_tokenzier in FT_Transformer (c.f. Figure 2.a in https://arxiv.org/pdf/2106.11959.pdf).
      d_embedding:
          Dimension of the embeddings.
          The output shape should be [batch_size, number_of_numerical_featurs, d_embedding]
      memory_efficient:
          Use efficient linear layer scheme if True. Default is False.
  
      Reference:
      ----------
      1. Code: https://github.com/Yura52/tabular-dl-num-embeddings
      2. Paper: On Embeddings for Numerical Features in Tabular Deep Learning, https://arxiv.org/abs/2203.05556
      3. Paper: Simple Modifications to Improve Tabular Neural Networks: https://arxiv.org/pdf/2108.03214
      """
  
      super().__init__()
      assert embedding_arch
      assert set(embedding_arch) <= {
          "linear",
          "shared_linear",
          "autodis",
          "positional",
          "relu",
          "leaky_relu",
          "layernorm",
      }
  
      if any(
          x in embedding_arch
          for x in ["linear", "shared_linear", "autodis"]
      ):
          assert d_embedding is not None
  
      assert embedding_arch.count("positional") <= 1
  
      if "autodis" in embedding_arch:
          embedding_arch = ["autodis"]
  
      NLinear_ = NLinearMemoryEfficient if memory_efficient else NLinear
      layers: list[nn.Module] = []
  
      if embedding_arch[0] == "linear":
          layers.append(
              NumericalFeatureTokenizer(
                  in_features=in_features,
                  d_token=d_embedding,
                  bias=True,
                  initialization="normal",
              )
          )
      elif embedding_arch[0] == "positional":
          layers.append(
              Periodic(
                  in_features=in_features,
                  d_embedding=d_embedding,
                  trainable=True,
                  initialization="normal",
                  sigma=1.0,
              )
          )
      elif embedding_arch[0] == "autodis":
          layers.append(
              AutoDis(
                  in_features=in_features,
                  d_embedding=d_embedding,
                  n_meta_embeddings=d_embedding,
                  temperature=3.0,
              )
          )
      else:
          layers.append(
              nn.Identity(),
          )
  
      for x in embedding_arch[1:]:
          layers.append(
              nn.ReLU()
              if x == "relu"
              else nn.LeakyReLU()
              if x == "leaky_relu"
              else NLinear_(in_features, d_embedding, d_embedding)
              if x == "linear"
              else nn.Linear(d_embedding, d_embedding)
              if x == "shared_linear"
              else NLayerNorm(in_features, d_embedding)
              if x == "layernorm"
              else nn.Identity()
          )
  
          assert not isinstance(layers[-1], nn.Identity)
  
      self.d_embedding = d_embedding
      self.in_features = in_features
      self.layers = nn.Sequential(*layers)
  
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 1 to create a new NumEmbeddings object from inherited base classes: nn with example: obj = NumEmbeddings(in_features, embedding_arch, d_embedding, memory_efficient)