Open jerry-rubikloud opened 5 years ago
Hi @jerry-rubikloud !
I think that we need to implement 2 components:
1) BPRSampler. It will generate pairs from source data and put them into batch. Example: for N pairs we will have a batch with N2 samples (`2 i-th are _winners_,
2 i + 1`-th are losers)
2) BRPLoss. It will take expanded batch output ([2N, 1]), convert it to pairs ([N, 2]) and calculate resulting loss.
This design seems to be easy for implementation and allows to keep FM core routine unchanged
Hi there, I'm thinking of contributing codes for BPR. What is the best way to extend the code to handle this optimization in your opinion?