Skip to content

add DeepFM knowledge #734

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion docs/tutorials/recommendation_system/DeepFM.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ CTR预估是目前推荐系统的核心技术,其目标是预估用户点击

为了同时利用low-order和high-order特征,DeepFM包含FM和DNN两部分,两部分共享输入特征。对于特征i,标量wi是其1阶特征的权重,该特征和其他特征的交互影响用隐向量Vi来表示。Vi输入到FM模型获得特征的2阶表示,输入到DNN模型得到high-order高阶特征。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low-order和highe-order解释一下是啥



$$
\hat{y} = sigmoid(y_{FM} + y_{DNN})
$$
Expand All @@ -23,6 +24,8 @@ DeepFM模型结构如下图所示,完成对稀疏特征的嵌入后,由FM层
FM(Factorization Machines,因子分解机)最早由Steffen Rendle于2010年在ICDM上提出,它是一种通用的预测方法,在即使数据非常稀疏的情况下,依然能估计出可靠的参数进行预测。与传统的简单线性模型不同的是,因子分解机考虑了特征间的交叉,对所有嵌套变量交互进行建模(类似于SVM中的核函数),因此在推荐系统和计算广告领域关注的点击率CTR(click-through rate)和转化率CVR(conversion rate)两项指标上有着良好的表现。

FM模型不单可以建模1阶特征,还可以通过隐向量点积的方法高效的获得2阶特征表示,即使交叉特征在数据集中非常稀疏甚至是从来没出现过。这也是FM的优势所在。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FM介绍再详细一点,目前就只有一个公式,借鉴一下这个,给一个这一样的应用示例:https://www.biaodianfu.com/ctr-fm-ffm-deepfm.html



$$
y_{FM}= <w,x> + \sum_{j_1=1}^{d}\sum_{j_2=j_1+1}^{d}<V_i,V_j>x_{j_1}\cdot x_{j_2}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

介绍的比较简单,FM的原理希望通俗易懂,我查了一下资料,可以参考:

https://www.biaodianfu.com/ctr-fm-ffm-deepfm.html

$$
Expand All @@ -36,14 +39,20 @@ $$
该部分和Wide&Deep模型类似,是简单的前馈网络。在输入特征部分,由于原始特征向量多是高纬度,高度稀疏,连续和类别混合的分域特征,因此将原始的稀疏表示特征映射为稠密的特征向量。

假设子网络的输出层为:


$$
a^{(0)}=[e1,e2,e3,...en]
$$
DNN网络第l层表示为:


$$
a^{(l+1)}=\sigma{(W^{(l)}a^{(l)}+b^{(l)})}
$$
再假设有H个隐藏层,DNN部分的预测输出可表示为:


$$
y_{DNN}= \sigma{(W^{|H|+1}\cdot a^H + b^{|H|+1})}
$$
Expand All @@ -54,6 +63,8 @@ DNN深度神经网络层结构如下图所示:
## 5.Loss及Auc计算

DeepFM模型的损失函数选择Binary_Cross_Entropy(二值交叉熵)函数


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$$
H_p(q)=-\frac{1}{N}\sum_{i=1}^Ny_i\cdot log(p(y_i))+(1-y_i) \cdot log(1-p(y_i))
$$
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

添加的公式的每一个字符都需要解释

Expand All @@ -65,7 +76,7 @@ Auc是Area Under Curve的首字母缩写,这里的Curve指的就是ROC曲线

## 6.参考文献

[IJCAI 2017]Guo, Huifeng,Tang, Ruiming,Ye, Yunming,Li, Zhenguo,He, Xiuqiang. DeepFM: A Factorization-Machine based Neural Network for CTR Prediction
[[IJCAI 2017]Guo, Huifeng,Tang, Ruiming,Ye, Yunming,Li, Zhenguo,He, Xiuqiang. DeepFM: A Factorization-Machine based Neural Network for CTR Prediction](https://arxiv.org/pdf/1703.04247.pdf)