長短期記憶

本頁使用了標題或全文手工轉換
維基百科,自由的百科全書


長短期記憶(英語: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=為空 (幫助)

外部連結[編輯]