ChenglongChen / tensorflow-DeepFM

Tensorflow implementation of DeepFM for CTR prediction.
MIT License
2.04k stars 808 forks source link

In DeepFm.py line 102, why the second order term's size is (None, K) rather than (None, )? #78

Open Wang-Yu-Qing opened 3 years ago

Wang-Yu-Qing commented 3 years ago

From the equation (2) in the paper, the second order term should be a scalar. However, in the code, it is computed as a vector. I think the line 102 should be something like this: self.y_second_order = 0.5 * tf.reduce_sum(tf.subtract(self.summed_features_emb_square, self.squared_sum_features_emb))

nkqiaolin commented 2 years ago

IMO, the original paper said each of three components should all be one scalar, then sum together to fed to sigmod() . But you can also treat the sum of scalar as sum(w1x1, w2x2...), and set w1=w2=..=1。In this git repo, the author treat all W as trainable variables, which is an extension to original paper. Although effect of this modification is unknown, this implementation is still following the core ideas of the paper.

alpha008 commented 2 years ago

我是健翔,您的邮件我收到了。