Skip to content

A PaddlePaddle implementation of Self-Attentive Sequential Recommendation.

License

Notifications You must be signed in to change notification settings

paddorch/SASRec.paddle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SASRec.paddle

A PaddlePaddle implementation of Self-Attentive Sequential Recommendation.

Introduction

model

论文:Self-Attentive Sequential Recommendation

Results

Datasets Metrics Paper's Ours abs. improv.
MovieLens-1m HIT@10 0.8245 0.8255 0.0010
MovieLens-1m NDCG@10 0.5905 0.5947 0.0042

Requirement

  • Python >= 3
  • PaddlePaddle >= 2.0.0
  • see requirements.txt

Dataset

dataset

本次实验中,我们采用了原作者处理后的数据集,剔除了活动次数少于 5 的用户记录,清洗后格式后<user id, item id>,以user id为第一关键字、time为第二关键字排序。

Usage

Train

bash train.sh

Download Trained model

SASRec model

将模型分别放置于 output 目录下,如下运行 eval bash 脚本即可测试模型。

Test

bash eval.sh

可以得到如下结果:

result

模型在 200 epochs 左右收敛,继续训练性能会有小幅提升。

Details

  1. 原文中的LayerNorm层为MultiHeadAttentionPoint-wise FFN的前置,实验证明后置模型性能更优,这也与Transformer原始架构相符。
  2. 原文优化器为Adam,使用AdamW获得了更好的收敛效果。

References

@misc{kang2018selfattentive,
      title={Self-Attentive Sequential Recommendation}, 
      author={Wang-Cheng Kang and Julian McAuley},
      year={2018},
      eprint={1808.09781},
      archivePrefix={arXiv},
      primaryClass={cs.IR}
}

About

A PaddlePaddle implementation of Self-Attentive Sequential Recommendation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published