JianzhouZhan / Awesome-RecSystem-Models

Implements of Awesome RecSystem Models with PyTorch/TF2.0
MIT License
255 stars 69 forks source link

PNN-tensorflow #1

Closed Snail110 closed 4 years ago

Snail110 commented 4 years ago

I maybe found a bug, in pnn-tensorflow def call(feat_index,feat_value) feat_embedding = self.feat_embeddings(feat_index) # Batch * N * M feat_value is not used,so, I think the feat_embedding layer should * feat_value . the code is

        feat_embedding_0 = self.feat_embeddings(feat_index) # Batch * N * M 
        feat_embedding = tf.einsum('bnm,bn->bnm',feat_embedding_0,feat_value)
        # linear part 
        lz = tf.einsum('bnm,dnm->bd',feat_embedding,self.linear_weights) # Batch * D1
JianzhouZhan commented 4 years ago

According to formula(8) "fi = W0i x[starti : endi]" in paper , the feat_value is not used!

Snail110 commented 4 years ago

no!,if the features is number value, f1 = 1 and f2 =2, if the feat_values are not used, the f1 and f2 is not different. so. feat_value could is used! please see link :https://www.jianshu.com/p/be784ab4abc2

thank you!