torch_frame.nn.encoder.FeatureEncoder
- class FeatureEncoder(*args, **kwargs)[source]
-
Base class for feature encoder that transforms input
torch_frame.TensorFrameinto(x, col_names), wherexis the colum-wise PyTorch tensor of shape[batch_size, num_cols, channels]andcol_namesis the names of the columns. This class contains learnable parameters and missing value handling.- abstract forward(tf: TensorFrame) tuple[torch.Tensor, list[str]][source]
Encode
TensorFrameobject into a tuple(x, col_names).- Parameters:
tf (
torch_frame.TensorFrame) – InputTensorFrameobject.- Returns:
- A tuple of an output column-wise
torch.Tensorof shape[batch_size, num_cols, hidden_channels]and a list of column names ofx. The length needs to benum_cols.
- Return type:
(torch.Tensor, List[str])