Skip to content

Recurrence the recommender paper with Tensorflow2.0

Notifications You must be signed in to change notification settings

jqsl2012/Recommender-System-with-TF2.0

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

前言

开源项目Recommender System with TF2.0主要是对阅读过的部分推荐系统、CTR预估论文进行复现,包括Match(召回)(NCF、SASRec、STAMP等)、Rank(粗排)(WDL、DCN等)。

建立原因:

  1. 理论和实践似乎有很大的间隔,学术界与工业界的差距更是如此;
  2. 更好的理解论文的核心内容,增强自己的工程能力;
  3. 很多论文给出的开源代码都是TF1.x,因此想要用更简单的TF2.x进行复现;

项目特点:

  • 使用Tensorflow2.x进行复现;
  • 每个模型都是相互独立的,不存在依赖关系;
  • 模型基本按照论文进行构建,实验尽量使用论文给出的的公共数据集;
  • 模型都附有README.md,对于模型的训练使用有详细的介绍;
  • 代码源文件参数、函数命名规范,并且带有标准的注释;

 

实验

1、通过git命令git clone https://github.com/ZiyaoGeng/Recommender-System-with-TF2.0.git或者直接下载;

2、实验环境:Python3.7,Tensorflow2.0-CPU/GPU;

3、根据自己数据集的位置,合理更改所需模型文件内train.pyfile路径;

4、设置超参数,直接运行即可;

 

数据集

 

复现论文

1. 召回模型(Top-K推荐)

Paper|Model Published in Author
Matrix Factorization Techniques for Recommender Systems|MF IEEE Computer Society,2009 Koren|Yahoo Research
Neural network-based Collaborative Filtering|NCF WWW, 2017 Xiangnan He
Self-Attentive Sequential Recommendation|SASRec ICDM, 2018 UCSD
STAMP: Short-Term Attention/Memory Priority Model for Session-based Recommendation| STAMP KDD, 2018 Qiao Liu

 

2. 粗排模型(CTR预估)

Paper|Model Published in Author
Factorization Machines|FM ICDM, 2010 Steffen Rendle
Field-aware Factorization Machines for CTR Prediction|FFM RecSys, 2016 Yuchin Juan|Criteo Research
Wide & Deep Learning for Recommender Systems|WDL DLRS, 2016 Google Inc.
Deep Crossing: Web-Scale Modeling without Manually Crafted Combinatorial Features|Deep Crossing KDD, 2016 Microsoft Research
Product-based Neural Networks for User Response Prediction|PNN ICDM, 2016 Shanghai Jiao Tong University
Deep & Cross Network for Ad Click Predictions|DCN ADKDD, 2017 Stanford University|Google Inc.
Neural Factorization Machines for Sparse Predictive Analytics|NFM SIGIR, 2017 Xiangnan He
Attentional Factorization Machines: Learning the Weight of Feature Interactions via Attention Networks|AFM IJCAI, 2017 Zhejiang University|National University of Singapore
DeepFM: A Factorization-Machine based Neural Network for CTR Prediction|DeepFM IJCAI, 2017 Harbin Institute of Technology|Noah’s Ark Research Lab, Huawei
xDeepFM: Combining Explicit and Implicit Feature Interactions for Recommender Systems|xDeepFM KDD, 2018 University of Science and Technology of China
Deep Interest Network for Click-Through Rate Prediction|DIN KDD, 2018 Alibaba Group

 

致谢

项目中会存在一些代码Bug,感谢以下朋友指出问题:

  1. wangzhe258369:指出在DIN模型中tf.keras.layers.BatchNormalization默认行为是training=False,此时不会去更新BN中的moving_mean和moving_variance变量。但是重新修改了DIN模型代码内容时,再仔细查找了资料,发现

    如果使用模型调用fit()的话,是可以不给的(官方推荐是不给),因为在fit()的时候,模型会自己根据相应的阶段(是train阶段还是inference阶段)决定training值,这是由learning——phase机制实现的。

  2. boluochuile:发现SASRec模型训练出错,原因是验证集必须使用tuple的方式,已更正;

  3. boluochuile:指出SASRec模型中label赋值的问题,

    data_df.loc[data_df.label >= 2, 'label'] = 1
    data_df.loc[data_df.label < 2, 'label'] = 0

    应该颠倒,已更正;

 

联系方式

1、对于项目有任何建议或问题,可以在Issue留言,或者可以添加作者微信zgzjhzgzy

2、作者有一个自己的公众号:推荐算法的小齿轮,如果喜欢里面的内容,不妨点个关注。

About

Recurrence the recommender paper with Tensorflow2.0

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%