Loading...
2022. 5. 16. 20:24

transformer의 decoder 구조 알아보기

decoder의 기본 구조는 이렇다. The decoder is also composed of a stack of N = 6 identical layers. In addition to the two sub-layers in each encoder layer, the decoder inserts a third sub-layer, which performs multi-head attention over the output of the encoder stack. Similar to the encoder, we employ residual connections around each of the sub-layers, followed by layer normalization. We also modify the se..

2022. 5. 13. 01:28

transformer에 사용된 positional encoding에 대하여

1. block based model encoding의 마지막 단계로 residual connection, layer normalization 결과를 feed forward network라는 신경망에 넣어 다시 한번 변환을 거친다. 근데 특별히 왜 했다는 이유는 없는듯?? feed forward network후에도 residual connection을 수행하고 layer normalization을 수행하여 최종적인 encoder의 output인 hidden vector를 얻는다. 2. positional encoding 지금까지 연산의 결과는 사실 sequence의 순서 정보를 전혀 고려하지않았다. 직관적으로 당연하다. x1,x2,x3의 q,k,v를 한번에 만들어서 이것으로 attention을 수행하면서..

2022. 5. 5. 19:03

transformer에 사용된 residual connection과 layer normalization

1. residual connection self attention 구조하에 당시 좋은 성능 향상 기법인 residual add connection, layer normalization을 채택했다. input $X_{t}$의 encoding 결과로 $h_{t}$라는 hidden vector를 얻고 싶은데 multi head attention이 학습하는 결과는$h_{t}-X_{t}$라고 하는 것이며 이 결과에 input $X_{t}$를 그대로 더하여 $h_{t}$라는 목표하는 hidden vector를 얻는다. input의 (1,4)의 multi head attention 결과로 얻은 (2,3)에 단순히 더하여 (3,7)이라는 벡터를 얻는 과정이 residual connection이다. 입력 input과 ..