lstm

之前用过lstm,效果并没有改进,所以很长时间我对他并不感冒。最近由于各种原因需要重新使用,所以比较细致的看了一下。

先来一张大牛的解释,什么是lstm:

LSTM is by definition, a function F :Rd×R×RdRd×Rd . It takes in  x,pc,phRd  and performs the following computations:

ifog=σσσtanhW[xph]

c=ig+fpc c=i⊗g+f⊗pc

h=otanh(c) h=o⊗tanh⁡(c)

where   denotes the elementwise product of vectors. The LSTM returns  (c,h)=F(x,pc,ph) (c,h)=F(x,pc,ph).

The number  d d is loosely referred to as “the number of units” in the LSTM cell.

再来一张解剖图(详情参见http://blog.csdn.net/ddreaming/article/details/53332433):



it:=sigmoid[Whiht1+Wxixt+bi]ft:=sigmoid[Whfht1+Wxfxt+bf]ot:=sigmoid[Whoht1+Wxoxt+bo]gt:=tanh[Whght1+Wxgxt+bg]ct:=(ft.ct1)+(it.gt)ht:=ot.tanh[ct]

注意:

  • 联系前两张图与以上公式,可以描述Caffe的LSTM实现过程
  • 以上公式的 [Wxi,Wxf,Wxo,Wxg] 为由第一个InnnerProduct层保存,及4.1中的 Wxc
  • 以上公式的 [bi,bf,bo,bg] 为由第一个InnnerProduct层保存,及4.1中的 bc
  • 以上公式的 [Whi,Whf,Who,Whg] 为由后边的InnnerProduct层保存,及4.1中的 Whc


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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值