Skip to content

Commit

Permalink
FM in recall
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangruiskyline committed Mar 24, 2019
1 parent 5bd3dd2 commit c586b8c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
Binary file modified .DS_Store
Binary file not shown.
24 changes: 20 additions & 4 deletions doc/Search.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
- [Performance Analysis](#performance-analysis)
- [Multiple Recall vs Unified Recall](#multiple-recall-vs-unified-recall)
- [FM as unified recall](#fm-as-unified-recall)
- [Simple versuibn](#simple-versuibn)
- [Simple version](#simple-version)
- [More complete version with context](#more-complete-version-with-context)
- [with context](#with-context)
- [Re-Ranking](#re-ranking)
- [balance between recall/precision](#balance-between-recallprecision)
Expand Down Expand Up @@ -315,7 +316,7 @@ Mutiple recall needs to adjusts the super parameter how many recall do we use. b

### FM as unified recall

#### Simple versuibn
#### Simple version

we can use the simple FM recall version as

Expand All @@ -328,15 +329,30 @@ we can use the simple FM recall version as

* calculate all the sub set of user embedding vectors
* calculate all the sub set of item embedding vectors
* dot product of them
* Store all those embedding vector in a K/V store/cache

2. Step2: Online serving

* When user login in/request comes. get the user vector from cache, then apply dotproduct similar to item vector in K/V store. calculating the dot-product and rank the Top K items (via some lib like Facebook FAISS)

![simple_FM1](https://github.com/zhangruiskyline/DeepLearning_Intro/blob/master/img/simple_FM1.jpg)

![simple_FM2](https://github.com/zhangruiskyline/DeepLearning_Intro/blob/master/img/simple_FM2.jpg)


From Math point of view, it is equal to that
3. Model analysis

First, we add up all user vectors and item vectors and then do the product, is it equal to FM model?

![math_FM](https://github.com/zhangruiskyline/DeepLearning_Intro/blob/master/img/Math_FM.jpg)

* From math point of view, it is same as FM similipication, calculate all sum of embeddeing vector then apply dot product of __<V,V>__ , the difference is only that right now we have both user and item vectors.

#### More complete version with context

The challenge for context information is it needs to be processed in real time or near real time.




#### with context
Expand Down
Binary file added img/Math_FM.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c586b8c

Please sign in to comment.