Source code for Twitter's Recommendation Algorithm
Go to file
Darshan P 1c0d0499ff Early exit
used the any function to short-circuit the loop as soon as an empty tensor is found.
2023-04-03 16:00:13 +00:00
.github/workflows Twitter's Recommendation Algorithm - Heavy Ranker and TwHIN embeddings 2023-03-31 13:05:14 -05:00
common Twitter's Recommendation Algorithm - Heavy Ranker and TwHIN embeddings 2023-03-31 13:05:14 -05:00
core Early exit 2023-04-03 16:00:13 +00:00
images Twitter's Recommendation Algorithm - Heavy Ranker and TwHIN embeddings 2023-03-31 13:05:14 -05:00
machines Twitter's Recommendation Algorithm - Heavy Ranker and TwHIN embeddings 2023-03-31 13:05:14 -05:00
metrics Twitter's Recommendation Algorithm - Heavy Ranker and TwHIN embeddings 2023-03-31 13:05:14 -05:00
ml_logging Refactored rank-specific logger 2023-04-02 18:19:39 +00:00
optimizers escaped conditional trap with for loop 2023-04-02 20:30:06 +00:00
projects Twitter's Recommendation Algorithm - Heavy Ranker and TwHIN embeddings 2023-03-31 13:05:14 -05:00
reader Twitter's Recommendation Algorithm - Heavy Ranker and TwHIN embeddings 2023-03-31 13:05:14 -05:00
tools Twitter's Recommendation Algorithm - Heavy Ranker and TwHIN embeddings 2023-03-31 13:05:14 -05:00
.gitignore Twitter's Recommendation Algorithm - Heavy Ranker and TwHIN embeddings 2023-03-31 13:05:14 -05:00
.pre-commit-config.yaml Twitter's Recommendation Algorithm - Heavy Ranker and TwHIN embeddings 2023-03-31 13:05:14 -05:00
COPYING Twitter's Recommendation Algorithm - Heavy Ranker and TwHIN embeddings 2023-03-31 13:05:14 -05:00
LICENSE.torchrec Twitter's Recommendation Algorithm - Heavy Ranker and TwHIN embeddings 2023-03-31 13:05:14 -05:00
model.py Twitter's Recommendation Algorithm - Heavy Ranker and TwHIN embeddings 2023-03-31 13:05:14 -05:00
pyproject.toml Twitter's Recommendation Algorithm - Heavy Ranker and TwHIN embeddings 2023-03-31 13:05:14 -05:00
README.md Twitter's Recommendation Algorithm - Heavy Ranker and TwHIN embeddings 2023-03-31 13:05:14 -05:00

This project open sources some of the ML models used at Twitter.

Currently these are:

  1. The "For You" Heavy Ranker (projects/home/recap).

  2. TwHIN embeddings (projects/twhin) https://arxiv.org/abs/2202.05387

This project can be run inside a python virtualenv. We have only tried this on Linux machines and because we use torchrec it works best with an Nvidia GPU. To setup run

./images/init_venv.sh (Linux only).

The READMEs of each project contain instructions about how to run each project.