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

correct #99

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions docs/第三章 推荐算法面经/3.1 ML与DL基础.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@
1-p,& y = 0
\end{cases}
\\ \Rightarrow p(y_i|xi) = p^{y_i}(1-p)^{1-{y_i}}
\\ \Rightarrow \text{在总体上有:} P = \prod_{n=1}^N p^{y_n}(1-p)(1-{y_n})
\\ \Rightarrow \text{在总体上有:} P = \prod_{n=1}^N p^{y_n}(1-p)^{(1-{y_n})}
\\ \Rightarrow \text{连乘求导很复杂,我们用单调函数ln化为连加:}F(w) = ln(P) = \sum_{n=1}^N(y_nln(p) + (1-y_n)ln(1-p))
\\ \Rightarrow \text{其中}p = \frac {1}{1+e^{-w^Tx}}
$$
Expand Down Expand Up @@ -437,7 +437,7 @@
1-p,& y = 0
\end{cases}
\\ \Rightarrow p(y_i|xi) = p^{y_i}(1-p)^{1-{y_i}}
\\ \Rightarrow \text{在总体上有:} P = \prod_{n=1}^N p^{y_n}(1-p)(1-{y_n})
\\ \Rightarrow \text{在总体上有:} P = \prod_{n=1}^N p^{y_n}(1-p)^{(1-{y_n})}
\\ \Rightarrow \text{连乘求导很复杂,我们用单调函数ln化为连加:}F(w) = ln(P) = \sum_{n=1}^N(y_nln(p) + (1-y_n)ln(1-p))
\\ \Rightarrow \text{其中}p = \frac {1}{1+e^{-w^Tx}}
$$
Expand Down
4 changes: 4 additions & 0 deletions docs/第三章 推荐算法面经/3.2 推荐模型相关.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
- 匹配层:拿用户向量去FAISS中和Item向量进行相似度计算,并返回距离最近的Top K个Item作为个性化的召回结果。

- 双塔模型的输出,用双塔embedding做内积+sigmoid和求余弦相似度+sigmoid的区别
- 内积:内积计算量小,速度快,但是容易过拟合,而且无法体现特征之间的相关性;
- 余弦相似度:余弦相似度计算量较大,速度慢,但是不容易过拟合,而且可以体现特征之间的相关性。
- 余弦举例只考虑了角度差(衡量两个向量在方向上的相似性,对绝对的数值不敏感),而内积综合考虑了角度差和长度差(衡量两个向量在长度和方向上的相似性,对绝对的数值比较敏感),所以内积的相似性更小,对异常值的鲁棒性更好。

- 双塔模型一般怎么做特征
- 每个塔各自构建user与item embedding,**[User特征]」**主要包括和用户相关的特征:用户id、手机系统、地域、年龄、历史行为序列等,上下文特征(Context feature)可以放入用户侧塔,**「Item特征」**主要包括和Item相关的特征:ItemId、Item类别、Item来源等;

Expand Down