/CF-with-CL

contrastive learning based collaborative filtering model to address challenges such as data sparsity, scalability, and the cold- start problem

Primary LanguageJupyter Notebook

This repository contains PyTorch evaluation code, training code and pretrained models for Collaborative Filtering with Contrastive Learning.

For details see Collaborative Filtering with Contrastive Learning by Hawon Jeong, Saemee Choi, Sohyun Jeong.

WCL

Data preprocessing

To run the code, you probably need to add datasets in data/dataset/ and run following ipynb.

notebooks/store_features_task1.ipynb
notebooks/store_features_task2.ipynb

Train

python train.py --gpu_ids 1 --dataset task1
python train.py --gpu_ids 1 --dataset task2

Pre-trained weights

BatchSize Epochs Task
WCL 256 20 task1
WCL 256 20 task2

Visualize

notebooks/DM_visualize_representation_sample_label.ipynb
notebooks/DM_visualize_representation_without_label.ipynb

Baseline

/baselines/task1_vanilla_cf.ipynb
/baselines/task2_vanilla_cf.ipynb

If you want to test the pretained model, please download the weights from the link above, and move it to the checkpoints folder (create one if you don't have .checkpoints/ directory).