yandex-research / rtdl-num-embeddings

(NeurIPS 2022) On Embeddings for Numerical Features in Tabular Deep Learning
https://arxiv.org/abs/2203.05556
MIT License
269 stars 31 forks source link

About the feature shapes of embeddings in MLP vs FT_Transformer #4

Closed yiqings closed 2 years ago

yiqings commented 2 years ago

Hi, thanks for the codes and insightful paper "On Embeddings for Numerical Features in Tabular Deep Learning".

We few a bit confused about the feature shapes of the embeddings in MLP:

CC: @sxjscience

Thanks very much.

Yura52 commented 2 years ago

Hi! Thanks for your interest in the project!

For all backbones (MLP, ResNet, Transformer), the shape of the tensor after the embedding operation is [batch_size,number_of_numerical_features,dimension_of_embeddings], i.e. ndim=3.

However, for MLP and ResNet, the class FlatModel is selected here, so the embeddings are reshaped to ndim=2 before passing to the model, as can be seen here.

yiqings commented 2 years ago

Thank you @Yura52 so much for the prompt rely, and it helps a lot!