rixwew / pytorch-fm

Factorization Machine models in PyTorch
MIT License
1.04k stars 225 forks source link

Problems in PNN #5

Closed Drone-Banks closed 5 years ago

Drone-Banks commented 5 years ago

Paper said :

The first hidden layer is fully connected with the product layer. The inputs to it consist of linear signals lz and quadratic signals lp. With respect to lz and lp inputs, separately, the formulation of l1 is: l1 = relu(lz + lp + b1),

But in your code, the linear signals and quadratic signals are concated :

embed_x = self.embedding(x)
cross_term = self.pn(embed_x)
x = torch.cat([embed_x.view(-1, self.embed_output_dim), cross_term], dim=1)
x = self.mlp(x)
return torch.sigmoid(x.squeeze(1))
Drone-Banks commented 5 years ago

I guess that you had confused the output layers of PNN and DCN. @rixwew

rixwew commented 5 years ago

Thank you for your comment! I'll check it.

Drone-Banks commented 5 years ago

Thank you for your comment! I'll check it.

: ) and I created a pull request

rixwew commented 5 years ago

I merged your pr #7 Thank you:)