欢迎关注我的CSDN:https://spike.blog.csdn.net/
本文地址:https://spike.blog.csdn.net/article/details/140281680
免责声明:本文来源于个人知识与公开资料,仅用于学术交流,欢迎讨论,不支持转载。
设计位置编码的 4 个要素:
- Be reflective of their distances from one another in the sequence. 表示序列中不同 Token 的距离,使用距离度量比较向量的大小,构建的向量空间中,位置近的向量产生较小的距离,位置远的向量产生较大的距离。
- Have values bounded between 0 and 1. 将值限制在 0~1 之间,用作神经网络的输入。
- Be invariant to sequence length. 不依赖于文本的长短,固定位置的值是相同的