Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
M
mtbookv2
概览
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
NiuTrans
mtbookv2
Commits
47f21f9b
Commit
47f21f9b
authored
Jan 14, 2021
by
孟霞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
17改错
parent
e71d392a
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
3 行增加
和
3 行删除
+3
-3
Chapter17/Figures/figure-multiencoder.tex
+1
-1
Chapter17/chapter17.tex
+2
-2
没有找到文件。
Chapter17/Figures/figure-multiencoder.tex
查看文件 @
47f21f9b
...
...
@@ -6,7 +6,7 @@
\tikzstyle
{
every node
}
=[scale=0.7]
\node
(encoder
_
c)[coder]
{
\large
{
编码器
}}
;
\node
(encoder
_
s)[coder, right of = encoder
_
c, xshift=3.5cm, fill=red!30]
{
\large
{
编码器
}}
;
\node
(h
_
pre)[above of = encoder
_
c, yshift=1.3cm,scale=1.3]
{${
\mathbi
{
h
}}
_
{
\rm
pre
}$}
;
\node
(h
_
pre)[above of = encoder
_
c, yshift=1.3cm,scale=1.3]
{${
\mathbi
{
h
}}
^
{
\rm
pre
}$}
;
\node
(h)[above of = encoder
_
s, yshift=1.3cm,scale=1.3]
{$
\mathbi
{
h
}$}
;
\node
(cir)[circle,very thick, right of = h, draw=black!90,minimum width=0.5cm,xshift=1.1cm]
{}
;
\draw
[-,very thick,draw=black!90]
([xshift=0.04cm]cir.west)--([xshift=-0.04cm]cir.east);
...
...
Chapter17/chapter17.tex
查看文件 @
47f21f9b
...
...
@@ -546,7 +546,7 @@
\subsubsection
{
2. 多编码器结构
}
\parinterval
另一种思路是对传统的编码器-解码器框架进行更改,引入额外的编码器来对上下文句子进行编码,该结构被称为多编码器结构
\upcite
{
DBLP:conf/acl/LiLWJXZLL20,DBLP:conf/discomt/SugiyamaY19
}
。这种结构最早被应用在基于循环神经网络的篇章级翻译模型中
\upcite
{
DBLP:journals/corr/JeanLFC17,DBLP:conf/coling/KuangX18,DBLP:conf/naacl/BawdenSBH18,DBLP:conf/pacling/YamagishiK19
}
,后期证明在Transformer模型上同样适用
\upcite
{
DBLP:journals/corr/abs-1805-10163,DBLP:conf/emnlp/ZhangLSZXZL18
}
。图
\ref
{
fig:17-18
}
展示了一个基于Transformer模型的多编码器结构,基于源语言当前待翻译句子的编码表示
$
\mathbi
{
h
}$
和上下文句子的编码表示
$
\mathbi
{
h
}^{
\textrm
pre
}$
,模型首先通过注意力机制提取上下文信息
$
\mathbi
{
d
}$
:
\parinterval
另一种思路是对传统的编码器-解码器框架进行更改,引入额外的编码器来对上下文句子进行编码,该结构被称为多编码器结构
\upcite
{
DBLP:conf/acl/LiLWJXZLL20,DBLP:conf/discomt/SugiyamaY19
}
。这种结构最早被应用在基于循环神经网络的篇章级翻译模型中
\upcite
{
DBLP:journals/corr/JeanLFC17,DBLP:conf/coling/KuangX18,DBLP:conf/naacl/BawdenSBH18,DBLP:conf/pacling/YamagishiK19
}
,后期证明在Transformer模型上同样适用
\upcite
{
DBLP:journals/corr/abs-1805-10163,DBLP:conf/emnlp/ZhangLSZXZL18
}
。图
\ref
{
fig:17-18
}
展示了一个基于Transformer模型的多编码器结构,基于源语言当前待翻译句子的编码表示
$
\mathbi
{
h
}$
和上下文句子的编码表示
$
\mathbi
{
h
}^{
\textrm
pre
}$
,模型首先通过注意力机制提取
句子间
上下文信息
$
\mathbi
{
d
}$
:
\begin{eqnarray}
\mathbi
{
d
}&
=
&
\textrm
{
Attention
}
(
\mathbi
{
h
}
,
\mathbi
{
h
}^{
\textrm
pre
}
,
\mathbi
{
h
}^{
\textrm
pre
}
)
\label
{
eq:17-3-3
}
...
...
@@ -604,7 +604,7 @@
\noindent
之后,分别计算词级和句子级注意力模型。需要注意的是句子级注意力添加了一个前馈全连接网络子层FFN。其具体计算方式如下:
\begin{eqnarray}
\mathbi
{
s
}^
k
&
=
&
\textrm
{
WordAttention
}
(
\mathbi
{
q
}_{
w
}
,
\mathbi
{
h
}^{
k
}
,
\mathbi
{
h
}^{
k
}
)
\mathbi
{
s
}^
k
&
=
&
\textrm
{
WordAttention
}
(
\mathbi
{
q
}_{
w
}
,
\mathbi
{
h
}^{
\textrm
{
pre
}
k
}
,
\mathbi
{
h
}^{
\textrm
{
pre
}
k
}
)
\label
{
eq:17-3-7
}
\\
\mathbi
{
d
}_
t
&
=
&
\textrm
{
FFN
}
(
\textrm
{
SentAttention
}
(
\mathbi
{
q
}_{
s
}
,
\mathbi
{
s
}
,
\mathbi
{
s
}
))
\label
{
eq:17-3-9
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论