eubinecto / k4ji_ai

4명의 김씨, 한명의 진씨, 한명의 임씨가 모여서 인공지능을 공부하고 있습니다.
13 stars 0 forks source link

Attention #24

Open eubinecto opened 3 years ago

eubinecto commented 3 years ago

To-do

다음의 섹션에 대해 스터디한 내용을 정리해보기!

eubinecto commented 3 years ago

attention 텐서플로우 튜토리얼

논문의 거의 모든 내용을 자세한 설명 & 텐서플로우 코드로 설명해주는 튜토리얼이 있다.

에 대한 설명, 코드로 구현 방법에 대해서도 설명을 해준다. 해당 개념을 이해하는데 매우 큰 도움이 됨.

attention이란?

먼저 attention이 무엇인지에 대한 이해가 필요하다. eubinecto/k4ji_ai#38 에 따로 정리해두었습니다.

self-attention 이란?

여기에서, Query, Key, Value가 각각 무엇을 의미하는지를 이해하기 위해서는, self-attention이 무엇인지에 대한 이해가 필요하다. eubinecto/k4ji_ai#42 에 따로 정리해두었습니다.

teang1995 commented 3 years ago

Scaled Dot-Product Attention

figure 2 equation 1
image image
teang1995 commented 3 years ago

Multi-Head Attention

figure 2 equation 2
image image
teang1995 commented 3 years ago

Application of Attention in Transformer - multihead attention block의 역할

Encoder-Decoder사이의 alignment를 학습

RNN 기반 기존의 방법 Transformer의 방법
image

Encoder: self-attention을 stack해서 레이블 없이 "context"를 임베딩

self-attention 을 계속 stack 할 수 있다.
image

Encoder의 self attention block의 경우,

Decoder: Encoder와 유사, 단 right shifted output (레이블)에 대하여 self-attention context를 임베딩.

Decoder의 self attention block의 경우,