shenweichen / DeepCTR-Torch

【PyTorch】Easy-to-use,Modular and Extendible package of deep-learning based CTR models.
https://deepctr-torch.readthedocs.io/en/latest/index.html
Apache License 2.0
3k stars 703 forks source link

请问deepfm中二阶交叉是不是没对dense层进行交叉呀 #241

Closed downeykking closed 2 years ago

downeykking commented 2 years ago

Please refer to the FAQ in doc and search for the related issues before you ask the question.

Describe the question(问题描述) A clear and concise description of what the question is.

Additional context code如下 ` def forward(self, X):

    sparse_embedding_list, dense_value_list = self.input_from_feature_columns(X, self.dnn_feature_columns,
                                                                              self.embedding_dict)
    logit = self.linear_model(X)

    if self.use_fm and len(sparse_embedding_list) > 0:
        fm_input = torch.cat(sparse_embedding_list, dim=1)
        logit += self.fm(fm_input)

    if self.use_dnn:
        dnn_input = combined_dnn_input(
            sparse_embedding_list, dense_value_list)
        dnn_output = self.dnn(dnn_input)
        dnn_logit = self.dnn_linear(dnn_output)
        logit += dnn_logit

    y_pred = self.out(logit)

    return y_pred`

Operating environment(运行环境):

wsh3776 commented 2 years ago

是的,只对稀疏特征的Embedding向量进行二阶交叉

downeykking commented 2 years ago

是的,只对稀疏特征的Embedding向量进行二阶交叉

thanks~