Giter Site home page Giter Site logo

wangzhen38 / sasrec.paddle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from paddorch/sasrec.paddle

0.0 0.0 0.0 2.68 MB

A PaddlePaddle implementation of Self-Attentive Sequential Recommendation.

License: Apache License 2.0

Shell 1.84% Python 98.16%

sasrec.paddle's Introduction

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}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.