赞
踩
T5模型只是在 KiVj 的基础上添加了一个可学习偏置KiVj +b,只是此处的b由相对位置(i-j)和head_num决定。该偏置参数为:nn.Embedding(relative_num_buckets, n_heads), 此处的relative_num_buckets相当于分桶编号,具体介绍可以参考苏神的文章:https://kexue.fm/archives/8130
nn.Embedding(relative_num_buckets, n_heads)