The source code for our WWW 2022 Paper "Filter-enhanced MLP is All You Need for Sequential Recommendation"
FMLP-Rec stacks multiple Filter-enhanced Blocks to produce the representation of sequential user preference for recommendation. The key difference between our approach and SASRec is to replace the multi-head self-attention structure in Transformer with a novel filter structure. You can transform FMLP-Rec to SASRec, by adding --no_filters
parameter when running code.
We use eight datasets in our paper, all of which have been uploaded to Google Drive and Baidu Netdisk.
The downloaded dataset should be placed in the data
folder, furthermore, session-based dataset should be placed in a folder named after the dataset.
If you want to use your own dataset, please follow the steps below:
YOUR_DATASTES_sample.txt
. For session-based dataset, only validation set and test set need to be sampled.data
folder. For session-based dataset, a folder named after the dataset is needed.If you have downloaded the source codes, you can train the model just with data_name input.
python main.py --data_name=[data_name]
If you want to change the parameters, just set the additional command parameters as you need. For example:
python main.py --data_name=Beauty --num_hidden_layers=4 --batch_size=512
You can also test the model has been saved by command line.
python main.py --data_name=Beauty --do_eval --load_model=FMLPRec-Beauty-4eval
Additional hyper-parameters can be specified, and detailed information can be accessed by:
python main.py --help
If you have any questions for our paper or codes, please send an email to ishyu@outlook.com.
Our code is developed based on S3-Rec*