This repo contains our re-implementation and extension of SASRec [1] as well as code to download, process and format the datasets we use in our paper.
In order to get the data, run the notebook and processed datasets will be saved into a data/
directory.
This code a rebuild of this repo https://github.com/kang205/SASRec
Install the requirements.
Run the notebook to download and process the datasets.
In the environment, run the experiments with the commands below.
Param | Description | Example |
---|---|---|
--f-name | File name of interaction dataset | ml-1m |
--shuffle-sequence | Whether to shuffle the input sequences | True or False |
--batch-size | Batch size | 1024 |
--lr | Learning Rate | 0.001 |
--maxlen | Maximum length of sequences | 200 |
--hidden-dim | Hidden Dimension | 100 |
--num-blocks | Number of attention blocks | 2 |
--num-epochs | Number of epochs | 200 |
--num-heads | Number of heads | 2 |
--dropout-rate | Dropout Rate | 0.2 |
--seed | Random Seed | 123 |
--output-metrics-path | Path to save results | 'results/experiment_results.txt' |
python -m sas_rec.experiment --f-name 'ml_1m' --shuffle-sequence False --batch-size 128 --seed 101 --num-epochs 1 --output-metrics-path 'results/experiment_results.txt'
Modified Experiments
python -m sas_rec.modified_experiment --f-name 'ml_1m_rating' --shuffle-sequence False --batch-size 128 --seed 101 --num-epochs 1 --output-metrics-path 'results/experiment_results.txt'
Joint loss experiment on movielens
python -m sas_rec.joint_loss_experiment --f-name 'ml-1m-rating' --shuffle-sequence False --batch-size 128 --seed 101 --num-epochs 20 --output-metrics-path 'results/experiment_results.txt'