class_docstr: Basic model for tabular data.
class_docstr_tok: ["Basic","model","for","tabular","data","."]
code: def __init__(
      self,
      emb_szs: list,  # Sequence of (num_embeddings, embedding_dim) for each categorical variable
      n_cont: int,  # Number of continuous variables
      out_sz: int,  # Number of outputs for final `LinBnDrop` layer
      layers: list,  # Sequence of ints used to specify the input and output size of each `LinBnDrop` layer
      ps: float
      | MutableSequence = None,  # Sequence of dropout probabilities for `LinBnDrop`
      embed_p: float = 0.0,  # Dropout probability for `Embedding` layer
      y_range=None,  # Low and high for `SigmoidRange` activation
      use_bn: bool = True,  # Use `BatchNorm1d` in `LinBnDrop` layers
      bn_final: bool = False,  # Use `BatchNorm1d` on final layer
      bn_cont: bool = True,  # Use `BatchNorm1d` on continuous variables
      act_cls=nn.ReLU(
          inplace=True
      ),  # Activation type for `LinBnDrop` layers
      lin_first: bool = True,  # Linear layer is first or last in `LinBnDrop` layers
  ):
      ps = ifnone(ps, [0] * len(layers))
      if not is_listy(ps):
          ps = [ps] * len(layers)
      self.embeds = nn.ModuleList(
          [Embedding(ni, nf) for ni, nf in emb_szs]
      )
      self.emb_drop = nn.Dropout(embed_p)
      self.bn_cont = nn.BatchNorm1d(n_cont) if bn_cont else None
      n_emb = sum(e.embedding_dim for e in self.embeds)
      self.n_emb, self.n_cont = n_emb, n_cont
      sizes = [n_emb + n_cont] + layers + [out_sz]
      actns = [act_cls for _ in range(len(sizes) - 2)] + [None]
      _layers = [
          LinBnDrop(
              sizes[i],
              sizes[i + 1],
              bn=use_bn and (i != len(actns) - 1 or bn_final),
              p=p,
              act=a,
              lin_first=lin_first,
          )
          for i, (p, a) in enumerate(zip(ps + [0.0], actns))
      ]
      if y_range is not None:
          _layers.append(SigmoidRange(*y_range))
      self.layers = nn.Sequential(*_layers)
  
file_path: fastai/fastai/tabular/model.py
imports: from __future__ import annotations
  from ..torch_basics import *
  from .core import *
label_desc: Use image node_id 1 to create a new TabularModel object from inherited base classes: Module with example: obj = TabularModel(emb_szs, n_cont, out_sz, layers, ps, embed_p, y_range, use_bn, bn_final, bn_cont, act_cls, lin_first)