728x90 positional encoding2 Transformer 2 - Multi Head Attention / Scaled Dot-Product Attention / Masking / Position-wise Feed Forward Network / Query, Key, Value 잠깐! 잊어버리니깐, 다시 한 번 더.. 트랜스포머 모델이란? Encoder는 input sequence를 continuous한 representation으로 바꾸고, Decoder는 이 representation을 output sequence로 바꾼다. 최종 Output은 Probability가 나옴! 먼저 0. Inputs을 embedding 후 positional encoding 하고 1. Encoder 돌리고 x 6번 Multi-Head Attention 잔차 Add + Normalization ---------------- FFW layer 잔차 Add + Normalization 2. Decoder 돌리고 x 6번 Masked - Multi-Head Attention (현재 위치보다 더 뒤에 .. 2023. 3. 14. Transformer 1 - Positional Encoding Seq2seq의 Encoder-Decoder를 6개 쌓아올린 모델. Enc-Dec x 6 은 아니고, Enc x 6 + Dec x 6임. RNN, LSTM 등의 기존 문장의 연속성을 무시 이를 무시하니 병렬구조가 가능해져서 연산속도가 엄청 빨라졌음. seq2seq처럼 context vector를 중간 병목으로 쓰지 않음. Self attention, 즉 내가 들어가서 내가 나오는 재귀적인 구조임. 문장의 문맥 + 단어의 순서 (위치)까지 attention에 담았음. 논문 : https://arxiv.org/pdf/1706.03762.pdf (Attention is all you need (2017)) 각 모듈이 하는 일을 간단하게 정리하면, Positional Encoding: 입력 문장의 단어들에 위치.. 2023. 3. 9. 이전 1 다음 728x90