長短期記憶

本页使用了标题或全文手工转换
维基百科,自由的百科全书


长短期记忆(英語: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. ^ [email protected]. 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=为空 (帮助)

外部链接