Showing posts with label _AI:2021. Show all posts
Showing posts with label _AI:2021. Show all posts

Monday, December 27, 2021

AI 從頭學(2020 年版)

AI 從頭學(2020 年版)

2019/08/14

-----


-----

一、精華篇

(一)AI 三部曲(深度學習:從 CV 到 NLP)
https://hemingwang.blogspot.com/2019/05/trilogy.html

(二):BERT Overview
https://hemingwang.blogspot.com/2019/01/bert-overview.html

(三):History of Natural Language Processing
https://hemingwang.blogspot.com/2019/01/history-of-natural-language-processing.html

(四)深度學習論文下載
http://hemingwang.blogspot.com/2019/02/deep-learning-highlight.html

-----

二、基礎篇

(一):文獻回顧
http://hemingwang.blogspot.com/2016/12/ai.html

(二):Popular Deep Learning Software Tools
http://hemingwang.blogspot.com/2016/12/aipopular-deep-learning-software-tools.html 

(三):Popular Deep Learning Hardware Tools
http://hemingwang.blogspot.com/2016/12/aipopular-deep-learning-hardware-tools.html

(四):AD and LeNet
http://hemingwang.blogspot.com/2016/12/aiad-and-lenet.html

(五):AD and Python
http://hemingwang.blogspot.com/2016/12/aiad-and-python.html

(六):The Net
http://hemingwang.blogspot.com/2016/12/aithe-net.html

(七):AD and Python from Jason
http://hemingwang.blogspot.com/2016/12/aiad-and-python-from-jason.html

(八):The Net from Mark
http://hemingwang.blogspot.com/2016/12/aithe-net-from-mark.html

(九):Back Propagation
http://hemingwang.blogspot.com/2017/02/aiback-propagation.html

(一0):Automatic Differentiation
http://hemingwang.blogspot.com/2017/02/aiautomatic-differentiation.html

(一一):A Glance at Deep Learning
http://hemingwang.blogspot.com/2017/02/aia-glance-at-deep-learning.html

(一二):LeNet
http://hemingwang.blogspot.com/2017/03/ailenet.html

(一三):LeNet - F6
http://hemingwang.blogspot.com/2017/03/ailenet-f6.html

◎ LeNet 的補充
http://hemingwang.blogspot.com/2018/02/deep-learninglenet-bp.html 

(一四):Recommender
http://hemingwang.blogspot.com/2017/03/ai.html

(一五):Deep Learning,How?
http://hemingwang.blogspot.com/2017/03/aideep-learninghow.html

(一六):Deep Learning,What?
http://hemingwang.blogspot.com/2017/03/aideep-learningwhat.html

(一七):Shallow Learning
https://hemingwang.blogspot.com/2017/03/aishallow-learning.html

(一八):Convolutional Neural Network
http://hemingwang.blogspot.com/2017/03/aiconvolutional-neural-network_23.html

(一九):Recurrent Neural Network
http://hemingwang.blogspot.com/2017/03/airecurrent-neural-network.html

◎ RNN 的補充
http://hemingwang.blogspot.com/2018/02/airnnlstmin-120-mins.html

(二0):Deep Learning,Hot
http://hemingwang.blogspot.com/2017/03/aideep-learninghot.html

(二一):A Glance at Deep Reinforcement Learning
http://hemingwang.blogspot.com/2017/04/aia-glance-at-deep-reinforcement.html

(二三):CNN - Kernel Training
http://hemingwang.blogspot.com/2017/05/aicnn-filter-kernel-training.html

(二四):CNN - Kernel Visualizing
http://hemingwang.blogspot.com/2017/05/aicnn-filter-kernel-visualizing.html

◎ CNN 的補充
http://hemingwang.blogspot.com/2018/02/deep-learningcnn.html

(二五):AlphaGo
http://hemingwang.blogspot.com/2017/05/aiaja-huang.html

(二六):AlexNet
http://hemingwang.blogspot.com/2017/05/aialexnet.html

(二七):ZFNet
http://hemingwang.blogspot.com/2017/05/aikernel-visualizing.html

(二八):Network in Network
http://hemingwang.blogspot.com/2017/06/ainetwork-in-network.html

(二九):GoogLeNet
http://hemingwang.blogspot.com/2017/06/aigooglenet.html

(三0):Conv1
http://hemingwang.blogspot.com/2017/06/aiconv1.html

(三一):Inception
http://hemingwang.blogspot.com/2017/08/aiinception.html

(三二):VGGNet
http://hemingwang.blogspot.com/2018/09/aivggnet.html

(三三):ResNet
http://hemingwang.blogspot.com/2018/09/airesnet.html

(三四):FCN
http://hemingwang.blogspot.com/2018/02/deep-learningfcn.html

(三五):DPM
http://hemingwang.blogspot.com/2017/07/aiobject-detection-with.html

(三六):YOLO v1
http://hemingwang.blogspot.com/2018/04/deep-learningyolo-v1.html

◎ YOLOv1 的補充:mAP
http://hemingwang.blogspot.com/2018/04/machine-learning-conceptmean-average.html

◎ YOLOv1 的補充:NMS
http://hemingwang.blogspot.com/2018/04/machine-learning-conceptnon-maximum.html

(三七):Weight Decay
https://hemingwang.blogspot.com/2017/06/aiweight-decay.html

(三八):Highlight
http://hemingwang.blogspot.com/2017/11/aihighlight.html

(三九):Complete Works
http://hemingwang.blogspot.com/2017/08/aicomplete-works.html

-----

三、進階篇

NLP(一):LSTM
https://hemingwang.blogspot.com/2019/09/lstm.html

NLP(二):Seq2seq
https://hemingwang.blogspot.com/2019/09/seq2seq.html

NLP(三):Attention
http://hemingwang.blogspot.com/2019/01/attention.html

NLP(四):ConvS2S
https://hemingwang.blogspot.com/2019/04/convs2s.html

NLP(五):Transformer
http://hemingwang.blogspot.com/2019/01/transformer.html

-----

四、附錄
 
(一):Space
https://hemingwang.blogspot.com/2019/04/mathspace.html

(二):如何學好英文
https://hemingwang.blogspot.com/2020/07/learning-english.html

(三):如何撰寫論文
https://sanmin.com.tw/Product/index/000758374

Monday, December 13, 2021

GPT-1

GPT-1

2019/04/08

-----



Fig. OpenAI GPT(圖片來源)。

-----



# BERT

-----


// LeeMeng - 直觀理解 GPT-2 語言模型並生成金庸武俠小說

-----


# GPT-1

-----


-----



// NLP自然语言处理:文本表示总结 - 下篇(ELMo、Transformer、GPT、BERT)_陈宸的博客-CSDN博客

-----


// NLP自然语言处理:文本表示总结 - 下篇(ELMo、Transformer、GPT、BERT)_陈宸的博客-CSDN博客

-----


// NLP自然语言处理:文本表示总结 - 下篇(ELMo、Transformer、GPT、BERT)_陈宸的博客-CSDN博客

-----
References

NLP自然语言处理:文本表示总结 - 下篇(ELMo、Transformer、GPT、BERT)_陈宸的博客-CSDN博客
https://blog.csdn.net/qq_35883464/article/details/100173045

LeeMeng - 直觀理解 GPT-2 語言模型並生成金庸武俠小說
https://leemeng.tw/gpt2-language-model-generate-chinese-jing-yong-novels.html

Thursday, November 11, 2021

BN

BN

2019/12/17

-----


// [ML筆記] Batch Normalization

-----


// An Intuitive Explanation of Why Batch Normalization Really Works (Normalization in Deep Learning Part 1) _ Machine Learning Explained

-----

References

# Batch Normalization
Ioffe, Sergey, and Christian Szegedy. "Batch normalization: Accelerating deep network training by reducing internal covariate shift." International conference on machine learning. 2015.
http://proceedings.mlr.press/v37/ioffe15.pdf 

Notes for 'Batch Normalization  Accelerating Deep Network Training by Reducing Internal Covariate Shift' paper · GitHub
https://gist.github.com/shagunsodhani/4441216a298df0fe6ab0

An Intuitive Explanation of Why Batch Normalization Really Works (Normalization in Deep Learning Part 1) _ Machine Learning Explained
https://mlexplained.com/2018/01/10/an-intuitive-explanation-of-why-batch-normalization-really-works-normalization-in-deep-learning-part-1/

Batch Normalization原理与实战 - 知乎
https://zhuanlan.zhihu.com/p/34879333

Batch Normalization导读 - 知乎
https://zhuanlan.zhihu.com/p/38176412 

[ML筆記] Batch Normalization
http://violin-tao.blogspot.com/2018/02/ml-batch-normalization.html

Sunday, November 07, 2021

NLP(四):ConvS2S

NLP(四):ConvS2S

2019/04/02

-----


Fig. ConvS2S(圖片來源:Pixabay)。

圖一、封面。

-----


圖二、Outline。

-----

Outline

1. ConvS2S
2. I/O Embedding
3. Padding and Mask
4. GLU
5. Encoder
6. Decoder
7. Multi-Hop Attention
8. Details

-----

背景介紹:

「用 CNN 來做時間序列預測分析,是一個非常難的問題。在此之前,CNN 在圖像領域大放異彩,橫掃物體識別、檢測、分割等不同場景。即便是應用到自然語言處理中,也只是簡單的從 embedding 中提取相鄰幾個單詞的特徵,再加上 pooling 層,變成固定高層特徵輸入到分類器中。

背景:Kalchbrenner & Blunson (2013) 提出過從句子中提取出固定長度的 embedding,Cho 等人 (2014) 提出帶門的遞歸 CNN 用來重複的產生向量 representation,直到一定長度就停止。但是這些模型都沒有 RNN、LSTM、GRU 等的效果好,單純的使用卷積層提取特徵,對於時間序列來說,這對於把握住單詞前後的特徵特別難。隨著 CNN 的越來越成熟,發展出了新的特性,包括attention mechanism、residual connection 以及一些工程上的 tricks,使得 CNN 的表徵能力越來越強。

最近比較有突破的進展如下。 Kalchbrenner 等人 (2016) 已經開始使用 CNN 模型應用到翻譯任務中,但是沒有使用 attention 機制,結果沒有達到預期。 Pham 等人 (2016) 將 CNN 成功用於語言模型,即便沒有超過 LSTM。

最新成果:自然語言處理包括眾多領域,機器翻譯、語言模型、NER、POS、QA 問答、多輪對話等,RNN 及其變種都取得了非常大的成功。然而,Facebook 一直堅持將 CNN 用於這些任務中,不得不說是工業界及學界的一股清流。最近的幾篇論文也非常有意思,先說結果。

第一篇叫 A convolutional encoder model for neural machine translation,去年11月份發的,採用了非常多的技巧,1. 加上 position embedding,解決單詞位置信息;2. 每層卷積的輸出都要加上其輸入,即殘差連接;3. attention 機制的使用,encoder 最後是兩個 stacked 卷積層,一個負責 encoder 的輸出,另一個負責 conditional input。」。

# 如何评价 Facebook 新推出的 CNN 机器翻译项目 Fairseq? - 知乎

https://www.zhihu.com/question/59645329

-----

1. ConvS2S

-----


# ConvS2S 論文 [1]。

圖三、ConvS2S 模型架構。

如同 Seq2seq 與 Attention,ConvS2S 也是 Encoder-Decoder 架構用於機器翻譯。Encoder 端,也就是 Source,假定是英文。Decoder 的 Output 端,假定是德文。

Seq2seq、Attention、ConvS2S,都可稱為 Source-Target-Output-Relational-Model(Storm)。最大的差別,是 ConvS2S 用一維卷積取代 Seq2seq 與 Attention 的 LSTM,GPU 的平行運算改善了速度。而一維卷積時間訊息消失的缺點,則以時間訊息另外編碼加入,加以改善。

-----

2. I/O Embedding

-----

Weight Matrix of Word2vec


https://mc.ai/deep-nlp-word-vectors-with-word2vec/

圖四、1-hot Encoding to Vector。

假定字彙數量是 10k,可以先經由 Word Embedding 壓縮成維度三百的向量。

-----



圖五、Word Embedding。

one hot encoding 壓縮成 768。

-----

768 轉成 512 或 1024 或 2048。

-----

3. Padding and Mask

-----





圖七a、Padding。





圖七b、Padding。


Padding 的部分,由於使用一維的 Conv3,Encoder 端的 They agree,除了先加上句末的標記 </s>,另外還要補上兩個 <p>。

Decoder 端的德文 Sie stimmen zu,除了句首的標記 <s>,也要補上兩個 <p>。Attention 的矩陣可以看到 <s> Sie stimmen tu 與 They agree </s> 的權重對應。具體來說,我們用零向量填充左側和右側的 k-1 個元素的輸入,然後從卷積輸出的末尾移除 k 個元素。參考圖七b。

此處  k 為 3。

-----

4. GLU

-----



# GLU 論文 [2]。

圖八、GLU。

句子的向量,先分別經過兩個一維卷積的運算。上半部經過 sigmoid 的運算,讓它具有 LSTM 的門的作用。然後再與另一半點乘。

-----




圖九、加上殘差的 GLU 圖解。

-----

5. Encoder

-----


https://reniew.github.io/44/

圖十、Encoder。

Encoder 最後一層的輸出,作為 Decoder 每一層(共八層) attention 的參考來源。

-----

6. Decoder 

-----


https://reniew.github.io/44/

圖十一、Decoder。

會用到 Attention 的權重來決定 Encoder 端每個字的份量。

-----




圖十二、Encoder 一次讀完,Decoder 逐字輸出。每次吐出一個字。

-----



圖十三、C = QKV。

last layer:encoder output 的最後一層。

每吐完四個字,hidden state 重新作為下一層的輸入。

-----

7. Multi-Hop Attention

-----


https://reniew.github.io/44/

圖十四、多層 Attention。

不同層有不同的意義。

----- 


# ConvS2S 論文 [1]。

圖十五、八層 Attention。

一、三、六:線性。
二、八:整個來源句的資訊。
四:名詞。
五、七:建立。配合德文(文法結構)的翻譯。

-----

8. Details

-----



圖十六、三個主要模組。

-----


https://norman3.github.io/papers/docs/fairseq.html

圖十七、公式與圖的搭配。

-----

◎ Encoder

-----

They agree:英文的輸入句。
<p>:Padding。
</s>:Sentence 的 End。

e:Embedding。e 是 w 與 p 的和(會經過殘差)。
w:Word Embedding。
p:Positional Embedding。

j:維度是 3,也就是英文,Encoder 字串(含 </s>)的長度。j 從 1 到 3,m 也就是 3。
d:word vector 的維度,本論文初始 d = 768。後可為 512 或 1024 或 2048。
k:kernel 的寬度,本論文 k = 3。
W(2d X kd):權重矩陣。跟 e 卷積後,會得到 A concate B。

v:GLU 的運算。
A:主體的資訊。
B:門的資訊。

z:Encoder 經過 GLU 後的輸出。
u:Encoder 的最後一層。

-----

◎ Decoder

-----

Sie stimmen zu:德文的輸出句。
<p>:Padding。
<s>:Sentence 的 Start。
</s>:Sentence 的 End。
i 的維度是 4,也就是德文,Decoder 字串(含 <s>)的長度。i 從 1 開始。到輸出字為 </s> 時結束。


-----

l:第 l 層。
hi[l] 與 hi[l-1] 的公式:Decoder 的卷積運算與殘差。
gi:上一個時間點 i − 1 的 target embedding。
di:decoder state summary。
aij:Attention Table 的元素。

-----

◎ Attention

-----

ci:Context Vector。

p(y(i+1)):輸入句 x 與輸出句 y 前 i 個字,應該再出現哪個字,的機率分布。輸出字就是取機率最大的那個字。

Wo:transforming the top decoder output hLi via a linear layer with weights Wo and bias bo。
W[l]:第 l 層的權重矩陣。
L:最後一層。

R:實數。
T:T possible next target elements。

-----




圖十八、LSTM + Seq2seq + Attention。

Soft Attention。

「hard / soft attention 是在文章《Show, Attend and Tell: Neural Image Caption Generation with Visual Attention》提出的概念,最直觀的一種理解是,hard attention 是一個隨機採樣,採樣集合是輸入向量的集合,採樣的機率分布是alignment function 產出的 attention weight。因此,hard attention 的輸出是某一個特定的輸入向量。soft attention 是一個帶權求和的過程,求和集合是輸入向量的集合,對應權重是 alignment function 產出的 attention weight。hard / soft attention 中,soft attention 是更常用的(後文提及的所有 attention 都在這個範疇),因為它可導,可直接嵌入到模型中進行訓練,hard attention 文中 suggests a Monte Carlo based sampling approximation of gradient。」。


-----




圖十九、Encoder 換成卷積。

-----




圖二十。Decoder 也換成卷積。

-----

在五篇 NLP 的經典論文中,比起之前的 LSTM、Seq2seq、Attention,以及稍後的 Transformer,這篇 ConvS2S 無疑是被低估的,引用次數也只有數千,不像其他動輒上萬。 

去年我選了這五篇論文,今年有深入一些。論文的圖其實就很清楚了。不過還是不夠清楚。

有位日本人把核心重新畫過,突顯了 QKV 的重要,QKV 也是 Transformer 的重點。在 Short Attention 那篇有深入的分析,引用次數則更少。 

有位韓國人把圖加上公式,就更清楚了。可惜還是不夠清楚,因為模型其實是立體的,Decoder 有八層。 

-----

References

◎ 論文

[1] ConvS2S
Gehring, Jonas, et al. "Convolutional sequence to sequence learning." Proceedings of the 34th International Conference on Machine Learning-Volume 70. JMLR. org, 2017.
https://arxiv.org/pdf/1705.03122.pdf

[2] GLU
Dauphin, Yann N., et al. "Language modeling with gated convolutional networks." Proceedings of the 34th International Conference on Machine Learning-Volume 70. JMLR. org, 2017.
https://arxiv.org/pdf/1612.08083.pdf

-----

◎ 英文參考資料

# 論文作者的投影片
2_1-Yarats
https://aiukraine.com/wp-content/uploads/2017/10/2_1-Yarats.pdf

# 綜述
Understanding incremental decoding in fairseq – Telesens
http://www.telesens.co/2019/04/21/understanding-incremental-decoding-in-fairseq/

claps
Seq2Seq model using Convolutional Neural Network – Gautam Karmakar – Medium
https://medium.com/@gautam.karmakar/summary-seq2seq-model-using-convolutional-neural-network-b1eb100fb4c4

-----

◎ 日文參考資料

論文解説 Convolutional Sequence to Sequence Learning (ConvS2S) - ディープラーニングブログ
http://deeplearning.hatenablog.com/entry/convs2s 

fairseq – PyTorch
http://torch.classcat.com/category/fairseq/

-----

◎ 韓文參考資料

ConvS2S  Convolutional Sequence to Sequence Learning
https://reniew.github.io/44/

Convolutional Sequence to Sequence Learning
https://norman3.github.io/papers/docs/fairseq.html

Convolutional Sequence to Sequence Learning
http://jeonseoungseon.blogspot.com/2017/06/convolutional-sequence-to-sequence.html

-----

◎ 簡體中文參考資料

从《Convolutional Sequence to Sequence Learning》到《Attention Is All You Need》 - 知乎
https://zhuanlan.zhihu.com/p/27464080

《Convolutional Sequence to Sequence Learning》阅读笔记 - 知乎
https://zhuanlan.zhihu.com/p/26918935

机器翻译模型之Fairseq:《Convolutional Sequence to Sequence Learning》 - 技术成长笔记 - CSDN博客
https://blog.csdn.net/u012931582/article/details/83719158

如何使用fairseq复现Transformer NMT _ Weekly Review
http://www.linzehui.me/2019/01/28/%E7%A2%8E%E7%89%87%E7%9F%A5%E8%AF%86/%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8fairseq%E5%A4%8D%E7%8E%B0Transformer%20NMT/

如何评价 Facebook 新推出的 CNN 机器翻译项目 Fairseq  - 知乎
https://www.zhihu.com/question/59645329

论文笔记(1) ConvS2S Convolutional Seq to Seq Learning - 知乎
https://zhuanlan.zhihu.com/p/60524073

-----

◎ 繁體中文參考資料

論文筆記 Convolutional Sequence to Sequence Learning _ Y.C. Tseng’s Site
https://ycts.github.io/weeklypapers/convSeq2seq/ 

-----

◎ 代碼實作

convs2s — OpenSeq2Seq 0.2 documentation
https://nvidia.github.io/OpenSeq2Seq/html/api-docs/parts.convs2s.html

GitHub - hongweizeng_cnn-seq2seq
https://github.com/hongweizeng/cnn-seq2seq

XSum_XSum-ConvS2S at master · EdinburghNLP_XSum · GitHub
https://github.com/EdinburghNLP/XSum/tree/master/XSum-ConvS2S

GitHub - BruceChaun_NMT  Neural Machine Translation with RNN_ConvS2S_Transoformer
https://github.com/BruceChaun/NMT

GitHub - tobyyouup_conv_seq2seq  A tensorflow implementation of Fairseq Convolutional Sequence to Sequence Learning(Gehring et al. 2017)
https://github.com/tobyyouup/conv_seq2seq

GitHub - pytorch_fairseq  Facebook AI Research Sequence-to-Sequence Toolkit written in Python
https://github.com/pytorch/fairseq 

GitHub - facebookresearch_fairseq  Facebook AI Research Sequence-to-Sequence Toolkit
https://github.com/facebookresearch/fairseq

Sunday, September 26, 2021

Paragraph2vec

Paragraph2vec

2020/08/19

-----


https://pixabay.com/zh/photos/attorney-law-text-of-the-law-lawyer-2730806/

-----

「本文的意義在於提出了一個無監督的 paragraph 向量表示模型,無監督的意義非常重大。有了 paragraph 級別的高效表示模型之後,解決類似於句子分類,檢索,問答系統,文本摘要等各種問題都會帶來極大地幫助。」

// Distributed Representations of Sentences and Documents - 知乎

-----

References

◎ 英文

[1] Paragraph2vec
Le, Quoc, and Tomas Mikolov. "Distributed representations of sentences and documents." International conference on machine learning. 2014.
http://proceedings.mlr.press/v32/le14.pdf

# 3.9k claps
A gentle introduction to Doc2Vec. TL;DR | by Gidi Shperber | Wisio | Medium
https://medium.com/wisio/a-gentle-introduction-to-doc2vec-db3e8c0cce5e

# 174 claps
A simple explanation of document embeddings generated using Doc2Vec | by Amar Budhiraja | Medium
https://medium.com/@amarbudhiraja/understanding-document-embeddings-of-doc2vec-bfe7237a26da

# 139 claps
Understand how to transfer your paragraph to vector by doc2vec | by Edward Ma | Towards Data Science
https://towardsdatascience.com/understand-how-to-transfer-your-paragraph-to-vector-by-doc2vec-1e225ccf102

# 376 claps
Doc2Vec tutorial using Gensim. The official Doc2Vec is great… | by Andreas Klintberg | Medium
https://medium.com/@klintcho/doc2vec-tutorial-using-gensim-ab3ac03d3a1

Doc2vec tutorial | RARE Technologies
https://rare-technologies.com/doc2vec-tutorial/

Meanings are Vectors - Seeking Wisdom
http://sanjaymeena.io/tech/word-embeddings/

Deep Learning in Recommender Systems - RecSys Summer School 2017
https://www.slideshare.net/balazshidasi/deep-learning-in-recommender-systems-recsys-summer-school-2017

-----

◎ 簡中

一周论文 | Word2Vec 作者Tomas Mikolov 的三篇代表作
https://mp.weixin.qq.com/s?__biz=MzA3MzI4MjgzMw==&mid=2650719175&idx=3&sn=6e9354461991c00ff21e29bc544fd6fc&chksm=871b07b9b06c8eafa111720a7eec96231706c527a18c68ada11c578517abc333252844434c0c&scene=0

Distributed Representations of Sentences and Documents - 知乎
https://zhuanlan.zhihu.com/p/21242559

用 Doc2Vec 得到文档/段落/句子的向量表达 - 简书
https://www.jianshu.com/p/854a59b93e09

使用paragraph2vec学习文章特征 - 簡書
https://www.jianshu.com/p/d34d61188ab5

Paragraph2vec(段向量)-------基于《Distributed Representations of Sentences and Documents》_cpluss的博客-CSDN博客_distributed representations of sentences and docum
https://blog.csdn.net/cpluss/article/details/81355923

# 227 人贊同
深度学习在推荐系统上的应用 - 知乎
https://zhuanlan.zhihu.com/p/33214451

-----

◎ 繁中

# 145 claps
讀paper之心得:word2vec 與 doc2vec. word2vec與doc2vec 分別為2篇paper,都是由Tomas… | by Eating | Medium
https://medium.com/@ddoo8059/%E8%AE%80paper%E4%B9%8B%E5%BF%83%E5%BE%97-word2vec-%E8%88%87-doc2vec-5c8b8daa7f12

-----

Sunday, September 05, 2021

What's the main points of Seq2seq?

What's the main points of Seq2seq?

2020/10/30

-----

說明:

Seq2seq 是採用 LSTM 運算單元的編碼器解碼器架構,主要用於機器翻譯 [1],稍早類似的設計是採用 GRU(簡化版本的 LSTM) 運算單元的 RNN encoder-decoder [2], [3],但是 Seq2seq 名字取的比較好。它以 RCTM 為基礎加以修改 [4],

除了機器翻譯,Seq2seq 也可以用於語音辨識,參考 CTC [5]。

由於 Seq2seq 壓縮成單向量並無法儲存夠多的資訊,後續 Attention 除了把單向量改成多向量,並使用神經網路訓練每個向量的權重 [6]。ConvS2S 則是在 Attention 與 RCTM 的基礎上,把 Attention 分解成 QKV,Query、Key、Value 分別儲存下一個字的預測、索引值、文字的真實含意。Transformer 則是進一步在 encoder 與 decoder 端分別訓練 QKV,因而在機器翻譯取得了巨大的成功 [8],以 Transformer 的 encoder 為基礎,設計的 BERT 也成為自然語言處理 NLP 的標準 [9]。

-----

一、基礎學習與論文理解(70%)。


◎ 1. 可以從這篇論文學到什麼(解決什麼問題)? 



# 只要一分钟,机器翻译了解一下 | 知智一分钟 - 知乎

https://zhuanlan.zhihu.com/p/44396098

-----

◎ A. 問題原因。 

◎ 1.a.1:過往這個領域已經做到甚麼程度?



# Seq2seq [1]。

-----


# BLEU(Bilingual Evaluation Understudy 雙語評估替補)在戲曲界,understudy 指的是候補演員。


-----

◎ 1.a.2:最近的研究遇到了甚麼瓶頸?



# RCTM [4]。

失去字的順序。

-----


# ConvS2S [7]。

-----

◎ 1.a.3:議題發生的根本原因是甚麼?



# The Star Also Rises: [翻譯] Understanding LSTM Networks

http://hemingwang.blogspot.com/2019/09/understanding-lstm-networks.html

-----

◎ B. 解決方法。 

◎ 1.b.1:作者採用甚麼方式解決?


# Seq2seq [1]。

-----

◎ 1.b.2:細節內容是如何解決的?

The Star Also Rises: NLP(二):Seq2seq [9]。

https://hemingwang.blogspot.com/2019/09/seq2seq.html

-----

◎ 1.b.3:(optional)- 作者是否有說明思路? 



# Rerank [1]。

-----

- 或是後續研究者的討論?



# Attention 作者對 Seq2seq 的討論 [6]。

-----

-----

1. This neural machine translation approach typically consists of two components, the first of which encodes a source sentence x and the second decodes to a target sentence y.

2. Adding neural components to existing translation systems, for instance, to score the phrase pairs in the phrase table (Cho et al., 2014a) or to re-rank candidate translations (Sutskever et al., 2014), has allowed to surpass the previous state-of-the-art performance level.

-----

◎ C. 效能評估。 

◎ 1.c.1:成果效能的比較。



# Seq2seq [1]。

-----

◎ 1.c.2:目前這個方法是否還有限制,是甚麼?



# Attention? Attention! 

https://lilianweng.github.io/lil-log/2018/06/24/attention-attention.html

[8]。

-----

◎ 1.c.3:(optional)- 作者對後續發展的期許? 


# Seq2seq [1]

-----



◎ Most importantly, we demonstrated that a simple, straightforward and a relatively unoptimized approach can outperform a mature SMT system, so further work will likely lead to even greater translation accuracies. These results suggest that our approach will likely do well on other challenging sequence to sequence problems.

-----

- 其他研究者後續的發展?



# Gated Recurrent Unit,GRU 被設計用來取代 LSTM [2]。

-----

二、後續發展與延伸應用(30%)

◎ 2. 可以應用在那些垂直領域(應用領域)? 



# Speech Recognition [5]。

-----

◎ 3. 這篇論文的價值在哪(如何跨領域延伸應用)? 



# 從零開始的 Sequence to Sequence | 雷德麥的藏書閣

http://zake7749.github.io/2017/09/28/Sequence-to-Sequence-tutorial/

-----

◎ 4. 如果要改進可以怎麼做(後續的研究)?



# Attention [6]。

-----

References

◎ 主要論文

[1] Seq2seq。被引用 12676 次。

Sutskever, Ilya, Oriol Vinyals, and Quoc V. Le. "Sequence to sequence learning with neural networks." Advances in neural information processing systems. 2014.

http://papers.nips.cc/paper/5346-sequence-to-sequence-learning-with-neural-networks.pdf

-----

◎ 延伸論文

[2] RNN encoder-decoder。與 Seq2seq 時間與成果都接近的論文。被引用 11284 次。

Cho, Kyunghyun, et al. "Learning phrase representations using RNN encoder-decoder for statistical machine translation." arXiv preprint arXiv:1406.1078 (2014).

https://arxiv.org/pdf/1406.1078.pdf


[3] RNN encoder-decoder 應用。被引用 3105 次。

Cho, Kyunghyun, et al. "On the properties of neural machine translation: Encoder-decoder approaches." arXiv preprint arXiv:1409.1259 (2014).

https://arxiv.org/pdf/1409.1259.pdf


[4] RCTM。Seq2seq 主要參考論文。被引用 1137 次。

Kalchbrenner, Nal, and Phil Blunsom. "Recurrent continuous translation models." Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing. 2013.

https://www.aclweb.org/anthology/D13-1176.pdf


[5] CTC。Connectionist Temporal Classification。Speech Recognition。被引用 2535 次。

Graves, Alex, et al. "Connectionist temporal classification: labelling unsegmented sequence data with recurrent neural networks." Proceedings of the 23rd international conference on Machine learning. 2006.

http://axon.cs.byu.edu/~martinez/classes/778/Papers/p369-graves.pdf


[6] Attention。Seq2seq 此 Encoder-Decoder 架構的改進。被引用 14826 次。

Bahdanau, Dzmitry, Kyunghyun Cho, and Yoshua Bengio. "Neural machine translation by jointly learning to align and translate." arXiv preprint arXiv:1409.0473 (2014).

https://arxiv.org/pdf/1409.0473.pdf


[7] ConvS2S。RCTM 的改進。被引用 1772 次。

Gehring, Jonas, et al. "Convolutional sequence to sequence learning." arXiv preprint arXiv:1705.03122 (2017).

https://arxiv.org/pdf/1705.03122.pdf


[8] Transformer。Encoder-Decoder 架構的極致。被引用 13554 次。

Vaswani, Ashish, et al. "Attention is all you need." Advances in neural information processing systems. 2017.

https://papers.nips.cc/paper/7181-attention-is-all-you-need.pdf


[9] BERT。基於 Transformer 的 encoder 設計的 NLP 預訓練模型。被引用 11157 次。

Devlin, Jacob, et al. "Bert: Pre-training of deep bidirectional transformers for language understanding." arXiv preprint arXiv:1810.04805 (2018).

https://arxiv.org/pdf/1810.04805.pdf

-----

◎ 網路文章

[10] The Star Also Rises: BLEU

http://hemingwang.blogspot.com/2020/11/bleu.html


[11] The Star Also Rises: [翻譯] Word Level English to Marathi Neural Machine Translation using Encoder-Decoder Model

http://hemingwang.blogspot.com/2019/10/word-level-english-to-marathi-neural.html


[12] The Star Also Rises: NLP(二):Seq2seq

https://hemingwang.blogspot.com/2019/09/seq2seq.html

-----

# 助教:銘文。

-----