Get started with Recommendation Systems in PyTorch. This repository covers the chapter 16 "Recommender Systems" in the book Dive into Deep Learning.
This repo is tested with Python 3.9 and PyTorch 1.10. For other packages, check requirements.txt
.
For quick setup: pip install -r requirements.txt
Download these dataset and unzip in the root of this directory:
- Overview: no script for this section
- The MovieLens Dataset:
ml100k.py
contains dataloaders used in the following sections. - Matrix Factorization:
mf.py
- AutoRec: Rating Prediction with Autoencoders:
autorec.py
- Personalized Ranking for Recommender Systems:
utils.py
. For now, only the BRP loss function is implemented. - Neural Collaborative Filtering for Personalized Ranking:
neumf.py
- Sequence-Aware Recommender Systems:
caser.py
- Feature-Rich Recommender Systems:
ctr.py
contains dataloaders for CTR dataset - Factorization Machines:
fm.py
- Deep Factorization Machines:
deepfm.py
To train model in sections 3, 4, 6, 7, 9, 10, simply run python corresponding_script.py
. Some hyperparameters like batch size, embedding dimension, etc. can be modified by arguments.
To check the training progress, run tensorboard --logdir lightning_logs