Skip to content
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

add DeepFM knowledge #734

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Conversation

AqourAreA
Copy link
Contributor

add knowledge

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

$$
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

![](https://ai-studio-static-online.cdn.bcebos.com/bda8da10940b43ada3337c03332fe06ad1cd95f7780243888050023be33fc88c)

### 3)DNN

Copy link
Contributor

Choose a reason for hiding this comment

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

wide&Deep详细说一下,不一定每个人都知道


### 4)Loss及Auc计算

* 预测的结果将FM的一阶项部分,二阶项部分以及dnn部分相加,再通过激活函数sigmoid给出,为了得到每条样本分属于正负样本的概率,我们将预测结果和1-predict合并起来得到predict_2d,以便接下来计算auc。
Copy link
Contributor

Choose a reason for hiding this comment

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

添加auc和DeepFM的损失函数


### 1)DeepFM模型

为了同时利用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解释一下是啥

@AqourAreA AqourAreA changed the title add knowledge add DeepFM Oct 14, 2021
@AqourAreA AqourAreA changed the title add DeepFM add DeepFM knowledge Oct 14, 2021
DeepFM模型的损失函数选择Binary_Cross_Entropy(二值交叉熵)函数
$$
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.

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

@@ -2,7 +2,9 @@ DeepFM模型

## 模型简介

CTR预估是目前推荐系统的核心技术,其目标是预估用户点击推荐内容的概率。DeepFM模型包含FM和DNN两部分,FM模型可以抽取low-order特征,DNN可以抽取high-order特征。无需Wide&Deep模型人工特征工程。由于输入仅为原始特征,而且FM和DNN共享输入向量特征,DeepFM模型训练速度很快。
CTR预估是目前推荐系统的核心技术,其目标是预估用户点击推荐内容的概率。DeepFM模型包含FM和DNN两部分,FM模型可以抽取low-order(低阶)特征,DNN可以抽取high-order(高阶)特征。无需Wide&Deep模型人工特征工程。由于输入仅为原始特征,而且FM和DNN共享输入向量特征,DeepFM模型训练速度很快。

Copy link
Contributor

Choose a reason for hiding this comment

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

低阶特征和高阶特征,描述的比较简单,能够举个例子吗?

Auc是Area Under Curve的首字母缩写,这里的Curve指的就是ROC曲线,AUC就是ROC曲线下面的面积,作为模型评价指标,他可以用来评价二分类模型。其中,ROC曲线全称为受试者工作特征曲线 (receiver operating characteristic curve),它是根据一系列不同的二分类方式(分界值或决定阈),以真阳性率(敏感性)为纵坐标,假阳性率(1-特异性)为横坐标绘制的曲线。

可使用paddle.metric.Auc()进行调用。具体计算过程如下:

* 预测的结果将FM的一阶项部分,二阶项部分以及dnn部分相加,再通过激活函数sigmoid给出,为了得到每条样本分属于正负样本的概率,我们将预测结果和1-predict合并起来得到predict_2d,以便接下来计算auc。
* 每条样本的损失为负对数损失值,label的数据类型将转化为float输入。
* 该batch的损失avg_cost是各条样本的损失之和
Copy link
Contributor

Choose a reason for hiding this comment

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

讲解理论的时候,理论不需要说具体的实现过程,把原理讲清楚就行。这几句删除

@w5688414
Copy link
Contributor

w5688414 commented Oct 14, 2021

1.第一句的"DeepFM模型"前面加入#号,变成大标题
2.其他下面的标题变成二级标题,在其前面加入2个##号,另外,标号不需要加括号,比如把2)变成2.就行。标题形成层级结构
3.内容尽量做到图文并茂
4.最后加上参考文献部分

@w5688414
Copy link
Contributor

1.目前各个原理部分FM,DNN,DeepFM部分有了公式,解释不够详细,对初学者不够友好,加上一些示例,比如CTR或者CVR场景,告诉读者怎么用,怎么计算的,这能够让内容更加充实,可读性更强。

@@ -31,7 +31,7 @@ $$

![](https://ai-studio-static-online.cdn.bcebos.com/bda8da10940b43ada3337c03332fe06ad1cd95f7780243888050023be33fc88c)
Copy link
Contributor

Choose a reason for hiding this comment

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

目前FM的部分描述比较简单,考虑补充FM的学习过程,FM的优缺点等等

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

Copy link
Contributor

Choose a reason for hiding this comment

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

在这里加一节DeepFM和其他模型的比较,比如目前在推荐领域中比较流行的深度模型FNN、PNN、Wide&Deep等

@@ -31,7 +31,7 @@ $$

![](https://ai-studio-static-online.cdn.bcebos.com/bda8da10940b43ada3337c03332fe06ad1cd95f7780243888050023be33fc88c)

## 3.DNN
## 4.DNN

Copy link
Contributor

Choose a reason for hiding this comment

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

考虑回答一下,为什么选择DNN要跟FM结合,RNN跟FM能够结合吗?分析一下DNN+FM结合的好处

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

@@ -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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants