Attention, Transformer and BERT Prof. Kuan-Ting Lai 2020/6/16 - - PowerPoint PPT Presentation

attention transformer and bert
SMART_READER_LITE
LIVE PREVIEW

Attention, Transformer and BERT Prof. Kuan-Ting Lai 2020/6/16 - - PowerPoint PPT Presentation

Attention, Transformer and BERT Prof. Kuan-Ting Lai 2020/6/16 Attention is All You Need! A. Waswani et al., NIPS , 2017 Google Brain & University of Toronto 2 Attention Visual attention and textual attention


slide-1
SLIDE 1

Attention, Transformer and BERT

  • Prof. Kuan-Ting Lai

2020/6/16

slide-2
SLIDE 2

Attention is All You Need!

  • A. Waswani et al., NIPS, 2017

Google Brain & University of Toronto

2

slide-3
SLIDE 3

Attention

  • Visual attention and textual

attention

3

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

slide-4
SLIDE 4

Seq2seq model

  • Language translation

4

slide-5
SLIDE 5

Attention = Vector of Importance Weights

5

slide-6
SLIDE 6

Transformer

  • http://jalammar.github.io/illustrated-transformer/

6

slide-7
SLIDE 7

Encoder and Decoder

7

slide-8
SLIDE 8

8

slide-9
SLIDE 9

Structure of the Encoder and Decoder

  • Self-attention
  • Encoder-decoder attention

9

slide-10
SLIDE 10

10

slide-11
SLIDE 11

Tensor2Tensor Notebook

  • https://colab.research.google.co

m/github/tensorflow/tensor2ten sor/blob/master/tensor2tensor/ notebooks/hello_t2t.ipynb

11

slide-12
SLIDE 12

Self-attention (query, key, value)

12

https://www.youtube.com/watch?v=ugWDIIOHtPA&t=1089s

slide-13
SLIDE 13

Self-attention

13

slide-14
SLIDE 14

14

slide-15
SLIDE 15

Calculating 𝑐2

15

slide-16
SLIDE 16

Matrix Mutiplication

16

slide-17
SLIDE 17

17

slide-18
SLIDE 18

Adding Residual Connections

18

slide-19
SLIDE 19

Layer Normalization

19

slide-20
SLIDE 20

20

slide-21
SLIDE 21

References

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

attention.html

  • 2. http://jalammar.github.io/illustrated-transformer/
  • 3. Hong-Yi Lee, Transformer, 2019

https://www.youtube.com/watch?v=ugWDIIOHtPA

21