Recommend-System-tf2.0 icon indicating copy to clipboard operation
Recommend-System-tf2.0 copied to clipboard

AFM的实现中特征交叉层只用了一部分的特征做特征交叉

Open himiko14122 opened this issue 2 years ago • 1 comments

您好,我看了AFM的实现代码,在layer.py中第70行将输入划分为dense_inputs和sparse_inputs,但是在后续的interaction_layer中只使用了sparse_inputs的embedding来做特征交叉,dense_inputs在后续的流程中完全没有用到,这里不是应该将dense_inputs和sparse_inputs的embedding都用来做特征交叉吗?

himiko14122 avatar Dec 30 '21 02:12 himiko14122

您好,我看了AFM的实现代码,在layer.py中第70行将输入划分为dense_inputs和sparse_inputs,但是在后续的interaction_layer中只使用了sparse_inputs的embedding来做特征交叉,dense_inputs在后续的流程中完全没有用到,这里不是应该将dense_inputs和sparse_inputs的embedding都用来做特征交叉吗?

要让dense_inputs也参与交叉的话,需要先做embedding,维度跟sparse_inputs的embedding保持一样,然后concat在一起做特征交叉即可。

jc-LeeHub avatar Dec 31 '21 06:12 jc-LeeHub