rllm.nn.models.TableResNet¶
- class rllm.nn.models.TableResNet(hidden_dim: int, out_dim: int, num_layers: int, metadata: Dict[ColType, List[Dict[str, Any]]], normalization: str | None = 'layer_norm', dropout: float = 0.2)[source]¶
Bases:
ModuleThe ResNet-like TNN introduced in the “Revisiting Deep Learning Models for Tabular Data” paper.
- Parameters:
hidden_dim (int) – The hidden dimension.
out_dim (int) – The output dimension.
num_layers (int) – The number of layers.
metadata (Dict[ColType, List[Dict[str, Any]]]) – The metadata of the table.
normalization (str | None) – The normalization method. (default:
"layer_norm")dropout (float) – The dropout rate. (default:
0.2)
Example
>>> import torch >>> from rllm.nn.models import TableResNet >>> from rllm.types import ColType >>> metadata = {ColType.NUMERICAL: [{"name": "x"}]} >>> model = TableResNet(hidden_dim=64, out_dim=1, num_layers=2, metadata=metadata)