<li id="omoqo"></li>
  • <noscript id="omoqo"><kbd id="omoqo"></kbd></noscript>
  • <td id="omoqo"></td>
  • <option id="omoqo"><noscript id="omoqo"></noscript></option>
  • <noscript id="omoqo"><source id="omoqo"></source></noscript>
  • 發布時間:2020-10-26 13:40 原文鏈接: 什么是循環神經網絡(RNN)?如何使用它們?(二)

      循環神經網絡的應用

      RNN 有很多應用。一個不錯的應用是與自然語言處理(NLP)的合作。網上已經有很多人證明了 RNN,他們創造出了令人驚訝的模型,這些模型能表示一種語言模型。這些語言模型能采納像莎士比亞的詩歌這樣的大量輸入,并在訓練這些模型后生成它們自己的莎士比亞式的詩歌,而且這些詩歌很難與原作區分開來。

      下面是莎士比亞式詩歌。

      PANDARUS:

      Alas, I think he shall be come approached and the day

      When little srain would be attain'd into being never fed,

      And who is but a chain and subjects of his death,

      I should not sleep.

      Second Senator:

      They are away this miseries, produced upon my soul,

      Breaking and strongly should be buried, when I perish

      The earth and thoughts of many states.

      DUKE VINCENTIO:

      Well, your wit is in the care of side and that.

      Second Lord:

      They would be ruled after this chamber, and

      my fair nues begun out of the fact, to be conveyed,

      Whose noble souls I'll have the heart of the wars.

      Clown:

      Come, sir, I will make did behold your worship.

      VIOLA:

      I'll drink it.

      這首詩完全是一個 RNN 寫出來的。這里有一篇好文章更深入地介紹了 Char RNNs 。

      這種特殊類型的 RNN 是在一個文本數據集中喂養的,它要逐字讀取輸入。與一次投喂一個詞相比,這種方式讓人驚訝的地方是這個網絡能創造出它自己獨特的詞,這些詞是用于訓練的詞匯中沒有的。

    什么是循環神經網絡(RNN) 如何使用它們?

    一個 char RNN 的例子

      這張從以上參考文章中摘取的圖表展示了這個模型將會如何預測“Hello”這個詞。這張圖很好地將網絡如何逐字采納每個詞并預測下一個字符的可能性可視化了。

      另一個讓人驚喜的 RNN 應用是機器翻譯。這種方法很有趣,因為它需要同時訓練兩個 RNN。在這些網絡中,輸入的是成對的不同語言的句子。例如,你能給這個網絡輸入意思相同的一對英法兩種語言的句子,其中英語是源語言,法語作為翻譯語言。有了足夠的訓練后,你給這個網絡一個英語句子,它就能把它翻譯成法語!這個模型被稱為序列到序列模型(Sequence to Sequences model )或者編碼-解碼模型(Encoder- Decoder model)。

    什么是循環神經網絡(RNN) 如何使用它們?

    英法翻譯的例子

      這張圖表展示了信息流是如何通過編碼-解碼模型的,它用了一個詞嵌入層( word embedding layer )來獲取更好的詞表征。一個詞嵌入層通常是 GloVe 或者 Word 2 Vec 算法,能批量采納詞,并創建一個權重矩陣,讓相似的詞相互連接起來。用一個嵌入層通常會讓你的 RNN 更加精確,因為它能更好的表征相似的詞是什么樣的,以便減少網絡的推斷。

      結論

      RNN 現在很流行。它們是自然語言處理中最有效的模型之一。這些模型會一直出現新的應用。


    <li id="omoqo"></li>
  • <noscript id="omoqo"><kbd id="omoqo"></kbd></noscript>
  • <td id="omoqo"></td>
  • <option id="omoqo"><noscript id="omoqo"></noscript></option>
  • <noscript id="omoqo"><source id="omoqo"></source></noscript>
  • 1v3多肉多车高校生活的玩视频