Skip to content

YuchenHui22314/sasrec_next_basket_torch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SASRec for next basket recommendation

This is a pytorch implementation of SASRec for next basket recommendation, as a part of my computer science project at the Université de Montréal.

It is modified based on paper author's tensorflow implementation and another pytorch implementation for next item recommendation. The code is well commented and tested on a internal dataset to validate the correctness, using Pytorch 2.0.0. Here is an exemple Colab notebook for execution.

In next basket recommendation regime, we adapt the model by regarding a basket as an item in the original SASRec model. That is, each basket produces an embedding, and then this embedding is used as the Transformer input, and the transformer output at the same position is used to predict the next basket. A little bit like what GPT does.

We get the basket embedding by taking the average of the item embeddings in the basket. Item embeddings are the same as in the original SASRec model, i.e. a torch.nn.Embedding layer.

Please check paper author's repo and for detailed intro and more complete README, and here's 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}
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages