Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
R
ReadingList
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
zengxin
ReadingList
Commits
42adddcb
Commit
42adddcb
authored
4 years ago
by
zengxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Von Mises-Fisher Loss for Training Sequence to Sequence Models with Continuous Outputs
parent
d3d92eb0
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
46 行增加
和
2 行删除
+46
-2
Continuous Output for NMT/continuous-output-for-nmt.md
+46
-2
没有找到文件。
Continuous Output for NMT/continuous-output-for-nmt.md
查看文件 @
42adddcb
...
...
@@ -17,15 +17,59 @@
*
语义相似度并不能完全替代质量评估,但至少就最小风险训练而言,它是个不错的指标。
*
Von Mises
**-Fisher**
Loss for Training Sequence to Sequence Models with Continuous Outputs,ICLR 2019
*
Von Mises
-Fisher
Loss for Training Sequence to Sequence Models with Continuous Outputs,ICLR 2019
*
softmax的缺点:
*
速度慢、需要较大的内存、词汇表大小固定,不利于推理OOV的词
*
因此此论文使用连续词嵌入层替换Softmax层
*
创新点:
*
新的损失函数
*
使用预先训练的词嵌入概率分布进行训练和推断的过程
*
*
训练:
*
最小化模型输出的向量和参考译文词向量(来自预训练模型)的距离
*
推断
* 在目标词嵌入空间中搜索和当前输出词嵌入向量最近的向量,那么该词即是当前时刻预测的词
$w_{predict}=argmin_w\{d(\hat{e},e(w))|w \in V\}$
其中$e(w)$是目标语言词嵌入向量,$\hat{e}$是模型输出向量,$V$是词汇表。
* 在NLLvMF中,选取和$\hat{e}$的vMF相似度最高的词做为输出词
* 这种推断方式只能选取一个词,相当于**greedy search**
*
LOSS计算
* cosine
* $Loss=1-\frac{\hat{e}e(w)}{||\hat{e}||\cdot ||e(w)||}$
* Max Margin Loss
* $Loss=\sum_{w'\in V,w'\neq w}max(0,\gamma +cos(\hat{e},e(w'))-cos(\hat{e},e(w)))$
其中$\gamma$是超参数,$w'$表示负的样本。
* NLLvMF
* $NLLvMF(\hat{e};e(w))=-log(C_m(||\hat{e}||))-\hat{e}^T e(w)$
其中$C_m(\cdot)$是正则项:$C_m(k)=\frac{k^{m/2-1}}{(2\pi)^{m/2}I_{m/2-1}(k)}$
* Regularization of NLLvMF
* $NLLvMF(\hat{e})_{reg1}=-logC_m(||\hat{e}||)-\hat{e}^Te(w)+\lambda_1||\hat{e}||$
* $NLLvMF(\hat{e})_{reg2}=-logC_m(||\hat{e}||)-\lambda_2\hat{e}^Te(w)$
其中$\lambda_1$和$\lambda_2$是scalar参数,且$\lambda_2<1$
*
A Margin-based Loss with Synthetic Negative Samples for Continuous-output Machine Translation,EMNLP 2019
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论