长短期记忆(英语:Long Short-Term MemoryLSTM)是一种时间循环神经网络(RNN)[1],论文首次发表于1997年。由于独特的设计结构,LSTM适合于处理和预测时间序列中间隔和延迟非常长的重要事件。

LSTM的表现通常比时间循环神经网络隐马尔科夫模型(HMM)更好,比如用在不分段连续手写识别[2]。2009年,用LSTM构建的人工神经网络模型赢得过ICDAR手写识别比赛冠军。LSTM还普遍用于自主语音识别,2013年运用TIMIT自然演讲数据库达成17.7%错误率的纪录。作为非线性模型,LSTM可作为复杂的非线性单元用于构造更大型深度神经网络

通常情况,一个LSTM单元由细胞单元(cell)、输入门(input gate)、输出门(output gate[3]、遗忘门(forget gate[4]组成。

历史 编辑

1997年,Sepp Hochreiter于尔根·施密德胡伯提出LSTM。版本包含了cells, input以及output gates。

2014年,Kyunghyun Cho et al.发明了门控循环单元英语Gated recurrent unit(GRU)。[5]

2016年,谷歌用LSTM进行谷歌翻译[6] 苹果公司微软亚马逊公司也用LSTM生产产品,例如:iPhone[7]Amazon Alexa[8]等。中国公司也正在用LSTM。

结构 编辑

 
简单LSTM的结构[9]

LSTM是一种含有LSTM区块(blocks)或其他的一种类神经网络,文献或其他资料中LSTM区块可能被描述成智能网络单元,因为它可以记忆不定时间长度的数值,区块中有一个gate能够决定input是否重要到能被记住及能不能被输出output。

右图底下是四个S函数单元,最左边函数依情况可能成为区块的input,右边三个会经过gate决定input是否能传入区块,左边第二个为input gate,如果这里产出近似于零,将把这里的值挡住,不会进到下一层。左边第三个是forget gate,当这产生值近似于零,将把区块里记住的值忘掉。第四个也就是最右边的input为output gate,他可以决定在区块记忆中的input是否能输出 。

LSTM有很多个版本,其中一个重要的版本是GRU(Gated Recurrent Unit)[10],根据谷歌的测试表明,LSTM中最重要的是Forget gate,其次是Input gate,最次是Output gate[11]

方程 编辑

 

变量 编辑

  •  : LSTM的input(输入)
  •  : forget gate(遗忘阀)
  •  : input gate(输入阀)
  •  : output gate(输出阀)
  •  : hidden state(隐藏状态)
  •  : cell state(单元状态)
  •    : 训练中的矩阵,网络学习计算元值


训练方法 编辑

为了最小化训练误差,梯度下降法(Gradient descent)如:应用时序性倒传递算法英语Backpropagation through time,可用来依据错误修改每次的权重。梯度下降法在循环神经网络(RNN)中主要的问题初次在1991年发现,就是误差梯度随着事件间的时间长度成指数般的消失。当设置了LSTM 区块时,误差也随着倒回计算,从output影响回input阶段的每一个gate,直到这个数值被过滤掉。因此正常的倒循环类神经是一个有效训练LSTM区块记住长时间数值的方法。

Backpropagation through time英语Backpropagation through time、BPTT [12][13]

 
LSTM的经典模型

应用 编辑

参见 编辑

参考 编辑

  1. ^ S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural Computation, 9(8):1735–1780, 1997.
  2. ^ A. Graves, M. Liwicki, S. Fernandez, R. Bertolami, H. Bunke, J. Schmidhuber. A Novel Connectionist System for Improved Unconstrained Handwriting Recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 31, no. 5, 2009.
  3. ^ Hochreiter, Sepp; Schmidhuber, Juergen. LSTM can solve hard long time lag problems. Advances in Neural Information Processing Systems. 1996 [2023-07-29]. (原始内容存档于2023-03-15). 
  4. ^ Felix A. Gers; Jürgen Schmidhuber; Fred Cummins. Learning to Forget: Continual Prediction with LSTM. Neural Computation. 2000, 12 (10): 2451–2471. CiteSeerX 10.1.1.55.5709 . PMID 11032042. S2CID 11598600. doi:10.1162/089976600300015015. 
  5. ^ Cho, Kyunghyun; van Merrienboer, Bart; Gulcehre, Caglar; Bahdanau, Dzmitry; Bougares, Fethi; Schwenk, Holger; Bengio, Yoshua. Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation. arXiv:1406.1078 [cs, stat]. 2014-09-02 [2020-02-11]. (原始内容存档于2022-02-08). 
  6. ^ Wu, Yonghui; Schuster, Mike; Chen, Zhifeng; Le, Quoc V.; Norouzi, Mohammad; Macherey, Wolfgang; Krikun, Maxim; Cao, Yuan; Gao, Qin. Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation. arXiv:1609.08144 [cs]. 2016-10-08 [2020-02-11]. (原始内容存档于2021-01-14). 
  7. ^ Amir@theinformation.cOm. Apple’s Machines Can Learn Too. The Information. [2020-02-11]. (原始内容存档于2021-01-15). 
  8. ^ Bringing the Magic of Amazon AI and Alexa to Apps on AWS. - All Things Distributed. www.allthingsdistributed.com. [2020-02-11]. (原始内容存档于2019-04-01). 
  9. ^ Klaus Greff; Rupesh Kumar Srivastava; Jan Koutník; Bas R. Steunebrink; Jürgen Schmidhuber. LSTM: A Search Space Odyssey. IEEE Transactions on Neural Networks and Learning Systems. 2015, 28 (10): 2222–2232. PMID 27411231. arXiv:1503.04069 . doi:10.1109/TNNLS.2016.2582924. 
  10. ^ Neural Machine Translation by Jointly Learning to Align and Translate页面存档备份,存于互联网档案馆),Cho et al. 2014年。
  11. ^ 递归神经网络结构经验之谈页面存档备份,存于互联网档案馆),2015年。
  12. ^ Problem Set 8. COS 485 Neural Networks: Theory and Applications. 2019-04-24 [2020-02-11] (英语). 
  13. ^ Danqi Chen. Recurrent Neural Networks (PDF). (原始内容存档 (PDF)于2020-09-02). 
  14. ^ Institute of Electrical and Electronics Engineers. 2006 IEEE/RSJ International Conference on Intelligent Robots and Systems : Beijing, China, 9-13 October 2006.. Piscataway, NJ: IEEE https://www.worldcat.org/oclc/812612388. 2006. ISBN 1-4244-0258-1. OCLC 812612388.  缺少或|title=为空 (帮助)

外部链接 编辑