SASRec: Self-Attentive Sequential Recommendation
This is our TensorFlow implementation for the paper:
Wang-Cheng Kang, Julian McAuley. Self-Attentive Sequential Recommendation. In Proceedings of IEEE International Conference on Data Mining (ICDM'18)
Please cite our paper if you use the code or datasets.
The code is tested under a Linux desktop (w/ GTX 1080 Ti GPU) with TensorFlow 1.2.
The preprocessed datasets are included in the repo (
e.g. data/Video.txt), where each line contains an
user id and
item id (starting from 1) meaning an interaction (sorted by timestamp).
The data pre-processing script is also included. For example, you could download Amazon review data from here., and run the script to produce the
txt format data.
To train our model on
Video (with default hyper-parameters):
python main.py --dataset=Video --train_dir=default
python main.py --dataset=ml-1m --train_dir=default --maxlen=200 --dropout_rate=0.2
The implemention of self attention is modified based on this
The convergence curve on
ml-1m, compared with CNN/RNN based approaches: