Giter Club home page Giter Club logo

rank_distill's Introduction

Ranking Distillation

A PyTorch implementation of Ranking Distillation:

Ranking Distillation: Learning Compact Ranking Models With High Performance for Recommender System, Jiaxi Tang and Ke Wang , KDD '18

Requirements

Usage

Training student models (Model-S)

  1. Run python train_caser.py with d=50 to get the performance of student model.

    When finished, we will have the model saved in folder checkpoints/

Training teacher models (Model-T)

  1. Run python train_caser.py with d=100 to get the performance of teacher model.

    When finished, we will have the model saved in folder checkpoints/

Training student models with ranking distillation (Model-RD)

  1. Run python train_caser.py with d=100 to get the well-trained teacher model.

    When finished, we will have the teacher model saved in folder checkpoints/

    (you can also skip this step, as there is one in the checkpoint/gowalla-caser-dim=100.pth.tar)

  2. Run python distill_caser.py with d=50 and teacher_model_path pointed to the teacher model.

Configurations

Model Args (in train_caser.py)

  • d is set to 50 for student model and 100 for teacher model.

  • All other the hyper-parameters (e.g., nh, nv, ac_conv, ac_fc) are set by grid-search.

    Please check this repo for more information and definations of these hyper-parameters.

Model Args (in distill_caser.py)

  • teacher_model_path: path to teacher's model checkpoint.
  • teacher_topk_path: (optional) path to teacher's top-K ranking cache for each training query.
  • teach_alpha: hyperparameter for balancing ranking loss and distillation loss.
  • K: length of teacher's exemplary ranking.
  • lamda: hyperparameter for tuning the sharpness of position importance weight.
  • mu: hyperparameter for tuning the sharpness of ranking discrepancy weight.
  • dynamic_samples: number of samples used for estimating student's rank.
  • dynamic_start_epoch: number of iteration to start using hybrid of two different weights.

Citation

If you use this Caser in your paper, please cite the paper:

@inproceedings{tang2018ranking,
  title={Ranking Distillation: Learning Compact Ranking Models With High Performance for Recommender System},
  author={Tang, Jiaxi and Wang, Ke},
  booktitle={ACM SIGKDD International Conference on Knowledge Discovery & Data Mining},
  year={2018}
}

Acknowledgment

This project (utils.py, interactions.py, etc.) is heavily built on Spotlight. Thanks Maciej Kula for his great work.

rank_distill's People

Contributors

graytowne 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.