知识卡片
未知词零向量仍可在未冻结时学习
缺失预训练词可暂用零向量;freeze=False且对应行接收梯度时,之后仍可能学习。若冻结整个表,多未知词将一直同表示,padding_idx行又有额外约束;零初始化并不等于永久忽略,也不保证一定学好。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- · 查看原书依据
... else: ... embed.append(zeroes.copy()) #2 >>> embed = np.array(embed) >>> embed.shape (4000, 50) #1 Ensures the rows of your embedding matrix are in the same order as your vocabulary #2 Creates zero vectors for unknown embeddings You now have your vocabulary of 4,000 tokens converted into a 4,000 × 5 matrix of embeddings. Each row in the embed array represents the meaning of that vocabulary
参考来源
- 位置:《Natural Language Processing in Action, Second Edition》第07章《卷积网络识别文本模式》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Natural Language Processing in Action, Second Edition/_epub-src/OEBPS/Text/chapter-7.html)
- 结论依据:摘录中关于未知词零向量仍可在未冻结时学习的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。
- 原始内容:... else: ... embed.append(zeroes.copy()) #2 >>> embed = np.array(embed) >>> embed.shape (4000, 50) #1 Ensures the rows of your embedding matrix are in the same order as your vocabulary #2 Creates zero vectors for unknown embeddings You now have your vocabulary of 4,000 tokens converted into a 4,000 × 5 matrix of embeddings. Each row in the embed array represents the meaning of that vocabulary