Paris
?
France
Japan
θ 類似度
距離: ともに出現する頻度を表す
[34,12,48]
[314,527,48]
input
output
Dense
全結合は表現力高すぎ、過学習しやすい
input
output
Attention
画像処理編
画像処理編
画像分類器
人間
input
output
人間
input
output
画像分類器
…
…
…
…
…
…
…
ReL
U
ReL
U
Convolutio
n
Convolution
Global Average
Pooling
Dense
background
foreground
Attention
Convolution
BatchNormalization
ReLU
Convolution
BatchNormalization
ReLU
Convolution
Sigmoid
Multiply
…
…
…
…
…
…
Attention?
Attention?
Attention?
Convolution
BatchNormalization
ReLU
GlobalAveragePooling
Convolution(1,1)
ReLU
Convolution(1,1)
Sigmoid
Multiply
注目する特徴を推定するネットワーク
特定の領域に注目 特定の特徴に注目
Convolution
BatchNormalization
ReLU
Convolution
BatchNormalization
ReLU
Convolution
Sigmoid
Multiply
Convolution
BatchNormalization
ReLU
GlobalAveragePooling
Convolution
ReLU
Convolution
Sigmoid
Multiply
注目する特徴を推定するネットワーク
言語処理編
言語処理編
Positive
Or
Negative
CNN,
RNN(LSTM)
この
ピアノ
の
色
は
最高
0.0
1.0
0.0
0.0
0.0
0.0
各単語の特徴
Attention
Attentionに基づき
重み付けして平均or合計
この
ピアノ
の
色
は
最高
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
The
color
of
this
piano
is
LST
M great
C H
HC
Encoder decoder
この
ピアノ
の
色
は
最高
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
The
color
of
this
piano
is
LST
M great
C H
HC
Encoder decoder
この
ピアノ
の
色
は
最高
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
The
color
of
this
piano
is
LST
M great
Encoder decoder
この
ピアノ
の
色
は
最高
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
The
color
of
this
piano
is
LST
M great
Encoder decoder
この
ピアノ
の
色
は
最高
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
LST
M
The
color
of
this
piano
is
LST
M great
Encoder decoder
この
ピアノ
の
色
は
最高
どこに注目するか?
この
ピアノ
の
色
は
最高
The
各単語の特徴
デコーダの初期ベクトル
内積
0.0
0.0
0.0
0.0
1.0
0.0
Softmax
Weighted sum
この
ピアノ
の
色
は
最高
Key
内積
0.0
0.0
0.0
0.0
1.0
0.0
Softmax
Weighted sum
Value
The
color
of
this
piano
is
great
Query
Key Value
Query Output
memory
あなた
を
きらい
で
は
ない
input Query Key Value 内積
0.0
0.0
0.0
0.0
1.0
0.0
Softmax
特徴付け
Weighted
sum
Output
Attention is all you need!!! を入門する前に
Attention is all you need!!! を入門する前に

Attention is all you need!!! を入門する前に