论文解惑《word2vec Parameter Learning Explained》1.1--CBOW模型中One-word context情况公式推导问题

  word2vec中有CBOW和Skip-Gram模型,对于两个模型中的参数如何学习的公式推导,在《word2vec Parameter Learning Explained》中有详细解释,我在阅读1.1节One-word context时对于公式(8)的推导感到不解,花了些时间,原文如下:
  “Let us now derive the update equation of the weights between hidden and output layers. Take the derivative of E with regard to j j j-th unit’s net input u j u_j uj, we obtain ∂ E ∂ u j = y j − t j : = e j \frac{\partial E}{\partial u_j}=y_j-t_j:=e_j ujE=yjtj:=ej  where t j = 1 ( j = j ∗ ) , i.e , t j t_j=\mathbb{1}(j=j^*),\text{i.e},t_j tj=1(j=j),i.e,tj will only be 1 when the j j j-th unit is the output word, otherwise t j = 0. t_j=0. tj=0.
  我一开始不明白是怎么推到这一步的,后来发现过程很显然:
E = log ∑ j ′ = 1 V exp ( u j ′ ) − u j ∗ e j = ∂ E ∂ u j = exp ( u j ) ∑ j ′ = 1 V exp ( u j ′ ) − u j ∗ = y j − u j ∗ = y j − t i \begin{aligned} E & =\text{log}\sum_{j'=1}^V{\text{exp}(u_{j'})-u_{j*}} \\ e_j=\frac{\partial E}{\partial u_j} & =\frac{\text{exp}(u_j)}{\sum_{j'=1}^V{\text{exp}(u_{j'})}}-u_{j*} \\ & =y_j-u_{j*} \\ & =y_j-t_i \end{aligned} Eej=ujE=logj=1Vexp(uj)uj=j=1Vexp(uj)exp(uj)uj=yjuj=yjti

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值