{"id":19421464,"url":"https://github.com/pmixer/sasrec.pytorch","last_synced_at":"2025-04-08T11:16:11.159Z","repository":{"id":37707368,"uuid":"294559417","full_name":"pmixer/SASRec.pytorch","owner":"pmixer","description":"PyTorch(1.6+) implementation of https://github.com/kang205/SASRec","archived":false,"fork":false,"pushed_at":"2024-10-14T09:02:19.000Z","size":20716,"stargazers_count":400,"open_issues_count":30,"forks_count":100,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-01T10:13:16.707Z","etag":null,"topics":["pytorch","recommender-system","sasrec","sequential-models"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pmixer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-11T01:08:32.000Z","updated_at":"2025-04-01T07:27:01.000Z","dependencies_parsed_at":"2024-11-24T15:11:19.366Z","dependency_job_id":null,"html_url":"https://github.com/pmixer/SASRec.pytorch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmixer%2FSASRec.pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmixer%2FSASRec.pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmixer%2FSASRec.pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmixer%2FSASRec.pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pmixer","download_url":"https://codeload.github.com/pmixer/SASRec.pytorch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247829512,"owners_count":21002997,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pytorch","recommender-system","sasrec","sequential-models"],"created_at":"2024-11-10T13:28:24.908Z","updated_at":"2025-04-08T11:16:11.115Z","avatar_url":"https://github.com/pmixer.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"modified based on [paper author's tensorflow implementation](https://github.com/kang205/SASRec), 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)\n\nto train:\n\n```\npython main.py --dataset=ml-1m --train_dir=default --maxlen=200 --dropout_rate=0.2 --device=cuda\n```\n\njust inference:\n\n```\npython main.py --device=cuda --dataset=ml-1m --train_dir=default --state_dict_path='ml-1m_default/SASRec.epoch=1000.lr=0.001.layer=2.head=1.hidden=50.maxlen=200.pth' --inference_only=true --maxlen=200\n\n```\n\noutput for each run would be slightly random, as negative samples are randomly sampled, here's my output for two consecutive runs:\n\n```\n1st run - test (NDCG@10: 0.5897, HR@10: 0.8190)\n2nd run - test (NDCG@10: 0.5918, HR@10: 0.8225)\n```\n\npls check paper author's [repo](https://github.com/kang205/SASRec) for detailed intro and more complete README, and here's the paper bib FYI :)\n\n```\n@inproceedings{kang2018self,\n  title={Self-attentive sequential recommendation},\n  author={Kang, Wang-Cheng and McAuley, Julian},\n  booktitle={2018 IEEE International Conference on Data Mining (ICDM)},\n  pages={197--206},\n  year={2018},\n  organization={IEEE}\n}\n```\n\nI see a dozen of citations of the repo recently🫰, here's the repo bib if needed.\n```\n@software{Huang_SASRec_pytorch,\nauthor = {Huang, Zan},\ntitle = {PyTorch implementation for SASRec},\nurl = {https://github.com/pmixer/SASRec.pytorch},\nyear={2020}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmixer%2Fsasrec.pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpmixer%2Fsasrec.pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmixer%2Fsasrec.pytorch/lists"}