
交叉attention

此处的函数和维度变化4中是一样的
Encoder和Decoder中的计算核心就是Self-Attention,只是Decoder中多了一个Encoder-Decoder Attention。其实计算原理和Self-Attention是一样的,只是在Encoder-Decoder Attention中V的值是来自最后一层的Encoder

decoder
Encoder和Decoder中的计算核心就是Self-Attention,只是Decoder中多了一个Encoder-Decoder Attention。其实计算原理和Self-Attention是一样的,只是在Encoder-Decoder Attention中V的值是来自最后一层的Encoder