知识卡片
填充不必到模型最大窗口
批内可按所需长度补齐,并用mask屏蔽填充位置;不少实现也能接受不同长度。预留1024位置并不表示生成会逐一把这些PAD变成答案,源序列与目标生成长度是不同对象,位置容量也不是每次必须计算的固定长。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- · 查看原书依据
The token sequence input into a transformer is always truncated and padded so that it has the required length, no matter how long or short the text being processed is. For example, the token sequence [What] [is] [BERT] [?] could be encoded as four embedding column vectors, creating an N×4 tensor or array. But this encoding would be too short for a sentence with five
参考来源
- 位置:《Natural Language Processing in Action, Second Edition》第09章《可堆叠的Transformer》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Natural Language Processing in Action, Second Edition/_epub-src/OEBPS/Text/chapter-9.html)
- 结论依据:摘录中关于填充不必到模型最大窗口的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。
- 原始内容:The token sequence input into a transformer is always truncated and padded so that it has the required length, no matter how long or short the text being processed is. For example, the token sequence [What] [is] [BERT] [?] could be encoded as four embedding column vectors, creating an N×4 tensor or array. But this encoding would be too short for a sentence with five