上一节详细的介绍了transform的组件,本节就通过组件进行组装transform
Self-attention层:

简化:

多头self-attention
上面是单头self-attention,由单个的self-attention组成多头self-attention,如下:
使用n个单头self-attention,不共享参数,进行堆叠,把输出的上下文C进行concat连接
假如单头的self-attention的输出是d维向量,输出m个上下文C,那么组成的矩阵为dxm的C向量
多头的组成的向量为(n*d)xm如下:

多头attention

Stacked Self-Attention Layers
Self-Attention Layer + Dense Layer

多个多头self-attention

形成编码器模块

解码器
Stacked Attention Layers

Transform

1万+

被折叠的 条评论
为什么被折叠?



