georgian-io / Multimodal-Toolkit

Multimodal model for text and tabular data with HuggingFace transformers as building block for text data
https://multimodal-toolkit.readthedocs.io
Apache License 2.0
587 stars 84 forks source link

Combine Method : attention_on_cat_and_numerical_feats #11

Closed avmodi closed 1 year ago

avmodi commented 2 years ago

There is a minor code bug in attention_on_cat_and_numerical_feats combine method.

        if numerical_feats.shape[1] != 0:
            if self.numerical_feat_dim > self.text_out_dim:
                numerical_feats = self.num_mlp(numerical_feats)
            w_num = torch.mm(numerical_feats, self.weight_num)
            g_num = (torch.cat([w_text, **w_cat**], dim=-1) * self.weight_a).sum(dim=1).unsqueeze(0).T

_w_cat should be wnum

akashsaravanan-georgian commented 1 year ago

Closing as this is a duplicate of #9.