Skip to content
CosRec: 2D Convolutional Neural Networks for Sequential Recommendation
Python
Branch: master
Clone or download
Latest commit 48513a1 Aug 31, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
data Init. Aug 23, 2019
LICENSE Initial commit Aug 23, 2019
README.md Update readme. Sep 1, 2019
evaluation.py Init. Aug 23, 2019
interactions.py Init. Aug 23, 2019
model.py Init. Aug 23, 2019
model_base.py Init. Aug 23, 2019
train.py Init. Aug 23, 2019
utils.py Init. Aug 23, 2019

README.md

CosRec: 2D Convolutional Neural Networks for Sequential Recommendation

This is our PyTorch implementation for the paper:

CosRec: 2D Convolutional Neural Networks for Sequential Recommendation, CIKM-2019

[arXiv] [GitHub]

The code is tested on a Linux server (w/ NVIDIA GeForce Titan X Pascal) with PyTorch 1.1.0 and Python 3.7.

Requirements

  • Python 3
  • PyTorch v1.0+ (v0.4+ might also work)

Training

To train our model on ml1m (with default hyper-parameters):

python train.py --dataset=ml1m

or on gowalla (change a few hyper-paras based on dataset statistics):

python train.py --dataset=gowalla --d=100 --fc_dim=50 --l2=1e-6

You should be able to obtain MAPs of ~0.188 and ~0.098 on ML-1M and Gowalla respectively, with the above settings.

Datasets

  • Datasets are organized into 2 separate files: train.txt and test.txt

  • Same as other data format for recommendation, each file contains a collection of triplets:

    user item rating

    The only difference is the triplets are organized in time order.

  • As the problem is Sequential Recommendation, the rating doesn't matter, so we convert them all to 1.

Citation

If you find this repository useful, please cite our paper:

@article{yan2019cosrec,
  title={CosRec: 2D Convolutional Neural Networks for Sequential Recommendation},
  author={Yan, An and Cheng, Shuo and Kang, Wang-Cheng and Wan, Mengting and McAuley, Julian},
  journal={arXiv preprint arXiv:1908.09972},
  year={2019}
}

Acknowledgments

This project is built on top of Spotlight and Caser. Thanks Maciej and Jiaxi for their contributions to the community.

You can’t perform that action at this time.