sasrec.pytorch

PyTorch(1.6+) implementation of https://github.com/kang205/SASRec

https://github.com/pmixer/sasrec.pytorch

Science Score: 64.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Committers with academic emails
    1 of 4 committers (25.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.9%) to scientific vocabulary

Keywords

pytorch recommender-system sasrec sequential-models
Last synced: 6 months ago · JSON representation ·

Repository

PyTorch(1.6+) implementation of https://github.com/kang205/SASRec

Basic Info
  • Host: GitHub
  • Owner: pmixer
  • License: apache-2.0
  • Language: TeX
  • Default Branch: main
  • Homepage:
  • Size: 19.8 MB
Statistics
  • Stars: 426
  • Watchers: 5
  • Forks: 103
  • Open Issues: 33
  • Releases: 0
Topics
pytorch recommender-system sasrec sequential-models
Created over 5 years ago · Last pushed 9 months ago
Metadata Files
Readme License Citation

README.md

update on 05/23/2025: thx to Wentworth1028 and Tiny-Snow, we have LayerNorm update, for higher NDCG&HR, and here's the doc👍.

update on 04/13/2025: in https://arxiv.org/html/2504.09596v1, I listed the ideas worth to try but not yet due to my limited bandwidth in sparse time.

pls feel free to do these experiments to have fun, and pls consider citing the article if it somehow helps in your recsys exploration:

@article{huang2025revisiting_sasrec, title={Revisiting Self-Attentive Sequential Recommendation}, author={Huang, Zan}, journal={CoRR}, volume={abs/2504.09596}, url={https://arxiv.org/abs/2504.09596}, eprinttype={arXiv}, eprint={2504.09596}, year={2025} }

or this bib for short

@article{huang2025revisiting, title={Revisiting Self-Attentive Sequential Recommendation}, author={Huang, Zan}, journal={arXiv preprint arXiv:2504.09596}, year={2025} }

paper source code in latex folder.

for questions or collaborations, pls create a new issue in this repo or drop me an email using the email address as shared.


modified based on paper author's tensorflow implementation, switching to PyTorch(v1.6) for simplicity, fixed issues like positional embedding usage etc. (making it harder to overfit, except for that, in recsys, personalization=overfitting sometimes)

code in python folder.

to train:

python main.py --dataset=ml-1m --train_dir=default --maxlen=200 --dropout_rate=0.2 --device=cuda

just inference:

``` python main.py --device=cuda --dataset=ml-1m --traindir=default --statedictpath='ml-1mdefault/SASRec.epoch=1000.lr=0.001.layer=2.head=1.hidden=50.maxlen=200.pth' --inference_only=true --maxlen=200

```

output for each run would be slightly random, as negative samples are randomly sampled, here's my output for two consecutive runs:

1st run - test (NDCG@10: 0.5897, HR@10: 0.8190) 2nd run - test (NDCG@10: 0.5918, HR@10: 0.8225)

pls check paper author's repo for detailed intro and more complete README, and here's the paper bib FYI :)

@inproceedings{kang2018self, title={Self-attentive sequential recommendation}, author={Kang, Wang-Cheng and McAuley, Julian}, booktitle={2018 IEEE International Conference on Data Mining (ICDM)}, pages={197--206}, year={2018}, organization={IEEE} }

I see a dozen of citations of the repo recently🫰, here's the repo bib if needed. @software{Huang_SASRec_pytorch, author = {Huang, Zan}, title = {PyTorch implementation for SASRec}, url = {https://github.com/pmixer/SASRec.pytorch}, year={2020} }

Owner

  • Name: 黄(Huáng)瓒(Zàn)
  • Login: pmixer
  • Kind: user
  • Location: Atlanta, USA
  • Company: Georgia Institute of Technology

Time tourist, having fun in between Math&Physics using Python&CUDA

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: SASRec.pytorch
message: the pytorch implementation of SASRec model
type: software
authors:
  - given-names: Zan
    family-names: Huang
    email: dreaming_hz@hotmail.com
    affiliation: NVIDIA
    orcid: 'https://orcid.org/0000-0003-3585-9467'
identifiers:
  - type: url
    value: 'https://github.com/pmixer/SASRec.pytorch'
    description: SASRec.pytorch github repository
repository-code: 'https://github.com/pmixer/SASRec.pytorch'

GitHub Events

Total
  • Issues event: 4
  • Watch event: 111
  • Delete event: 1
  • Issue comment event: 21
  • Push event: 7
  • Pull request event: 2
  • Fork event: 20
  • Create event: 1
Last Year
  • Issues event: 4
  • Watch event: 111
  • Delete event: 1
  • Issue comment event: 21
  • Push event: 7
  • Pull request event: 2
  • Fork event: 20
  • Create event: 1

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 38
  • Total Committers: 4
  • Avg Commits per committer: 9.5
  • Development Distribution Score (DDS): 0.105
Past Year
  • Commits: 18
  • Committers: 3
  • Avg Commits per committer: 6.0
  • Development Distribution Score (DDS): 0.167
Top Committers
Name Email Commits
黄(Huáng)瓒(Zàn) 1****r 34
Tiny-Snow f****2@g****m 2
Yue Pan 3****2@z****n 1
黄瓒 h****n@k****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 9 months ago

All Time
  • Total issues: 46
  • Total pull requests: 2
  • Average time to close issues: 17 days
  • Average time to close pull requests: about 1 hour
  • Total issue authors: 37
  • Total pull request authors: 2
  • Average comments per issue: 2.78
  • Average comments per pull request: 1.5
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 7
  • Pull requests: 1
  • Average time to close issues: 6 days
  • Average time to close pull requests: about 2 hours
  • Issue authors: 7
  • Pull request authors: 1
  • Average comments per issue: 3.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • pmixer (4)
  • jeffreymei (3)
  • seanswyi (3)
  • Sharkchili-Z (3)
  • shanian (1)
  • Jannie0504 (1)
  • RealHanYing (1)
  • Ruoyan-Zhao (1)
  • BLUE811420 (1)
  • shadowfall09 (1)
  • p501501 (1)
  • Sandy4321 (1)
  • BEbillionaireUSD (1)
  • PanYZhu (1)
  • EricaCoppolillo (1)
Pull Request Authors
  • Tiny-Snow (2)
  • RyuShige (1)
Top Labels
Issue Labels
documentation (4) question (4) bug (1) enhancement (1)
Pull Request Labels

Dependencies

rust/Cargo.lock cargo
  • 134 dependencies
rust/Cargo.toml cargo