tffm icon indicating copy to clipboard operation
tffm copied to clipboard

Support for Bayesian Personalized Ranking

Open jerry-rubikloud opened this issue 5 years ago • 1 comments

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?

jerry-rubikloud avatar Feb 16 '19 00:02 jerry-rubikloud

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 N*2 samples (2 * i-th are winners, 2 * i + 1-th are losers)
  2. BRPLoss. It will take expanded batch output ([2*N, 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

geffy avatar Feb 17 '19 09:02 geffy