伯特损失功能如何工作?

发布于 2025-02-07 19:35:23 字数 82 浏览 2 评论 0原文

我对Bert LM的跨凝性工作方式感到困惑。要计算损失函数,我们需要面具的真实标签。但是我们没有真实标签的向量表示,预测是向量表示。那么如何计算损失?

I'm confused about how cross-entropy works in bert LM. To calculate loss function we need the truth labels of masks. But we don't have the vector representation of the truth labels and the predictions are vector representations. So how to calculate loss ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

如若梦似彩虹 2025-02-14 19:35:23

我们已经知道在传递给伯特之前掩盖的单词,因此实际单词的一个热编码是实际的真相标签。蒙版单词的预测令牌传递给软磁层层,该层将蒙版Word的向量转换为另一个嵌入式(大小将类似于输入Word vector的大小)。然后,我们可以计算输入向量与软磁性层后获得的交叉熵损失。
希望这能澄清。为了更好地澄清一下
https://www.youtube.com/watch?

We already know the words we mask before passing to BERT so the actual word's one hot encoding is the actual truth label. The predicted token of masked word is passed to a softmax layer which converts the masked word's vector into another embedding (size will be similar to input word vector's size). Then we can calculate cross entropy loss between the input vector and the one we got after softmax layer.
Hope this clarifies. For better clarification watch this
https://www.youtube.com/watch?v=xI0HHN5XKDo

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文