Git Product home page Git Product logo

rechorus's Introduction

ReChorus

ReChorus is a general PyTorch framework for Top-K recommendation with implicit feedback, especially for research purpose. It aims to provide a fair benchmark to compare different state-of-the-art algorithms. We hope this can partly alleviate the problem that different papers adopt different experimental settings, so as to form a "Chorus" of recommendation algorithms.

This framework is especially suitable for researchers to compare algorithms under the same experimental setting, and newcomers to get familar with classical methods. The characteristics of our framework can be summarized as follows:

  • Agile: concentrate on your model design in a single file and implement new models quickly
  • Easy: the framework is accomplished in less than a thousand lines of code, which is easy to use with clean codes and adequate comments
  • Efficient: multi-thread batch preparation, special implementations for the evaluation, and around 90% GPU utilization during training for deep models
  • Flexible: implement new readers or runners for different datasets and experimental settings, and each model can be assigned with specific helpers

Generally, ReChorus decomposes the whole process into three modules:

  • Reader: read dataset into DataFrame and append necessary information to each instance
  • Runner: control the training process and model evaluation
  • Model: define how to generate ranking scores and prepare batches

Getting Started

  1. Install Anaconda with Python >= 3.5
  2. Clone the repository and install requirements
git clone https://github.com/THUwangcy/ReChorus.git
cd ReChorus
pip install -r requirements.txt
  1. Run model with build-in dataset
python main.py --model_name BPR --emb_size 64 --lr 1e-3 --lr 1e-6 --dataset Grocery_and_Gourmet_Food
  1. (optional) Run jupyter notebook in data folder to download and build new amazon datasets, or prepare your own datasets according to README in data
  2. (optional) Implement your own models according to README in src

Models

We have implemented the following methods (still updating):

The table below lists the results of these models in Grocery_and_Gourmet_Food dataset (145.8k entries). Leave-one-out is applied to split data: the most recent interaction of each user for testing, the second recent item for validation, and the remaining items for training. We randomly sample 99 negative items for each test case to rank together with the ground-truth item. These settings are all common in Top-K sequential recommendation.

Model HR@5 NDCG@5 Time/iter Sequential Knowledge Time-aware
BPR 0.3554 0.2457 2.5s
NCF 0.3232 0.2234 3.4s
Tensor 0.3548 0.2671 2.8s
GRU4Rec 0.3646 0.2598 4.9s
NARM 0.3621 0.2595 8.2s
SASRec 0.4247 0.3056 7.2s
TiSASRec 0.4276 0.3074 39s
CFKG 0.4239 0.3018 8.7s
SLRC' 0.4519 0.3335 4.3s
Chorus 0.4738 0.3448 4.9s

For fair comparison, the batch size is fixed to 256, and the embedding size is set to 64. We strive to tune all the other hyper-parameters to obtain the best performance for each model (may be not optimal now, which will be updated if better scores are achieved). Current commands are listed in run.sh. We repeat each experiment 5 times with different random seeds and report the average score (see exp.py). All experiments are conducted with a single GTX-1080Ti GPU.

Citation

This is also our public implementation for the paper:

Chenyang Wang, Min Zhang, Weizhi Ma, Yiqun Liu, and Shaoping Ma. Make It a Chorus: Knowledge- and Time-aware Item Modeling for Sequential Recommendation. In SIGIR'20.

Checkout to SIGIR20 branch to reproduce the results.

git clone -b SIGIR20 https://github.com/THUwangcy/ReChorus.git

Please cite this paper if you use our codes. Thanks!

Author: Chenyang Wang ([email protected])

rechorus's People

Contributors

thuwangcy avatar

Watchers

James Cloos 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.