tensorflow-DeepFM icon indicating copy to clipboard operation
tensorflow-DeepFM copied to clipboard

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

Open Wang-Yu-Qing opened this issue 4 years ago • 2 comments
trafficstars

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))

Wang-Yu-Qing avatar Sep 26 '21 01:09 Wang-Yu-Qing

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.

nkqiaolin avatar Mar 10 '22 02:03 nkqiaolin

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

alpha008 avatar Mar 10 '22 02:03 alpha008