torch_frame.nn.encoder.MultiCategoricalEmbeddingEncoder
- class MultiCategoricalEmbeddingEncoder(out_channels: Optional[int] = None, stats_list: Optional[list[dict[torch_frame.data.stats.StatType, Any]]] = None, stype: Optional[stype] = None, post_module: Optional[Module] = None, na_strategy: Optional[NAStrategy] = None, mode: str = 'mean')[source]
Bases:
StypeEncoderAn embedding look-up based encoder for multi_categorical features. It applies
torch.nn.EmbeddingBagfor each categorical feature and concatenates the output embeddings.- Parameters:
mode (str) – “sum”, “mean” or “max”. Specifies the way to reduce the bag. (default:
mean)