Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
d2l-zh
提交
2b92f248
D
d2l-zh
项目概览
OpenDocCN
/
d2l-zh
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
d2l-zh
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2b92f248
编写于
7月 17, 2018
作者:
M
muli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add seq2seq svg
上级
d73230ff
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
178 addition
and
1 deletion
+178
-1
chapter_natural-language-processing/seq2seq.md
chapter_natural-language-processing/seq2seq.md
+6
-1
img/seq2seq.svg
img/seq2seq.svg
+172
-0
未找到文件。
chapter_natural-language-processing/seq2seq.md
浏览文件 @
2b92f248
...
...
@@ -6,7 +6,12 @@
> 法语输出:“Ils”、“regardent”、“.”
当输入输出都是不定长序列时,我们可以使用编码器—解码器(encoder-decoder)[1] 或者seq2seq模型 [2]。这两个模型本质上都用到了两个循环神经网络,分别叫做编码器和解码器。编码器对应输入序列,解码器对应输出序列。下面我们来介绍编码器—解码器的设计。
当输入输出都是不定长序列时,我们可以使用编码器—解码器(encoder-decoder)[1] 或者seq2seq模型 [2]。这两个模型本质上都用到了两个循环神经网络,分别叫做编码器和解码器。编码器对应输入序列,解码器对应输出序列。
![
编码器—解码器。
](
../img/seq2seq.svg
)
下面我们来介绍编码器—解码器的设计。
## 编码器
...
...
img/seq2seq.svg
0 → 100644
浏览文件 @
2b92f248
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg
xmlns:dc=
"http://purl.org/dc/elements/1.1/"
xmlns:xl=
"http://www.w3.org/1999/xlink"
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
viewBox=
"152 164 311.94737 113"
width=
"311.94737"
height=
"113"
>
<defs>
<font-face
font-family=
"Arial"
font-size=
"9"
panose-1=
"2 11 6 4 2 2 2 2 2 4"
units-per-em=
"1000"
underline-position=
"-105.95703"
underline-thickness=
"73.24219"
slope=
"0"
x-height=
"518.5547"
cap-height=
"716.3086"
ascent=
"905.2734"
descent=
"-211.91406"
font-weight=
"400"
>
<font-face-src>
<font-face-name
name=
"ArialMT"
/>
</font-face-src>
</font-face>
<marker
orient=
"auto"
overflow=
"visible"
markerUnits=
"strokeWidth"
id=
"StickArrow_Marker"
stroke-linejoin=
"miter"
stroke-miterlimit=
"10"
viewBox=
"-1 -4 10 8"
markerWidth=
"10"
markerHeight=
"8"
color=
"black"
>
<g>
<path
d=
"M 8 0 L 0 0 M 0 -3 L 8 0 L 0 3"
fill=
"none"
stroke=
"currentColor"
stroke-width=
"1"
/>
</g>
</marker>
<font-face
font-family=
"PingFang SC"
font-size=
"9"
panose-1=
"2 11 4 0 0 0 0 0 0 0"
units-per-em=
"1000"
underline-position=
"-150"
underline-thickness=
"58"
slope=
"0"
x-height=
"600"
cap-height=
"860"
ascent=
"1060.0021"
descent=
"-340.0007"
font-weight=
"400"
>
<font-face-src>
<font-face-name
name=
"PingFangSC-Regular"
/>
</font-face-src>
</font-face>
</defs>
<metadata>
Produced by OmniGraffle 7.7.1
<dc:date>
2018-07-17 23:39:11 +0000
</dc:date>
</metadata>
<g
id=
"seq2seq"
fill-opacity=
"1"
stroke-dasharray=
"none"
stroke=
"none"
stroke-opacity=
"1"
fill=
"none"
>
<title>
seq2seq
</title>
<rect
fill=
"white"
x=
"152"
y=
"164"
width=
"311.94737"
height=
"113"
/>
<g
id=
"seq2seq: Layer 1"
>
<title>
Layer 1
</title>
<g
id=
"Graphic_3"
>
<rect
x=
"153"
y=
"223.5"
width=
"28"
height=
"20"
fill=
"#d3e8ff"
/>
<rect
x=
"153"
y=
"223.5"
width=
"28"
height=
"20"
stroke=
"black"
stroke-linecap=
"round"
stroke-linejoin=
"round"
stroke-width=
"1"
/>
</g>
<g
id=
"Graphic_4"
>
<text
transform=
"translate(157 260.0528)"
fill=
"black"
>
<tspan
font-family=
"Arial"
font-size=
"9"
font-weight=
"400"
fill=
"black"
x=
".4958496"
y=
"8"
>
They
</tspan>
</text>
</g>
<g
id=
"Graphic_5"
>
<text
transform=
"translate(203.45614 261.35278)"
fill=
"black"
>
<tspan
font-family=
"Arial"
font-size=
"9"
font-weight=
"400"
fill=
"black"
x=
".49609375"
y=
"8"
>
are
</tspan>
</text>
</g>
<g
id=
"Graphic_6"
>
<text
transform=
"translate(236.80702 261.35278)"
fill=
"black"
>
<tspan
font-family=
"Arial"
font-size=
"9"
font-weight=
"400"
fill=
"black"
x=
".23950195"
y=
"8"
>
watching
</tspan>
</text>
</g>
<g
id=
"Graphic_7"
>
<text
transform=
"translate(283.30702 261.35278)"
fill=
"black"
>
<tspan
font-family=
"Arial"
font-size=
"9"
font-weight=
"400"
fill=
"black"
x=
".2409668"
y=
"8"
>
<
EOS
>
</tspan>
</text>
</g>
<g
id=
"Graphic_8"
>
<rect
x=
"197"
y=
"223.5"
width=
"28"
height=
"20"
fill=
"#d3e8ff"
/>
<rect
x=
"197"
y=
"223.5"
width=
"28"
height=
"20"
stroke=
"black"
stroke-linecap=
"round"
stroke-linejoin=
"round"
stroke-width=
"1"
/>
</g>
<g
id=
"Line_9"
>
<line
x1=
"167.33438"
y1=
"254.7"
x2=
"167.31386"
y2=
"253.39877"
marker-end=
"url(#StickArrow_Marker)"
stroke=
"black"
stroke-linecap=
"round"
stroke-linejoin=
"round"
stroke-width=
"1"
/>
</g>
<g
id=
"Line_10"
>
<line
x1=
"210.62919"
y1=
"256"
x2=
"210.67206"
y2=
"253.39866"
marker-end=
"url(#StickArrow_Marker)"
stroke=
"black"
stroke-linecap=
"round"
stroke-linejoin=
"round"
stroke-width=
"1"
/>
</g>
<g
id=
"Graphic_11"
>
<rect
x=
"241"
y=
"223.5"
width=
"28"
height=
"20"
fill=
"#d3e8ff"
/>
<rect
x=
"241"
y=
"223.5"
width=
"28"
height=
"20"
stroke=
"black"
stroke-linecap=
"round"
stroke-linejoin=
"round"
stroke-width=
"1"
/>
</g>
<g
id=
"Graphic_12"
>
<rect
x=
"285"
y=
"223.5"
width=
"28"
height=
"20"
fill=
"#d3e8ff"
/>
<rect
x=
"285"
y=
"223.5"
width=
"28"
height=
"20"
stroke=
"black"
stroke-linecap=
"round"
stroke-linejoin=
"round"
stroke-width=
"1"
/>
</g>
<g
id=
"Graphic_13"
>
<rect
x=
"337"
y=
"223.5"
width=
"28"
height=
"20"
fill=
"white"
/>
<rect
x=
"337"
y=
"223.5"
width=
"28"
height=
"20"
stroke=
"black"
stroke-linecap=
"round"
stroke-linejoin=
"round"
stroke-width=
"1"
/>
</g>
<g
id=
"Graphic_14"
>
<rect
x=
"381"
y=
"223.5"
width=
"28"
height=
"20"
fill=
"white"
/>
<rect
x=
"381"
y=
"223.5"
width=
"28"
height=
"20"
stroke=
"black"
stroke-linecap=
"round"
stroke-linejoin=
"round"
stroke-width=
"1"
/>
</g>
<g
id=
"Graphic_15"
>
<rect
x=
"426"
y=
"223.5"
width=
"27"
height=
"20"
fill=
"white"
/>
<rect
x=
"426"
y=
"223.5"
width=
"27"
height=
"20"
stroke=
"black"
stroke-linecap=
"round"
stroke-linejoin=
"round"
stroke-width=
"1"
/>
</g>
<g
id=
"Line_16"
>
<line
x1=
"254.86842"
y1=
"256"
x2=
"254.88363"
y2=
"253.39983"
marker-end=
"url(#StickArrow_Marker)"
stroke=
"black"
stroke-linecap=
"round"
stroke-linejoin=
"round"
stroke-width=
"1"
/>
</g>
<g
id=
"Line_17"
>
<line
x1=
"298.5275"
y1=
"256"
x2=
"298.58216"
y2=
"253.39782"
marker-end=
"url(#StickArrow_Marker)"
stroke=
"black"
stroke-linecap=
"round"
stroke-linejoin=
"round"
stroke-width=
"1"
/>
</g>
<g
id=
"Graphic_18"
>
<text
transform=
"translate(335.807 261.35278)"
fill=
"black"
>
<tspan
font-family=
"Arial"
font-size=
"9"
font-weight=
"400"
fill=
"black"
x=
".2409668"
y=
"8"
>
<
BOS
>
</tspan>
</text>
</g>
<g
id=
"Graphic_19"
>
<text
transform=
"translate(390.1228 261.35278)"
fill=
"black"
>
<tspan
font-family=
"Arial"
font-size=
"9"
font-weight=
"400"
fill=
"black"
x=
"0"
y=
"8"
>
Ils
</tspan>
</text>
</g>
<g
id=
"Graphic_20"
>
<text
transform=
"translate(419.94737 261.35278)"
fill=
"black"
>
<tspan
font-family=
"Arial"
font-size=
"9"
font-weight=
"400"
fill=
"black"
x=
".23657227"
y=
"8"
>
regardent
</tspan>
</text>
</g>
<g
id=
"Graphic_23"
>
<text
transform=
"translate(346.9608 193.35278)"
fill=
"black"
>
<tspan
font-family=
"Arial"
font-size=
"9"
font-weight=
"400"
fill=
"black"
x=
"0"
y=
"8"
>
Ils
</tspan>
</text>
</g>
<g
id=
"Graphic_24"
>
<text
transform=
"translate(375.94118 193.35278)"
fill=
"black"
>
<tspan
font-family=
"Arial"
font-size=
"9"
font-weight=
"400"
fill=
"black"
x=
".23657227"
y=
"8"
>
regardent
</tspan>
</text>
</g>
<g
id=
"Graphic_26"
>
<text
transform=
"translate(424.58824 193.35278)"
fill=
"black"
>
<tspan
font-family=
"Arial"
font-size=
"9"
font-weight=
"400"
fill=
"black"
x=
".2409668"
y=
"8"
>
<
EOS
>
</tspan>
</text>
</g>
<g
id=
"Line_27"
>
<line
x1=
"350.86842"
y1=
"256"
x2=
"350.88363"
y2=
"253.39983"
marker-end=
"url(#StickArrow_Marker)"
stroke=
"black"
stroke-linecap=
"round"
stroke-linejoin=
"round"
stroke-width=
"1"
/>
</g>
<g
id=
"Line_28"
>
<line
x1=
"351.13165"
y1=
"223.5"
x2=
"351.19222"
y2=
"218.89914"
marker-end=
"url(#StickArrow_Marker)"
stroke=
"black"
stroke-linecap=
"round"
stroke-linejoin=
"round"
stroke-width=
"1"
/>
</g>
<g
id=
"Line_29"
>
<line
x1=
"394.7428"
y1=
"256"
x2=
"394.77255"
y2=
"253.39935"
marker-end=
"url(#StickArrow_Marker)"
stroke=
"black"
stroke-linecap=
"round"
stroke-linejoin=
"round"
stroke-width=
"1"
/>
</g>
<g
id=
"Line_30"
>
<line
x1=
"395.12605"
y1=
"223.5"
x2=
"395.18404"
y2=
"218.89921"
marker-end=
"url(#StickArrow_Marker)"
stroke=
"black"
stroke-linecap=
"round"
stroke-linejoin=
"round"
stroke-width=
"1"
/>
</g>
<g
id=
"Line_31"
>
<line
x1=
"439.4641"
y1=
"256"
x2=
"439.46826"
y2=
"253.4"
marker-end=
"url(#StickArrow_Marker)"
stroke=
"black"
stroke-linecap=
"round"
stroke-linejoin=
"round"
stroke-width=
"1"
/>
</g>
<g
id=
"Line_32"
>
<line
x1=
"439.5252"
y1=
"223.5"
x2=
"439.5368"
y2=
"218.89997"
marker-end=
"url(#StickArrow_Marker)"
stroke=
"black"
stroke-linecap=
"round"
stroke-linejoin=
"round"
stroke-width=
"1"
/>
</g>
<g
id=
"Line_33"
>
<line
x1=
"181"
y1=
"233.5"
x2=
"187.1"
y2=
"233.5"
marker-end=
"url(#StickArrow_Marker)"
stroke=
"black"
stroke-linecap=
"round"
stroke-linejoin=
"round"
stroke-width=
"1"
/>
</g>
<g
id=
"Line_34"
>
<line
x1=
"225"
y1=
"233.5"
x2=
"231.1"
y2=
"233.5"
marker-end=
"url(#StickArrow_Marker)"
stroke=
"black"
stroke-linecap=
"round"
stroke-linejoin=
"round"
stroke-width=
"1"
/>
</g>
<g
id=
"Line_35"
>
<line
x1=
"269"
y1=
"233.5"
x2=
"275.1"
y2=
"233.5"
marker-end=
"url(#StickArrow_Marker)"
stroke=
"black"
stroke-linecap=
"round"
stroke-linejoin=
"round"
stroke-width=
"1"
/>
</g>
<g
id=
"Line_36"
>
<line
x1=
"313"
y1=
"233.5"
x2=
"327.1"
y2=
"233.5"
marker-end=
"url(#StickArrow_Marker)"
stroke=
"black"
stroke-linecap=
"round"
stroke-linejoin=
"round"
stroke-width=
"1"
/>
</g>
<g
id=
"Line_37"
>
<line
x1=
"365"
y1=
"233.5"
x2=
"371.1"
y2=
"233.5"
marker-end=
"url(#StickArrow_Marker)"
stroke=
"black"
stroke-linecap=
"round"
stroke-linejoin=
"round"
stroke-width=
"1"
/>
</g>
<g
id=
"Line_38"
>
<line
x1=
"409"
y1=
"233.5"
x2=
"416.1"
y2=
"233.5"
marker-end=
"url(#StickArrow_Marker)"
stroke=
"black"
stroke-linecap=
"round"
stroke-linejoin=
"round"
stroke-width=
"1"
/>
</g>
<g
id=
"Graphic_39"
>
<text
transform=
"translate(221 169.5)"
fill=
"black"
>
<tspan
font-family=
"PingFang SC"
font-size=
"9"
font-weight=
"400"
fill=
"black"
x=
"0"
y=
"10"
>
编码器
</tspan>
</text>
</g>
<g
id=
"Graphic_40"
>
<text
transform=
"translate(381.49805 169.5)"
fill=
"black"
>
<tspan
font-family=
"PingFang SC"
font-size=
"9"
font-weight=
"400"
fill=
"black"
x=
"0"
y=
"10"
>
解码器
</tspan>
</text>
</g>
<g
id=
"Graphic_41"
>
<text
transform=
"translate(322.35135 169.5)"
fill=
"black"
>
<tspan
font-family=
"PingFang SC"
font-size=
"9"
font-weight=
"400"
fill=
"black"
x=
".1225"
y=
"10"
>
|
</tspan>
</text>
</g>
</g>
</g>
</svg>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录