Giter Club home page Giter Club logo

fmlp-rec's Introduction

FMLP-Rec

The source code for our WWW 2022 Paper "Filter-enhanced MLP is All You Need for Sequential Recommendation"

Requirements

  • Install Python, Pytorch(>=1.8). We use Python 3.7, Pytorch 1.8.
  • If you plan to use GPU computation, install CUDA.

Overview

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.

avatar

Datasets

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:

  1. Prepare a file with user_ids and each follows 99 negative samples, and name it with YOUR_DATASTES_sample.txt. For session-based dataset, only validation set and test set need to be sampled.
  2. Place your dataset and sample file in the data folder. For session-based dataset, a folder named after the dataset is needed.
  3. Add the name of your dataset to the data list in utils.py, according to the data type.

Quick-Start

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

Contact

If you have any questions for our paper or codes, please send an email to [email protected].

Acknowledgement

Our code is developed based on S3-Rec*

fmlp-rec's People

Contributors

woeee avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.