librec icon indicating copy to clipboard operation
librec copied to clipboard

Update FMSGDRecommender gradient equation

Open sunbuhui opened this issue 3 years ago • 2 comments

image

Factorization Machines https://www.csie.ntu.edu.tw/~b97053/paper/Rendle2010FM.pdf

The old code implements gradient equation via run (if i !=j) everytime , so it will do this if-statement n time. According to the "Factorization Machines" paper's gradient equation part , we can sum them all and minus the redundant condition when i = j. It only computes twice.

I have done a small java test, it can faster the program surely when the 'n' is big. But i haven't done a unit-test in librec, i think the update is rather small, maybe it is not necessary. If it is needed, i will fill it soon.

sunbuhui avatar Oct 22 '20 08:10 sunbuhui

@wangyufengkevin I have checked the git commit log, it seems to be your code. Can you help me review it

sunbuhui avatar Oct 22 '20 08:10 sunbuhui

Definitely it's faster:)

sunbuhui avatar May 21 '21 13:05 sunbuhui