从LSTM到Seq2Seq最新分析和总结.pdfVIP

  • 2
  • 0
  • 约8.22千字
  • 约 9页
  • 2021-09-01 发布于上海
  • 举报
从 LSTM 到 Seq2Seq LSTM(Long Short Term Memory) 由于传统的 RNN 在进行几次链式法则求导后梯度会指数级 缩小(如图) ,导致传播几层后出现梯度消失,无法处理“长 期依赖”问题。国外学者刻意设计了一种 RNN 的变体来克服 这个问题,即 LSTM 。 基本的 LSTM 结构如图: (1) 输入门 it role=presentation style=position: relative;itit :控制当前输入和前一步输出进入新的 cell 的 信息量; (2) 忘记门 ft role=presentation style=position: relative;ftft :决定哪些信息需要舍弃; (3) cell 状态更新 ct role=presentation style=position: relative;ctct :计算下一个时间戳的状态使用经过们处理 的前一状态和输入; (4) 输出门 ot role=presentation style=position: relative;otot :计算 cell 的输出; (5) 最终 LSTM 的输出 yt role=presentation style=position: relative;ytyt :使用一个对当前状态的 softmax 变换进行重变换。 根据上图,设输入序列 x=(x1,...,xT) role=presentation style=position: relative;x=(x1,...,xT)x=(x1,...,xT) ,输出 序列 y=(y1,...,yT) role=presentation style=position: relative;y=(y1,...,yT)y=(y1,...,yT) ,我们可以得到以上每 步的计算公式 : it=amp;#x03C3;(Wixxt+Wimmtamp;#x2212;1+Wiccta mp;#x2212;1+bi) role=presentation style=position: relative;it= σ(Wixxt+Wimmt?1+Wicct?1+bi)it= σ(Wixxt+Wi mmt?1+Wicct?1+bi) (1) ft=amp;#x03C3;(Wfxxt+Wfmmtamp;#x2212;1+Wfccta mp;#x2212;1+bf) role=presentation style=position: relative;ft= σ(Wfxxt+Wfmmt?1+Wfcct?1+bf)ft= σ(Wfxxt+ Wfmmt?1+Wfcct?1+bf) (2) ct=ftamp;#x2299;ctamp;#x2212;1+itamp;#x2299;g(W cxxt+Wcmmtamp;#x2212;1+bc) role=presentation style=position: relative;ct=ft ⊙ct?1+it ⊙g(Wcxxt+Wcmmt?1+bc)ct=ft ⊙ct? 1+it ⊙g(Wcxxt+Wcmmt?1+bc) (3) ot=amp;#x03C3;(Woxxt+Wommtamp;#x2212;1+Wocct +bo) role=presentation style=position: relative;ot= σ(Woxxt+Wommt?1+Wocct+bo)ot= σ(Woxxt+ Wommt?1+Wocct+bo) (4) mt=otamp;#x2299;h(ct) role=presentation style=position: relative;mt=ot

文档评论(0)

1亿VIP精品文档

相关文档