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
3b176929
Commit
3b176929
authored
Jan 14, 2021
by
zengxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
10
parent
11979fdb
显示空白字符变更
内嵌
并排
正在显示
20 个修改的文件
包含
103 行增加
和
101 行删除
+103
-101
Chapter10/Figures/figure-3-base-problom-of-p.tex
+6
-6
Chapter10/Figures/figure-a-working-example-of-neural-machine-translation.tex
+3
-3
Chapter10/Figures/figure-attention-of-source-and-target-words.tex
+5
-5
Chapter10/Figures/figure-beam-search-process.tex
+3
-3
Chapter10/Figures/figure-bi-rnn.tex
+1
-1
Chapter10/Figures/figure-calculation-process-of-context-vector-c.tex
+11
-11
Chapter10/Figures/figure-data-parallel-process.tex
+4
-4
Chapter10/Figures/figure-decode-the-word-probability-distribution-at-the-first-position.tex
+1
-1
Chapter10/Figures/figure-decoding-process-based-on-greedy-method.tex
+2
-2
Chapter10/Figures/figure-double-layer-rnn.tex
+3
-3
Chapter10/Figures/figure-encoder-decoder-with-attention.tex
+14
-14
Chapter10/Figures/figure-model-structure-based-on-recurrent-neural-network-translation.tex
+2
-2
Chapter10/Figures/figure-numbers-of-wmt-systems.tex
+15
-14
Chapter10/Figures/figure-presentation-space.tex
+3
-3
Chapter10/Figures/figure-query-model-corresponding-to-attention-mechanism.tex
+9
-8
Chapter10/Figures/figure-query-model-corresponding-to-traditional-query-model-vs-attention-mechanism.tex
+5
-5
Chapter10/Figures/figure-relationship-between-learning-rate-and-number-of-updates.tex
+1
-1
Chapter10/Figures/figure-score-of-mter.tex
+1
-1
Chapter10/Figures/figure-structure-of-a-recurrent-network-model.tex
+4
-4
Chapter10/Figures/figure-structure-of-gnmt.tex
+10
-10
没有找到文件。
Chapter10/Figures/figure-3-base-problom-of-p.tex
查看文件 @
3b176929
...
...
@@ -12,7 +12,7 @@
% RNN Encoder
\coordinate
(eemb0) at (0,0);
\foreach
\x
[count=
\y
from 0] in
{
1,2,...,3
}
\node
[rnnnode,minimum height=0.5\base,fill=green!30!white,anchor=west]
(eemb
\x
) at ([xshift=0.
4
\base
]eemb
\y
.east)
{
\tiny
{$
\textrm
{
e
}_
x
()
$}}
;
\node
[rnnnode,minimum height=0.5\base,fill=green!30!white,anchor=west]
(eemb
\x
) at ([xshift=0.
6
\base
]eemb
\y
.east)
{
\tiny
{$
\textrm
{
e
}_
x
()
$}}
;
\foreach
\x
in
{
1,2,...,3
}
\node
[rnnnode,fill=blue!30!white,anchor=south]
(enc
\x
) at ([yshift=0.3
\base
]eemb
\x
.north)
{}
;
\node
[]
(enclabel1) at (enc1)
{
\tiny
{$
\mathbi
{
h
}_{
m
-
2
}$}}
;
...
...
@@ -73,7 +73,7 @@
\draw
[-latex']
(enc3.north) .. controls +(north:0.3
\base
) and +(east:
\base
) .. (bridge) .. controls +(west:2.7
\base
) and +(west:0.3
\base
) .. (dec1.west);
{
\node
[anchor=east] (line1) at ([xshift=-
3
em,yshift=0.5em]softmax1.west)
{
\scriptsize
{
基于RNN的隐层状态
$
\mathbi
{
s
}_
i
$}}
;
\node
[anchor=east] (line1) at ([xshift=-
4
em,yshift=0.5em]softmax1.west)
{
\scriptsize
{
基于RNN的隐层状态
$
\mathbi
{
s
}_
i
$}}
;
\node
[anchor=north west] (line2) at ([yshift=0.3em]line1.south west)
{
\scriptsize
{
预测目标词的概率
}}
;
\node
[anchor=north west] (line3) at ([yshift=0.3em]line2.south west)
{
\scriptsize
{
通常,用Softmax函数
}}
;
\node
[anchor=north west] (line4) at ([yshift=0.3em]line3.south west)
{
\scriptsize
{
实现
$
\funp
{
P
}
(
y
_
i|...
)
$}}
;
...
...
@@ -87,7 +87,7 @@
}
{
\node
[anchor=west] (line21) at ([xshift=
1
.3em,yshift=1.5em]enc3.east)
{
\scriptsize
{
源语编码器最后一个
}}
;
\node
[anchor=west] (line21) at ([xshift=
3
.3em,yshift=1.5em]enc3.east)
{
\scriptsize
{
源语编码器最后一个
}}
;
\node
[anchor=north west] (line22) at ([yshift=0.3em]line21.south west)
{
\scriptsize
{
循环单元的输出被
}}
;
\node
[anchor=north west] (line23) at ([yshift=0.3em]line22.south west)
{
\scriptsize
{
看作是句子的表示,
}}
;
\node
[anchor=north west] (line24) at ([yshift=0.3em]line23.south west)
{
\scriptsize
{
记为
$
\mathbi
{
C
}$}}
;
...
...
@@ -97,21 +97,21 @@
{
\node
[rectangle,inner sep=0.2em,rounded corners=1pt,fill=red!10,drop shadow,draw=red,minimum width =9em] [fit = (line1) (line2) (line3) (line4)] (box1)
{}
;
\node
[rectangle,inner sep=0.2em,rounded corners=1pt,very thick,dotted,draw=red] [fit = (softmax1) (softmax2) (softmax3)] (box4)
{}
;
\draw
[->,dotted,very thick,red] ([yshift=1em,xshift=
2
.5em]box1.east) -- ([yshift=1em,xshift=0.1em]box1.east);
\draw
[->,dotted,very thick,red] ([yshift=1em,xshift=
3
.5em]box1.east) -- ([yshift=1em,xshift=0.1em]box1.east);
}
{
\node
[rectangle,inner sep=0.2em,rounded corners=1pt,fill=green!10,drop shadow,draw=ugreen,minimum width =9em] [fit = (line11) (line12) (line13) (line14)] (box2)
{}
;
\node
[rectangle,inner sep=0.2em,rounded corners=1pt,very thick,dotted,draw=ugreen] [fit = (eemb1) (eemb2) (eemb3)] (box5)
{}
;
\node
[rectangle,inner sep=0.2em,rounded corners=1pt,very thick,dotted,draw=ugreen] [fit = (demb1) (demb2) (demb3)] (box6)
{}
;
\draw
[->,dotted,very thick,ugreen] ([yshift=-1.
3em,xshift=2.5em]box2.east) -- ([yshift=-1.3
em,xshift=0.1em]box2.east);
\draw
[->,dotted,very thick,ugreen] ([yshift=-1.
7em,xshift=3.5em]box2.east) -- ([yshift=-1.7
em,xshift=0.1em]box2.east);
\draw
[->,dotted,very thick,ugreen] ([xshift=0.1em]box6.west) .. controls +(west:1) and +(east:1) .. ([yshift=1.0em]box2.east) ;
}
{
\node
[rectangle,inner sep=0.2em,rounded corners=1pt,fill=purple!10,drop shadow,draw=purple] [fit = (line21) (line22) (line23) (line24)] (box3)
{}
;
\node
[rectangle,inner sep=0.2em,rounded corners=1pt,very thick,dotted,draw=purple] [fit = (enc3)] (box7)
{}
;
\draw
[->,dotted,very thick,purple] ([xshift=0.1em]box7.east) -- ([xshift=
0
.8em]box7.east) ;
\draw
[->,dotted,very thick,purple] ([xshift=0.1em]box7.east) -- ([xshift=
2
.8em]box7.east) ;
}
\end{pgfonlayer}
...
...
Chapter10/Figures/figure-a-working-example-of-neural-machine-translation.tex
查看文件 @
3b176929
...
...
@@ -10,11 +10,11 @@
% RNN Encoder
\coordinate
(eemb0) at (0,0);
\foreach
\x
[count=
\y
from 0] in
{
1,2,...,4
}
\node
[rnnnode,minimum height=0.5\base,fill=green!30!white,anchor=west]
(eemb
\x
) at ([xshift=0.
4
\base
]eemb
\y
.east)
{}
;
\node
[rnnnode,minimum height=0.5\base,fill=green!30!white,anchor=west]
(eemb
\x
) at ([xshift=0.
7
\base
]eemb
\y
.east)
{}
;
\foreach
\x
in
{
1,2,...,4
}
\node
[rnnnode,fill=blue!30!white,anchor=south]
(enc
\x
) at ([yshift=0.5
\base
]eemb
\x
.north)
{}
;
\node
[wordnode,left=0.4\base of enc1,font=\footnotesize]
(init)
{
0
}
;
\node
[wordnode,anchor=east]
(init2) at ([xshift=-3
.0
em]init.west)
{}
;
\node
[wordnode,anchor=east]
(init2) at ([xshift=-3em]init.west)
{}
;
{
\node
[rnnnode,fill=purple]
(repr) at (enc4)
{}
;
\node
[wordnode]
(label) at ([yshift=2.5em]enc4.north)
{
...
...
@@ -35,7 +35,7 @@
% RNN Decoder
\foreach
\x
in
{
1,2,...,4
}
\node
[rnnnode,minimum height=0.5\base,fill=green!30!white,anchor=south]
(demb
\x
) at ([xshift=
9
.5em,yshift=-3.9em]enc
\x
.north)
{}
;
\node
[rnnnode,minimum height=0.5\base,fill=green!30!white,anchor=south]
(demb
\x
) at ([xshift=
12
.5em,yshift=-3.9em]enc
\x
.north)
{}
;
\foreach
\x
in
{
1,2,...,4
}
\node
[rnnnode,fill=blue!30!white,anchor=south]
(dec
\x
) at ([yshift=0.5
\base
]demb
\x
.north)
{}
;
\foreach
\x
in
{
1,2,...,4
}
...
...
Chapter10/Figures/figure-attention-of-source-and-target-words.tex
查看文件 @
3b176929
...
...
@@ -11,7 +11,7 @@
%\setlength{\mystep}{1.6em}
\foreach
\x
in
{
1,2,...,6
}
\node
[]
(s
\x
) at (
\x
*
1.6
em,0)
{}
;
\node
[]
(s
\x
) at (
\x
*
2
em,0)
{}
;
\node
[] (ws1) at (s1)
{
\scriptsize
{
这
}}
;
\node
[] (ws2) at (s2)
{
\scriptsize
{
是
}}
;
...
...
@@ -21,7 +21,7 @@
\node
[] (ws6) at (s6)
{
\scriptsize
{
句子
}}
;
\foreach
\x
in
{
1,2,...,6
}
\node
[]
(t
\x
) at (
\x
*
1.6em + 2.4
in,0)
{}
;
\node
[]
(t
\x
) at (
\x
*
2em + 2.8
in,0)
{}
;
\node
[] (wt1) at (t1)
{
\scriptsize
{
This
}}
;
\node
[] (wt2) at (t2)
{
\scriptsize
{
is
}}
;
...
...
@@ -30,9 +30,9 @@
\node
[] (wt5) at (t5)
{
\scriptsize
{
long
}}
;
\node
[] (wt6) at ([xshift=1em]t6)
{
\scriptsize
{
sentence
}}
;
\node
[anchor=south west,fill=red!30,minimum width=1.
6in,minimum height=1.5em] (encoder) at ([yshift=1.0
em]ws1.north west)
{
\footnotesize
{
Encoder
}}
;
\node
[anchor=west,fill=
blue!30,minimum width=1.9in,minimum height=1.5em] (decoder) at ([xshift=4.5em]encoder.east)
{
\footnotesize
{
Decoder
}}
;
\node
[anchor=west,fill=
green!30,minimum height=1.5em] (representation) at ([xshift=1em]encoder.east)
{
\footnotesize
{
表示
}}
;
\node
[anchor=south west,fill=red!30,minimum width=1.
9in,minimum height=1.5em] (encoder) at ([yshift=1.0em,xshift=-0.4
em]ws1.north west)
{
\footnotesize
{
Encoder
}}
;
\node
[anchor=west,fill=
green!30,minimum height=1.5em] (representation) at ([xshift=2em]encoder.east)
{
\footnotesize
{
表示
}}
;
\node
[anchor=west,fill=
blue!30,minimum width=1.9in,minimum height=1.5em] (decoder) at ([xshift=2em]representation.east)
{
\footnotesize
{
Decoder
}}
;
\draw
[->,thick] ([xshift=1pt]encoder.east)--([xshift=-1pt]representation.west);
\draw
[->,thick] ([xshift=1pt]representation.east)--([xshift=-1pt]decoder.west);
...
...
Chapter10/Figures/figure-beam-search-process.tex
查看文件 @
3b176929
...
...
@@ -5,7 +5,7 @@
\begin{tikzpicture}
\begin{scope}
\tikzstyle
{
rnnnode
}
= [minimum height=1.1em,minimum width=
3.5
em,inner sep=2pt,rounded corners=1pt,draw,fill=red!20];
\tikzstyle
{
rnnnode
}
= [minimum height=1.1em,minimum width=
4
em,inner sep=2pt,rounded corners=1pt,draw,fill=red!20];
\tikzstyle
{
wnode
}
= [minimum height=1.0em,minimum width=3.5em,inner sep=2pt,rounded corners=1pt,draw,fill=white];
...
...
@@ -137,13 +137,13 @@
}
{
\node
[anchor=east] (vocab) at ([xshift=-
5
em]s1.west)
{
\tiny
{$
\begin
{
bmatrix
}
\textrm
{
Have
}
&
0
.
50
\\
\textrm
{
I
}
&
0
.
02
\\
\textrm
{
it
}
&
0
.
03
\\
\textrm
{
has
}
&
0
.
30
\\
\textrm
{
you
}
&
0
.
01
\\
\textrm
{
the
}
&
0
.
01
\\
\textrm
{
a
}
&
0
.
01
\\
\textrm
{
an
}
&
0
.
02
\\
\textrm
{
he
}
&
0
.
03
\\
\textrm
{
she
}
&
0
.
01
\\
\textrm
{
are
}
&
0
.
00
\\
\textrm
{
am
}
&
0
.
01
\\
...
&
...
\end
{
bmatrix
}$}}
;
\node
[anchor=east] (vocab) at ([xshift=-
8
em]s1.west)
{
\tiny
{$
\begin
{
bmatrix
}
\textrm
{
Have
}
&
0
.
50
\\
\textrm
{
I
}
&
0
.
02
\\
\textrm
{
it
}
&
0
.
03
\\
\textrm
{
has
}
&
0
.
30
\\
\textrm
{
you
}
&
0
.
01
\\
\textrm
{
the
}
&
0
.
01
\\
\textrm
{
a
}
&
0
.
01
\\
\textrm
{
an
}
&
0
.
02
\\
\textrm
{
he
}
&
0
.
03
\\
\textrm
{
she
}
&
0
.
01
\\
\textrm
{
are
}
&
0
.
00
\\
\textrm
{
am
}
&
0
.
01
\\
...
&
...
\end
{
bmatrix
}$}}
;
\node
[anchor=south] (vocablabel) at (vocab.north)
{
\scriptsize
{
单词的概率分布
}}
;
\draw
[->,red,very thick,dotted] (o1.west) .. controls +(west:1) and +(east:2) .. ([yshift=1em]vocab.south east);
}
{
\node
[anchor=east,inner sep=1pt] (vocabtopn) at ([xshift=-
0
.5em,yshift=-0.5em]wo1.west)
{
\scriptsize
{$
\begin
{
bmatrix
}
\textrm
{
Have
}
\\
\textrm
{
has
}
\\
\textrm
{
it
}
\end
{
bmatrix
}$}}
;
\node
[anchor=east,inner sep=1pt] (vocabtopn) at ([xshift=-
1
.5em,yshift=-0.5em]wo1.west)
{
\scriptsize
{$
\begin
{
bmatrix
}
\textrm
{
Have
}
\\
\textrm
{
has
}
\\
\textrm
{
it
}
\end
{
bmatrix
}$}}
;
\draw
[->] ([yshift=-1.6em,xshift=-0.4em]vocab.north east) .. controls +(east:1) and +(west:1) .. ([xshift=0.1em,yshift=0.4em]vocabtopn.west) node [pos=0.3,below] (topnlabel)
{
\scriptsize
{
top-3
}}
;
{
...
...
Chapter10/Figures/figure-bi-rnn.tex
查看文件 @
3b176929
...
...
@@ -13,7 +13,7 @@
% RNN Encoder
\coordinate
(eemb0) at (0,0);
\foreach
\x
[count=
\y
from 0] in
{
1,2,...,10
}
\node
[rnnnode,minimum height=0.5\base,fill=green!30!white,anchor=west]
(eemb
\x
) at ([xshift=0.
4
\base
]eemb
\y
.east)
{}
;
\node
[rnnnode,minimum height=0.5\base,fill=green!30!white,anchor=west]
(eemb
\x
) at ([xshift=0.
7
\base
]eemb
\y
.east)
{}
;
\foreach
\x
in
{
1,2,...,10
}
\node
[rnnnode,fill=blue!30!white,anchor=south]
(backenc
\x
) at ([yshift=0.5
\base
]eemb
\x
.north)
{}
;
\foreach
\x
in
{
1,2,...,10
}
...
...
Chapter10/Figures/figure-calculation-process-of-context-vector-c.tex
查看文件 @
3b176929
...
...
@@ -8,25 +8,25 @@
\begin{scope}
\node
[anchor=west,draw,fill=red!
2
0!white,inner sep=3pt,minimum width=2em,minimum height=1.2em] (h1) at (0,0)
{
\scriptsize
{$
\mathbi
{
h
}_
1
$}}
;
\node
[anchor=west,draw,fill=red!
20!white,inner sep=3pt,minimum width=2em,minimum height=1.2em] (h2) at ([xshift=1
em]h1.east)
{
\scriptsize
{$
\mathbi
{
h
}_
2
$}}
;
\node
[anchor=west,inner sep=0pt,minimum width=3em] (h3) at ([xshift=
0.5
em]h2.east)
{
\scriptsize
{
...
}}
;
\node
[anchor=west,draw,fill=red!
20!white,inner sep=3pt,minimum width=2em,minimum height=1.2em] (h4) at ([xshift=0.5
em]h3.east)
{
\scriptsize
{$
\mathbi
{
h
}_
m
$}}
;
\node
[anchor=west,draw,fill=red!
3
0!white,inner sep=3pt,minimum width=2em,minimum height=1.2em] (h1) at (0,0)
{
\scriptsize
{$
\mathbi
{
h
}_
1
$}}
;
\node
[anchor=west,draw,fill=red!
30!white,inner sep=3pt,minimum width=2em,minimum height=1.2em] (h2) at ([xshift=2
em]h1.east)
{
\scriptsize
{$
\mathbi
{
h
}_
2
$}}
;
\node
[anchor=west,inner sep=0pt,minimum width=3em] (h3) at ([xshift=
1
em]h2.east)
{
\scriptsize
{
...
}}
;
\node
[anchor=west,draw,fill=red!
30!white,inner sep=3pt,minimum width=2em,minimum height=1.2em] (h4) at ([xshift=1
em]h3.east)
{
\scriptsize
{$
\mathbi
{
h
}_
m
$}}
;
\node
[anchor=south,circle,minimum size=1.0em,draw,ublue,thick] (sum) at ([yshift=2em]h2.north east)
{}
;
\draw
[thick,-,ublue] (sum.north) -- (sum.south);
\draw
[thick,-,ublue] (sum.west) -- (sum.east);
\node
[anchor=south,draw,fill=green!
2
0!white,inner sep=3pt,minimum width=2em,minimum height=1.2em] (th1) at ([yshift=2em,xshift=-1em]sum.north west)
{
\scriptsize
{$
\mathbi
{
s
}_{
j
-
1
}$}}
;
\node
[anchor=west,draw,fill=green!
20!white,inner sep=3pt,minimum width=2em,minimum height=1.2em] (th2) at ([xshift=2
em]th1.east)
{
\scriptsize
{$
\mathbi
{
s
}_{
j
}$}}
;
\node
[anchor=south,draw,fill=green!
3
0!white,inner sep=3pt,minimum width=2em,minimum height=1.2em] (th1) at ([yshift=2em,xshift=-1em]sum.north west)
{
\scriptsize
{$
\mathbi
{
s
}_{
j
-
1
}$}}
;
\node
[anchor=west,draw,fill=green!
30!white,inner sep=3pt,minimum width=2em,minimum height=1.2em] (th2) at ([xshift=2.5
em]th1.east)
{
\scriptsize
{$
\mathbi
{
s
}_{
j
}$}}
;
\draw
[->] (h1.north) .. controls +(north:0.8) and +(west:1) .. (sum.190) node [pos=0.2,left]
{
\scriptsize
{$
\alpha
_{
1
,j
}$}}
;
\draw
[->] (h2.north) .. controls +(north:0.6) and +(220:0.2) .. (sum.220) node [pos=0.2,right]
{
\scriptsize
{$
\alpha
_{
2
,j
}$}}
;
\draw
[->] (h4.north) .. controls +(north:0.8) and +(east:1) .. (sum.-10) node [pos=0.1,left] (alphan)
{
\scriptsize
{$
\alpha
_{
m,j
}$}}
;
\draw
[->] ([xshift=-
1.5
em]th1.west) -- ([xshift=-0.1em]th1.west);
\draw
[->] ([xshift=-
2
em]th1.west) -- ([xshift=-0.1em]th1.west);
\draw
[->] ([xshift=0.1em]th1.east) -- ([xshift=-0.1em]th2.west);
\draw
[->] ([xshift=0.1em]th2.east) -- ([xshift=
1.5
em]th2.east);
\draw
[->] ([xshift=0.1em]th2.east) -- ([xshift=
2
em]th2.east);
\draw
[->] (sum.north) .. controls +(north:0.8) and +(west:0.2) .. ([yshift=-0.4em,xshift=-0.1em]th2.west) node [pos=0.2,right] (ci)
{
\scriptsize
{$
\mathbi
{
C
}_{
j
}$}}
;
\node
[anchor=south,inner sep=1pt] (output) at ([yshift=0.8em]th2.north)
{
\scriptsize
{
输出层
}}
;
...
...
@@ -39,7 +39,7 @@
\node
[anchor=north] (enc42) at ([yshift=0.5em]enc4.south)
{
\scriptsize
{
(位置
$
m
$
)
}}
;
{
\node
[anchor=west] (math1) at ([xshift=
5
em,yshift=1em]th2.east)
{$
\mathbi
{
C
}_
j
=
\sum
_{
i
}
\alpha
_{
i,j
}
\mathbi
{
h
}_
i
$
\ \ \ \
}
;
\node
[anchor=west] (math1) at ([xshift=
7
em,yshift=1em]th2.east)
{$
\mathbi
{
C
}_
j
=
\sum
_{
i
}
\alpha
_{
i,j
}
\mathbi
{
h
}_
i
$
\ \ \ \
}
;
}
{
\node
[anchor=north west] (math2) at ([yshift=-2em,xshift=-0.2em]math1.south west)
{$
\alpha
_{
i,j
}
=
\frac
{
\exp
(
\beta
_{
i,j
}
)
}{
\sum
_{
i'
}
\exp
(
\beta
_{
i',j
}
)
}$}
;
...
...
@@ -48,10 +48,10 @@
\begin{pgfonlayer}
{
background
}
{
\node
[rectangle,inner sep=0.4em,rounded corners=1pt,fill=blue!
1
0,drop shadow,minimum width=9.5em] [fit = (math1)] (box1)
{}
;
\node
[rectangle,inner sep=0.4em,rounded corners=1pt,fill=blue!
2
0,drop shadow,minimum width=9.5em] [fit = (math1)] (box1)
{}
;
}
{
\node
[rectangle,inner sep=0.4em,rounded corners=1pt,fill=orange!
1
0,drop shadow,minimum width=9.5em] [fit = (math2) (math3)] (box2)
{}
;
\node
[rectangle,inner sep=0.4em,rounded corners=1pt,fill=orange!
2
0,drop shadow,minimum width=9.5em] [fit = (math2) (math3)] (box2)
{}
;
}
\end{pgfonlayer}
...
...
Chapter10/Figures/figure-data-parallel-process.tex
查看文件 @
3b176929
...
...
@@ -17,7 +17,7 @@
\node
[samplenode,anchor=south west,font=
\scriptsize
] (batch
\i
) at ([shift=
{
(-1em,-0.5em)
}
]batch
\j
.south west)
{
句子
\k
}
;
\draw
[decorate,decoration=
{
brace
}
] (batch1.south east) to node [auto,rotate=30,anchor=north,font=
\scriptsize
]
{
batch大小
}
(batch3.south east);
\node
[samplenode,anchor=west,font=
\scriptsize
] (sample2) at ([xshift=
4
em]batch2.east)
{
句子2
}
;
\node
[samplenode,anchor=west,font=
\scriptsize
] (sample2) at ([xshift=
5
em]batch2.east)
{
句子2
}
;
\node
[samplenode,anchor=south,font=
\scriptsize
] (sample3) at ([yshift=3em]sample2.north)
{
句子3
}
;
\node
[samplenode,anchor=north,font=
\scriptsize
] (sample1) at ([yshift=-3em]sample2.south)
{
句子1
}
;
...
...
@@ -26,18 +26,18 @@
\foreach
\i
in
{
1,2,3
}
{
\coordinate
(start) at ([xshift=
2
em]sample
\i
.east);
\coordinate
(start) at ([xshift=
3
em]sample
\i
.east);
\node
[wordnode,anchor=west] (rnn0) at (start)
{$
0
$}
;
\foreach
\j
[count=
\k
from 0] in
{
1,2,3
}
{
\node
[rnnnode,anchor=west] (rnn
\j
) at ([xshift=1em]rnn
\k
.east)
{}
;
\node
[rnnnode,anchor=west] (rnn
\j
) at ([xshift=1
.5
em]rnn
\k
.east)
{}
;
\draw
[-latex'] (rnn
\k
) to (rnn
\j
);
\coordinate
(in
\j
) at ([yshift=-1em]rnn
\j
.south);
\draw
[-latex'] (in
\j
) to (rnn
\j
.south);
\coordinate
(out
\j
) at ([yshift=1em]rnn
\j
.north);
\draw
[-latex'] (rnn
\j
.north) to (out
\j
);
}
\node
[wordnode,anchor=west] (rnn4) at ([xshift=1em]rnn3.east)
{$
\cdots
$}
;
\node
[wordnode,anchor=west] (rnn4) at ([xshift=1
.5
em]rnn3.east)
{$
\cdots
$}
;
\draw
[-latex'] (rnn3) to (rnn4);
\node
[draw,densely dashed,thick,rounded corners=0.3em,fit=(start) (in3) (out3) (rnn4),label=
{
[font=
\footnotesize
,rotate=90,anchor=north]0:设备
\i
}
] (rnn)
{}
;
\draw
[->,double] ([xshift=3pt]sample
\i
.east) -- ([xshift=-3pt]rnn.west);
...
...
Chapter10/Figures/figure-decode-the-word-probability-distribution-at-the-first-position.tex
查看文件 @
3b176929
...
...
@@ -42,7 +42,7 @@
}
{
\node
[anchor=east] (vocab) at ([xshift=-
5
em]s1.west)
{
\tiny
{$
\begin
{
bmatrix
}
\textrm
{
Have
}
&
0
.
50
\\
\textrm
{
I
}
&
0
.
02
\\
\textrm
{
it
}
&
0
.
03
\\
\textrm
{
has
}
&
0
.
30
\\
\textrm
{
you
}
&
0
.
01
\\
\textrm
{
the
}
&
0
.
01
\\
\textrm
{
a
}
&
0
.
01
\\
\textrm
{
an
}
&
0
.
02
\\
\textrm
{
he
}
&
0
.
03
\\
\textrm
{
she
}
&
0
.
01
\\
\textrm
{
are
}
&
0
.
00
\\
\textrm
{
am
}
&
0
.
01
\\
...
&
...
\end
{
bmatrix
}$}}
;
\node
[anchor=east] (vocab) at ([xshift=-
7
em]s1.west)
{
\tiny
{$
\begin
{
bmatrix
}
\textrm
{
Have
}
&
0
.
50
\\
\textrm
{
I
}
&
0
.
02
\\
\textrm
{
it
}
&
0
.
03
\\
\textrm
{
has
}
&
0
.
30
\\
\textrm
{
you
}
&
0
.
01
\\
\textrm
{
the
}
&
0
.
01
\\
\textrm
{
a
}
&
0
.
01
\\
\textrm
{
an
}
&
0
.
02
\\
\textrm
{
he
}
&
0
.
03
\\
\textrm
{
she
}
&
0
.
01
\\
\textrm
{
are
}
&
0
.
00
\\
\textrm
{
am
}
&
0
.
01
\\
...
&
...
\end
{
bmatrix
}$}}
;
\node
[anchor=south] (vocablabel) at (vocab.north)
{
\scriptsize
{
单词的概率分布
}}
;
\draw
[->,red,very thick,dotted] (o1.west) .. controls +(west:1) and +(east:2) .. ([yshift=1em]vocab.south east);
}
...
...
Chapter10/Figures/figure-decoding-process-based-on-greedy-method.tex
查看文件 @
3b176929
\begin{tikzpicture}
\begin{scope}
\tikzstyle
{
rnnnode
}
= [minimum height=1.1em,minimum width=2.
1
em,inner sep=2pt,rounded corners=1pt,draw,fill=red!20];
\tikzstyle
{
rnnnode
}
= [minimum height=1.1em,minimum width=2.
7
em,inner sep=2pt,rounded corners=1pt,draw,fill=red!20];
\node
[rnnnode,anchor=west] (h1) at (0,0)
{
\tiny
{$
\mathbi
{
h
}_
1
$}}
;
\node
[anchor=west] (h2) at ([xshift=1em]h1.east)
{
\tiny
{
...
}}
;
...
...
@@ -139,7 +139,7 @@
\draw
[->] ([yshift=-0.3em]s1.west) .. controls +(west:2) and +(-50:0.3) .. (c2.-40);
}
{
\draw
[->] (c2.0) -- ([xshift=1.
2in]c2.0) -- ([yshift=0.3em,xshift=-1.2
em]s2.west) -- ([yshift=0.3em,xshift=-0.1em]s2.west);
\draw
[->] (c2.0) -- ([xshift=1.
4in]c2.0) -- ([yshift=0.3em,xshift=-1
em]s2.west) -- ([yshift=0.3em,xshift=-0.1em]s2.west);
}
{
...
...
Chapter10/Figures/figure-double-layer-rnn.tex
查看文件 @
3b176929
...
...
@@ -10,7 +10,7 @@
% RNN Encoder
\coordinate
(eemb0) at (0,0);
\foreach
\x
[count=
\y
from 0] in
{
1,2,...,10
}
\node
[rnnnode,minimum height=0.5\base,fill=green!30!white,anchor=west]
(eemb
\x
) at ([xshift=0.
4
\base
]eemb
\y
.east)
{}
;
\node
[rnnnode,minimum height=0.5\base,fill=green!30!white,anchor=west]
(eemb
\x
) at ([xshift=0.
7
\base
]eemb
\y
.east)
{}
;
\foreach
\x
in
{
1,2,...,10
}
\node
[rnnnode,fill=blue!30!white,anchor=south]
(enc1
\x
) at ([yshift=0.3
\base
]eemb
\x
.north)
{}
;
\foreach
\x
in
{
1,2,...,10
}
...
...
@@ -121,10 +121,10 @@
}
\coordinate
(bridge) at ([yshift=1.4
\base
]enc16.north west);
\draw
[-latex']
(enc210.north) .. controls +(north:0.
4
\base
) and +(east:1.5
\base
) .. (bridge) .. controls +(west:8.0
\base
) and +(south west:0
.8
\base
) .. (dec21.west);
\draw
[-latex']
(enc210.north) .. controls +(north:0.
6
\base
) and +(east:2
\base
) .. (bridge) .. controls +(west:8.0
\base
) and +(south west:2
.8
\base
) .. (dec21.west);
\coordinate
(bridge) at ([yshift=1.6
\base
]enc16.north west);
\draw
[-latex']
(
enc110.east) .. controls +(east:0.5
\base
) and +(east:8
\base
) .. (bridge) .. controls +(west:7.5
\base
) and +(south west:0.1
\base
) .. (dec11.west);
\draw
[-latex']
(
[yshift=-0.5em]enc110.east) .. controls +(north:1.5
\base
) and +(east:8
\base
) .. (bridge) .. controls +(west:7.5
\base
) and +(south west:1.2
\base
) .. (dec11.west);
% stack RNN
\begin{pgfonlayer}
{
background
}
...
...
Chapter10/Figures/figure-encoder-decoder-with-attention.tex
查看文件 @
3b176929
...
...
@@ -11,7 +11,7 @@
%%% a simple encoder-decoder model
\begin{scope}
\foreach
\x
in
{
1,2,...,6
}
\node
[]
(s
\x
) at (
\x
*
1.6
em,0)
{}
;
\node
[]
(s
\x
) at (
\x
*
2
em,0)
{}
;
\node
[] (ws1) at (s1)
{
\scriptsize
{
这
}}
;
\node
[] (ws2) at (s2)
{
\scriptsize
{
是
}}
;
...
...
@@ -21,7 +21,7 @@
\node
[] (ws6) at (s6)
{
\scriptsize
{
句子
}}
;
\foreach
\x
in
{
1,2,...,6
}
\node
[]
(t
\x
) at (
\x
*
1.6em + 2.4
in,0)
{}
;
\node
[]
(t
\x
) at (
\x
*
2em + 2.8
in,0)
{}
;
\node
[] (wt1) at (t1)
{
\scriptsize
{
This
}}
;
\node
[] (wt2) at (t2)
{
\scriptsize
{
is
}}
;
...
...
@@ -30,9 +30,9 @@
\node
[] (wt5) at (t5)
{
\scriptsize
{
long
}}
;
\node
[] (wt6) at ([xshift=1em]t6)
{
\scriptsize
{
sentence
}}
;
\node
[anchor=south west,fill=red!30,minimum width=1.
6in,minimum height=1.5em] (encoder) at ([yshift=1.0
em]ws1.north west)
{
\footnotesize
{
Encoder
}}
;
\node
[anchor=west,fill=
blue!30,minimum width=1.9in,minimum height=1.5em] (decoder) at ([xshift=4.5em]encoder.east)
{
\footnotesize
{
Decoder
}}
;
\node
[anchor=west,fill=
green!30,minimum height=1.5em] (representation) at ([xshift=1em]encoder.east)
{
\footnotesize
{
表示
}}
;
\node
[anchor=south west,fill=red!30,minimum width=1.
9in,minimum height=1.5em] (encoder) at ([yshift=1.0em,xshift=-0.4
em]ws1.north west)
{
\footnotesize
{
Encoder
}}
;
\node
[anchor=west,fill=
green!30,minimum height=1.5em] (representation) at ([xshift=2em]encoder.east)
{
\footnotesize
{
表示
}}
;
\node
[anchor=west,fill=
blue!30,minimum width=1.9in,minimum height=1.5em] (decoder) at ([xshift=2em]representation.east)
{
\footnotesize
{
Decoder
}}
;
\draw
[->,thick] ([xshift=1pt]encoder.east)--([xshift=-1pt]representation.west);
\draw
[->,thick] ([xshift=1pt]representation.east)--([xshift=-1pt]decoder.west);
...
...
@@ -42,7 +42,7 @@
\foreach
\x
in
{
1,2,...,5
}
\draw
[<-]
([yshift=0.1em]t
\x
.north) -- ([yshift=1.2em]t
\x
.north);
\draw
[<-]
([yshift=0.1em,xshift=1em]t6.north) -- ([yshift=1.2em,xshift=1em]t6.north);
\draw
[<-
,thick
]
([yshift=0.1em,xshift=1em]t6.north) -- ([yshift=1.2em,xshift=1em]t6.north);
\node
[anchor=north] (cap) at ([xshift=2em,yshift=-2.5em]encoder.south east)
{
\small
{
(a) 简单的编码器-解码器框架
}}
;
\end{scope}
...
...
@@ -50,7 +50,7 @@
%%% a encoder-decoder model with attention
\begin{scope}
[yshift=-1.7in]
\foreach
\x
in
{
1,2,...,6
}
\node
[]
(s
\x
) at (
\x
*
1.6
em,0)
{}
;
\node
[]
(s
\x
) at (
\x
*
2
em,0)
{}
;
\node
[] (ws1) at (s1)
{
\scriptsize
{
这
}}
;
\node
[] (ws2) at (s2)
{
\scriptsize
{
是
}}
;
...
...
@@ -60,7 +60,7 @@
\node
[] (ws6) at (s6)
{
\scriptsize
{
句子
}}
;
\foreach
\x
in
{
1,2,...,6
}
\node
[]
(t
\x
) at (
\x
*
1.6em + 2.4
in,0)
{}
;
\node
[]
(t
\x
) at (
\x
*
2em + 2.8
in,0)
{}
;
\node
[] (wt1) at (t1)
{
\scriptsize
{
This
}}
;
\node
[] (wt2) at (t2)
{
\scriptsize
{
is
}}
;
...
...
@@ -69,8 +69,8 @@
\node
[] (wt5) at (t5)
{
\scriptsize
{
long
}}
;
\node
[] (wt6) at ([xshift=1em]t6)
{
\scriptsize
{
sentence
}}
;
\node
[anchor=south west,fill=red!30,minimum width=1.
6in,minimum height=1.5em] (encoder) at ([yshift=1.0
em]ws1.north west)
{
\footnotesize
{
Encoder
}}
;
\node
[anchor=west,fill=blue!30,minimum width=1.9in,minimum height=1.5em] (decoder) at ([xshift=
4.5
em]encoder.east)
{
\footnotesize
{
Decoder
}}
;
\node
[anchor=south west,fill=red!30,minimum width=1.
9in,minimum height=1.5em] (encoder) at ([yshift=1.0em,xshift=-0.4
em]ws1.north west)
{
\footnotesize
{
Encoder
}}
;
\node
[anchor=west,fill=blue!30,minimum width=1.9in,minimum height=1.5em] (decoder) at ([xshift=
6.4
em]encoder.east)
{
\footnotesize
{
Decoder
}}
;
\foreach
\x
in
{
1,2,...,6
}
\draw
[->]
([yshift=0.1em]s
\x
.north) -- ([yshift=1.2em]s
\x
.north);
...
...
@@ -78,11 +78,11 @@
\foreach
\x
in
{
1,2,...,5
}
\draw
[<-]
([yshift=0.1em]t
\x
.north) -- ([yshift=1.2em]t
\x
.north);
\draw
[<-]
([yshift=0.1em,xshift=1em]t6.north) -- ([yshift=1.2em,xshift=1em]t6.north);
\draw
[<-
,thick
]
([yshift=0.1em,xshift=1em]t6.north) -- ([yshift=1.2em,xshift=1em]t6.north);
\draw
[->] ([yshift=3em]s6.north) -- ([yshift=4em]s6.north) -- ([yshift=4em]t1.north) node [pos=0.5,fill=green!30,inner sep=2pt] (c1)
{
\scriptsize
{
表示
$
\mathbi
{
C
}_
1
$}}
-- ([yshift=3em]t1.north) ;
\draw
[->] ([yshift=3em]s5.north) -- ([yshift=5.3em]s5.north) -- ([yshift=5.3em]t2.north) node [pos=0.5,fill=green!30,inner sep=2pt] (c2)
{
\scriptsize
{
表示
$
\mathbi
{
C
}_
2
$}}
-- ([yshift=3em]t2.north) ;
\draw
[->] ([yshift=3.5em]s3.north) -- ([yshift=6.6em]s3.north) -- ([yshift=6.6em]t4.north) node [pos=0.5,fill=green!30,inner sep=2pt] (c3)
{
\scriptsize
{
表示
$
\mathbi
{
C
}_
i
$}}
-- ([yshift=3.5em]t4.north) ;
\draw
[->
,thick
] ([yshift=3em]s6.north) -- ([yshift=4em]s6.north) -- ([yshift=4em]t1.north) node [pos=0.5,fill=green!30,inner sep=2pt] (c1)
{
\scriptsize
{
表示
$
\mathbi
{
C
}_
1
$}}
-- ([yshift=3em]t1.north) ;
\draw
[->
,thick
] ([yshift=3em]s5.north) -- ([yshift=5.3em]s5.north) -- ([yshift=5.3em]t2.north) node [pos=0.5,fill=green!30,inner sep=2pt] (c2)
{
\scriptsize
{
表示
$
\mathbi
{
C
}_
2
$}}
-- ([yshift=3em]t2.north) ;
\draw
[->
,thick
] ([yshift=3.5em]s3.north) -- ([yshift=6.6em]s3.north) -- ([yshift=6.6em]t4.north) node [pos=0.5,fill=green!30,inner sep=2pt] (c3)
{
\scriptsize
{
表示
$
\mathbi
{
C
}_
i
$}}
-- ([yshift=3.5em]t4.north) ;
\node
[anchor=north] (smore) at ([yshift=3.5em]s3.north)
{
...
}
;
\node
[anchor=north] (tmore) at ([yshift=3.5em]t4.north)
{
...
}
;
...
...
Chapter10/Figures/figure-model-structure-based-on-recurrent-neural-network-translation.tex
查看文件 @
3b176929
...
...
@@ -11,7 +11,7 @@
% RNN Encoder
\coordinate
(eemb0) at (0,0);
\foreach
\x
[count=
\y
from 0] in
{
1,2,...,10
}
\node
[rnnnode,minimum height=0.5\base,fill=green!30!white,anchor=west]
(eemb
\x
) at ([xshift=0.
4
\base
]eemb
\y
.east)
{}
;
\node
[rnnnode,minimum height=0.5\base,fill=green!30!white,anchor=west]
(eemb
\x
) at ([xshift=0.
7
\base
]eemb
\y
.east)
{}
;
\foreach
\x
in
{
1,2,...,10
}
\node
[rnnnode,fill=blue!30!white,anchor=south]
(enc
\x
) at ([yshift=0.5
\base
]eemb
\x
.north)
{}
;
\node
[wordnode,left=0.4\base of enc1]
(init)
{$
0
$}
;
...
...
@@ -114,7 +114,7 @@
% legend
\begin{scope}
[shift=
{
(10
\base
,2.5
\base
)
}
]
\node
[rnnnode,minimum height=0.5\base,fill=green!30!white,label={[label distance=3pt,font=\scriptsize]
0:词嵌入层
}
] (emb) at (
0
,0)
{}
;
\node
[rnnnode,minimum height=0.5\base,fill=green!30!white,label={[label distance=3pt,font=\scriptsize]
0:词嵌入层
}
] (emb) at (
3
,0)
{}
;
\node
[rnnnode,fill=blue!30!white,anchor=north west,label={[label distance=3pt,font=\scriptsize]
0:循环单元
}
] (rnn) at ([yshift=2
\base
]emb.south west)
{}
;
\node
[rnnnode,minimum height=0.5\base,fill=red!30!white,anchor=north west,label={[label distance=3pt,font=\scriptsize]
0:输出层
}
] (softmax) at ([yshift=2
\base
]rnn.south west)
{}
;
\node
[anchor=north west] (softmax2) at ([xshift=0.6
\base
]softmax.south west)
{
\scriptsize
{
Softmax
}}
;
...
...
Chapter10/Figures/figure-numbers-of-wmt-systems.tex
查看文件 @
3b176929
...
...
@@ -5,7 +5,7 @@
\begin{tikzpicture}
\begin{scope}
[local bounding box=WMT]
\draw
[->,thick]
(0.4,0) to (
9
.5,0);
\draw
[->,thick]
(0.4,0) to (
11
.5,0);
\draw
[->,thick]
(0.4,-0) to (0.4,4.3);
\draw
[thick]
(0.4,2) to (0.6,2);
\draw
[thick]
(0.4,4) to (0.6,4);
...
...
@@ -13,38 +13,38 @@
\node
[font=\scriptsize]
at (0,4)
{
20
}
;
% 2015
\node
[minimum width=0.
5
cm,thick,minimum height=7*0.2cm,fill=blue!30!white,inner sep=0pt,outer sep=0pt,anchor=south west]
(smt2015) at (1.5*0.7,0.5pt)
{}
;
\node
[minimum width=0.
5
cm,thick,minimum height=2*0.2cm,fill=red!30!white,inner sep=0pt,outer sep=0pt,anchor=south west]
(nmt2015) at (smt2015.south east)
{}
;
\node
[minimum width=0.
7
cm,thick,minimum height=7*0.2cm,fill=blue!30!white,inner sep=0pt,outer sep=0pt,anchor=south west]
(smt2015) at (1.5*0.7,0.5pt)
{}
;
\node
[minimum width=0.
7
cm,thick,minimum height=2*0.2cm,fill=red!30!white,inner sep=0pt,outer sep=0pt,anchor=south west]
(nmt2015) at (smt2015.south east)
{}
;
\node
[font=\scriptsize,anchor=north]
() at ([yshift=-0.2em]smt2015.south east)
{
2015
}
;
% 2016
\node
[minimum width=0.
5
cm,thick,minimum height=3*0.2cm,fill=blue!30!white,inner sep=0pt,outer sep=0pt,anchor=south west]
(smt2016) at (
$
(
nmt
2015
.south east
)+(
0
.
7
,
0
)
$
)
{}
;
\node
[minimum width=0.
5
cm,thick,minimum height=8*0.2cm,fill=red!30!white,inner sep=0pt,outer sep=0pt,anchor=south west]
(nmt2016) at (smt2016.south east)
{}
;
\node
[minimum width=0.
7
cm,thick,minimum height=3*0.2cm,fill=blue!30!white,inner sep=0pt,outer sep=0pt,anchor=south west]
(smt2016) at (
$
(
nmt
2015
.south east
)+(
0
.
7
,
0
)
$
)
{}
;
\node
[minimum width=0.
7
cm,thick,minimum height=8*0.2cm,fill=red!30!white,inner sep=0pt,outer sep=0pt,anchor=south west]
(nmt2016) at (smt2016.south east)
{}
;
\node
[font=\scriptsize,anchor=north]
() at ([yshift=-0.2em]smt2016.south east)
{
2016
}
;
% 2017
\node
[minimum width=0.
5
cm,thick,minimum height=3*0.2cm,fill=blue!30!white,inner sep=0pt,outer sep=0pt,anchor=south west]
(smt2017) at (
$
(
nmt
2016
.south east
)+(
0
.
7
,
0
)
$
)
{}
;
\node
[minimum width=0.
5
cm,thick,minimum height=13*0.2cm,fill=red!30!white,inner sep=0pt,outer sep=0pt,anchor=south west]
(nmt2017) at (smt2017.south east)
{}
;
\node
[minimum width=0.
7
cm,thick,minimum height=3*0.2cm,fill=blue!30!white,inner sep=0pt,outer sep=0pt,anchor=south west]
(smt2017) at (
$
(
nmt
2016
.south east
)+(
0
.
7
,
0
)
$
)
{}
;
\node
[minimum width=0.
7
cm,thick,minimum height=13*0.2cm,fill=red!30!white,inner sep=0pt,outer sep=0pt,anchor=south west]
(nmt2017) at (smt2017.south east)
{}
;
\node
[font=\scriptsize,anchor=north]
() at ([yshift=-0.2em]smt2017.south east)
{
2017
}
;
% 2018
\node
[minimum width=0.
5
cm,thick,minimum height=0cm,draw,fill=blue!30!white,inner sep=0pt,outer sep=0pt,anchor=south west]
(smt2018) at (
$
(
nmt
2017
.south east
)+(
0
.
7
,
0
)
$
)
{}
;
\node
[minimum width=0.
5
cm,thick,minimum height=14*0.2cm,fill=red!30!white,inner sep=0pt,outer sep=0pt,anchor=south west]
(nmt2018) at (smt2018.south east)
{}
;
\node
[minimum width=0.
7
cm,thick,minimum height=0cm,draw,fill=blue!30!white,inner sep=0pt,outer sep=0pt,anchor=south west]
(smt2018) at (
$
(
nmt
2017
.south east
)+(
0
.
7
,
0
)
$
)
{}
;
\node
[minimum width=0.
7
cm,thick,minimum height=14*0.2cm,fill=red!30!white,inner sep=0pt,outer sep=0pt,anchor=south west]
(nmt2018) at (smt2018.south east)
{}
;
\node
[font=\scriptsize,anchor=north]
() at ([yshift=-0.2em]smt2018.south east)
{
2018
}
;
% 2019
\node
[minimum width=0.
5
cm,thick,minimum height=0cm,draw,fill=blue!30!white,inner sep=0pt,outer sep=0pt,anchor=south west]
(smt2019) at (
$
(
nmt
2018
.south east
)+(
0
.
7
,
0
)
$
)
{}
;
\node
[minimum width=0.
5
cm,thick,minimum height=21*0.2cm,fill=red!30!white,inner sep=0pt,outer sep=0pt,anchor=south west]
(nmt2019) at (smt2019.south east)
{}
;
\node
[minimum width=0.
7
cm,thick,minimum height=0cm,draw,fill=blue!30!white,inner sep=0pt,outer sep=0pt,anchor=south west]
(smt2019) at (
$
(
nmt
2018
.south east
)+(
0
.
7
,
0
)
$
)
{}
;
\node
[minimum width=0.
7
cm,thick,minimum height=21*0.2cm,fill=red!30!white,inner sep=0pt,outer sep=0pt,anchor=south west]
(nmt2019) at (smt2019.south east)
{}
;
\node
[font=\scriptsize,anchor=north]
() at ([yshift=-0.2em]smt2019.south east)
{
2019
}
;
\end{scope}
% legend
\ExtractX
{$
(
nmt
2015
.west
)
$}
\ExtractY
{$
(
WMT.north
)
$}
\node
[minimum width=0.
5
cm,rectangle,fill=blue!30!white,anchor=north west,label={[label distance=1pt,font=\scriptsize]
0:统计机器翻译
}
] () at (
\XCoord
,
\YCoord
)
{}
;
\node
[minimum width=0.
7
cm,rectangle,fill=blue!30!white,anchor=north west,label={[label distance=1pt,font=\scriptsize]
0:统计机器翻译
}
] () at (
\XCoord
,
\YCoord
)
{}
;
\ExtractX
{$
(
nmt
2017
.west
)
$}
\node
[minimum width=0.
5
cm,rectangle,fill=red!30!white,anchor=north west,label={[label distance=1pt,font=\scriptsize]
0:神经机器翻译
}
] () at (
\XCoord
,
\YCoord
)
{}
;
\node
[minimum width=0.
7
cm,rectangle,fill=red!30!white,anchor=north west,label={[label distance=1pt,font=\scriptsize]
0:神经机器翻译
}
] () at (
\XCoord
,
\YCoord
)
{}
;
% \node[font=\normalsize,rotate=90] () at ([xshift=-1em]WMT.west) {数量};
\node
[font=\normalsize]
() at (0.4,4.5)
{
数量
}
;
\node
[font=\normalsize]
() at (
9
.5,-0.3)
{
年份
}
;
\node
[font=\normalsize]
() at (
11
.5,-0.3)
{
年份
}
;
\end{tikzpicture}
\ No newline at end of file
Chapter10/Figures/figure-presentation-space.tex
查看文件 @
3b176929
...
...
@@ -19,13 +19,13 @@
\end{scope}
\begin{scope}
[xshift=1.
3
in]
\begin{scope}
[xshift=1.
8
in]
\node
[anchor=south west,draw,thick,red,minimum width=0.9in,minimum height=0.7in] (space1) at (0,0)
{}
;
\node
[anchor=south west,fill=blue,minimum width=0.1in,minimum height=0.1in] (unit1) at (0.2,0.8)
{}
;
\node
[anchor=south west,fill=ugreen,minimum width=0.1in,minimum height=0.1in] (unit2) at (0.7,0.3)
{}
;
\node
[anchor=south west,draw,thick,red,minimum width=0.9in,minimum height=0.7in] (space2) at (1.
1
in,0)
{}
;
\node
[anchor=south west,circle,fill=orange,minimum width=0.1in,minimum height=0.1in] (unit3) at (1.
5
in,1.3)
{}
;
\node
[anchor=south west,draw,thick,red,minimum width=0.9in,minimum height=0.7in] (space2) at (1.
3
in,0)
{}
;
\node
[anchor=south west,circle,fill=orange,minimum width=0.1in,minimum height=0.1in] (unit3) at (1.
7
in,1.3)
{}
;
\draw
[->] ([yshift=1pt]unit1.north) .. controls +(north:0.4) and +(west:2) .. ([yshift=0.0em,xshift=-1pt]unit3.west);
\draw
[->] ([xshift=1pt]unit2.east) .. controls +(east:1.5) and +(south:1) .. ([xshift=0.0em,yshift=-1pt]unit3.south);
...
...
Chapter10/Figures/figure-query-model-corresponding-to-attention-mechanism.tex
查看文件 @
3b176929
...
...
@@ -5,26 +5,26 @@
\tikzstyle
{
rnode
}
= [draw,minimum width=3.5em,minimum height=1.2em]
\node
[rnode,anchor=south west,fill=red!20!white] (value1) at (0,0)
{
\scriptsize
{${
h
}
(
\textrm
{
你
}
)
$}}
;
\node
[rnode,anchor=south west,fill=red!20!white] (value2) at ([xshift=
1
em]value1.south east)
{
\scriptsize
{${
h
}
(
\textrm
{
什么
}
)
$}}
;
\node
[rnode,anchor=south west,fill=red!20!white] (value3) at ([xshift=
1
em]value2.south east)
{
\scriptsize
{${
h
}
(
\textrm
{
也
}
)
$}}
;
\node
[rnode,anchor=south west,fill=red!20!white] (value4) at ([xshift=
1
em]value3.south east)
{
\scriptsize
{${
h
}
(
\textrm
{
没
}
)
$}}
;
\node
[rnode,anchor=south west,fill=red!20!white] (value2) at ([xshift=
2
em]value1.south east)
{
\scriptsize
{${
h
}
(
\textrm
{
什么
}
)
$}}
;
\node
[rnode,anchor=south west,fill=red!20!white] (value3) at ([xshift=
2
em]value2.south east)
{
\scriptsize
{${
h
}
(
\textrm
{
也
}
)
$}}
;
\node
[rnode,anchor=south west,fill=red!20!white] (value4) at ([xshift=
2
em]value3.south east)
{
\scriptsize
{${
h
}
(
\textrm
{
没
}
)
$}}
;
\node
[rnode,anchor=south west,fill=green!20!white] (key1) at ([yshift=0.2em]value1.north west)
{
\scriptsize
{${
h
}
(
\textrm
{
你
}
)
$}}
;
\node
[rnode,anchor=south west,fill=green!20!white] (key2) at ([yshift=0.2em]value2.north west)
{
\scriptsize
{${
h
}
(
\textrm
{
什么
}
)
$}}
;
\node
[rnode,anchor=south west,fill=green!20!white] (key3) at ([yshift=0.2em]value3.north west)
{
\scriptsize
{${
h
}
(
\textrm
{
也
}
)
$}}
;
\node
[rnode,anchor=south west,fill=green!20!white] (key4) at ([yshift=0.2em]value4.north west)
{
\scriptsize
{${
h
}
(
\textrm
{
没
}
)
$}}
;
\node
[rnode,anchor=east] (query) at ([xshift=-
2
em]key1.west)
{
\scriptsize
{${
s
}
(
\textrm
{
you
}
)
$}}
;
\node
[rnode,anchor=east] (query) at ([xshift=-
4
em]key1.west)
{
\scriptsize
{${
s
}
(
\textrm
{
you
}
)
$}}
;
\node
[anchor=east] (querylabel) at ([xshift=-0.2em]query.west)
{
\scriptsize
{
query
}}
;
\draw
[->] ([yshift=1pt,xshift=6pt]query.north) .. controls +(90:1em) and +(90:1em) .. ([yshift=1pt]key1.north);
\draw
[->] ([yshift=1pt,xshift=3pt]query.north) .. controls +(90:1.5em) and +(90:1.5em) .. ([yshift=1pt]key2.north);
\draw
[->] ([yshift=1pt]query.north) .. controls +(90:2em) and +(90:2em) .. ([yshift=1pt]key3.north);
\draw
[->] ([yshift=1pt,xshift=-3pt]query.north) .. controls +(90:2.5em) and +(90:2.5em) .. ([yshift=1pt]key4.north);
\node
[anchor=south east] (alpha1) at ([xshift=1
em]key1.north east)
{
\scriptsize
{$
\alpha
_
1
=
.
4
$}}
;
\node
[anchor=south east] (alpha2) at ([xshift=1
em]key2.north east)
{
\scriptsize
{$
\alpha
_
2
=
.
4
$}}
;
\node
[anchor=south east] (alpha3) at ([xshift=1
em]key3.north east)
{
\scriptsize
{$
\alpha
_
3
=
.
1
$}}
;
\node
[anchor=south east] (alpha4) at ([xshift=1
em]key4.north east)
{
\scriptsize
{$
\alpha
_
4
=
.
1
$}}
;
\node
[anchor=south east] (alpha1) at ([xshift=1
.5em]key1.north east)
{
\scriptsize
{$
\alpha
_
1
=
0
.
4
$}}
;
\node
[anchor=south east] (alpha2) at ([xshift=1
.5em]key2.north east)
{
\scriptsize
{$
\alpha
_
2
=
0
.
4
$}}
;
\node
[anchor=south east] (alpha3) at ([xshift=1
.5em]key3.north east)
{
\scriptsize
{$
\alpha
_
3
=
0
.
1
$}}
;
\node
[anchor=south east] (alpha4) at ([xshift=1
.5em]key4.north east)
{
\scriptsize
{$
\alpha
_
4
=
0
.
1
$}}
;
\end{scope}
\end{tikzpicture}
\ No newline at end of file
Chapter10/Figures/figure-query-model-corresponding-to-traditional-query-model-vs-attention-mechanism.tex
查看文件 @
3b176929
...
...
@@ -5,12 +5,12 @@
\begin{tikzpicture}
\begin{scope}
\tikzstyle
{
rnode
}
= [draw,minimum width=3em,minimum height=1.2em]
\tikzstyle
{
rnode
}
= [draw,minimum width=3
.5
em,minimum height=1.2em]
\node
[rnode,anchor=south west,fill=blue!20!white] (value1) at (0,0)
{
\scriptsize
{
value
$_
1
$}}
;
\node
[rnode,anchor=south west,fill=blue!20!white] (value2) at ([xshift=
1
em]value1.south east)
{
\scriptsize
{
value
$_
2
$}}
;
\node
[rnode,anchor=south west,fill=red!20!white] (value3) at ([xshift=
1
em]value2.south east)
{
\scriptsize
{
value
$_
3
$}}
;
\node
[rnode,anchor=south west,fill=blue!20!white] (value4) at ([xshift=
1
em]value3.south east)
{
\scriptsize
{
value
$_
4
$}}
;
\node
[rnode,anchor=south west,fill=blue!20!white] (value2) at ([xshift=
2
em]value1.south east)
{
\scriptsize
{
value
$_
2
$}}
;
\node
[rnode,anchor=south west,fill=red!20!white] (value3) at ([xshift=
2
em]value2.south east)
{
\scriptsize
{
value
$_
3
$}}
;
\node
[rnode,anchor=south west,fill=blue!20!white] (value4) at ([xshift=
2
em]value3.south east)
{
\scriptsize
{
value
$_
4
$}}
;
\node
[rnode,anchor=south west,pattern=north east lines] (key1) at ([yshift=0.2em]value1.north west)
{}
;
\node
[rnode,anchor=south west,pattern=dots] (key2) at ([yshift=0.2em]value2.north west)
{}
;
...
...
@@ -21,7 +21,7 @@
\node
[fill=white,inner sep=1pt] (key1label) at (key3)
{
\scriptsize
{
key
$_
3
$}}
;
\node
[fill=white,inner sep=1pt] (key1label) at (key4)
{
\scriptsize
{
key
$_
4
$}}
;
\node
[rnode,anchor=east,pattern=horizontal lines] (query) at ([xshift=-
3
em]key1.west)
{}
;
\node
[rnode,anchor=east,pattern=horizontal lines] (query) at ([xshift=-
4
em]key1.west)
{}
;
\node
[anchor=east] (querylabel) at ([xshift=-0.2em]query.west)
{
\scriptsize
{
query
}}
;
\draw
[->] ([yshift=1pt]query.north) .. controls +(90:2em) and +(90:2em) .. ([yshift=1pt]key3.north) node [pos=0.5,below,yshift=0.2em]
{
\scriptsize
{
匹配
}}
;
...
...
Chapter10/Figures/figure-relationship-between-learning-rate-and-number-of-updates.tex
查看文件 @
3b176929
...
...
@@ -4,7 +4,7 @@
\begin{tikzpicture}
\footnotesize
{
\begin{axis}
[
width=.
60
\textwidth
,
width=.
8
\textwidth
,
height=.40
\textwidth
,
legend style=
{
at=
{
(0.60,0.08)
}
, anchor=south west
}
,
xlabel=
{
\scriptsize
{
更新次数
}}
,
...
...
Chapter10/Figures/figure-score-of-mter.tex
查看文件 @
3b176929
...
...
@@ -2,7 +2,7 @@
%\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\begin{tikzpicture}
\begin{axis}
[
width=1
0
cm, height=5cm,
width=1
2
cm, height=5cm,
symbolic x coords=
{
1-15,16-25,26-35,>35
}
,
xtick=data,
ytick=
{
6,12,...,28
}
,
...
...
Chapter10/Figures/figure-structure-of-a-recurrent-network-model.tex
查看文件 @
3b176929
...
...
@@ -6,11 +6,11 @@
\begin{scope}
[scale=0.9]
{
\Large
\tikzstyle
{
rnnnode
}
= [draw,inner sep=5pt,minimum width=3em,minimum height=0.8em,fill=green!30!white,blur shadow=
{
shadow xshift=1pt,shadow yshift=-1pt
}
]
\tikzstyle
{
rnnnode
}
= [draw,inner sep=5pt,minimum width=3
.6
em,minimum height=0.8em,fill=green!30!white,blur shadow=
{
shadow xshift=1pt,shadow yshift=-1pt
}
]
\node
[anchor=west,rnnnode] (node11) at (0,0)
{
\scriptsize
{
RNN Cell
}}
;
\node
[anchor=west,rnnnode] (node12) at ([xshift=
1
em]node11.east)
{
\scriptsize
{
RNN Cell
}}
;
\node
[anchor=west,rnnnode] (node13) at ([xshift=
1
em]node12.east)
{
\scriptsize
{
RNN Cell
}}
;
\node
[anchor=west,rnnnode] (node14) at ([xshift=
1
em]node13.east)
{
\scriptsize
{
RNN Cell
}}
;
\node
[anchor=west,rnnnode] (node12) at ([xshift=
2
em]node11.east)
{
\scriptsize
{
RNN Cell
}}
;
\node
[anchor=west,rnnnode] (node13) at ([xshift=
2
em]node12.east)
{
\scriptsize
{
RNN Cell
}}
;
\node
[anchor=west,rnnnode] (node14) at ([xshift=
2
em]node13.east)
{
\scriptsize
{
RNN Cell
}}
;
\node
[anchor=north,rnnnode,fill=blue!30!white] (e1) at ([yshift=-1em]node11.south)
{
\scriptsize
{}}
;
\node
[anchor=north,rnnnode,fill=blue!30!white] (e2) at ([yshift=-1em]node12.south)
{
\scriptsize
{}}
;
...
...
Chapter10/Figures/figure-structure-of-gnmt.tex
查看文件 @
3b176929
...
...
@@ -12,9 +12,9 @@
% Encoder
\begin{scope}
\node
[rnnnode,fill=green!20]
(encemb1) at (0,0)
{}
;
\node
[rnnnode,fill=green!20,right=\base of encemb1]
(encemb2)
{}
;
\node
[rnnnode,draw=white,fill=white,right=\base of encemb2]
(encemb3)
{$
\cdots
$}
;
\node
[rnnnode,fill=green!20,right=\base of encemb3]
(encemb4)
{}
;
\node
[rnnnode,fill=green!20,right=
1.8
\base of encemb1]
(encemb2)
{}
;
\node
[rnnnode,draw=white,fill=white,right=
1.8
\base of encemb2]
(encemb3)
{$
\cdots
$}
;
\node
[rnnnode,fill=green!20,right=
1.8
\base of encemb3]
(encemb4)
{}
;
\node
[rnnnode,above=\base of encemb1]
(enc11)
{}
;
\node
[rnnnode,above=\base of encemb2]
(enc12)
{}
;
...
...
@@ -103,10 +103,10 @@
\node
[rnnnode,fill=orange!20,minimum width=3.5cm,anchor=south west]
(attention) at ([yshift=
\base
]enc61.north west)
{
注意力机制
}
;
\begin{scope}
\node
[rnnnode,fill=green!20,right=
2.5
cm of encemb4]
(decemb1)
{}
;
\node
[rnnnode,fill=green!20,right=\base of decemb1]
(decemb2)
{}
;
\node
[rnnnode,draw=white,fill=white,right=\base of decemb2]
(decemb3)
{$
\cdots
$}
;
\node
[rnnnode,fill=green!20,right=\base of decemb3]
(decemb4)
{}
;
\node
[rnnnode,fill=green!20,right=
3
cm of encemb4]
(decemb1)
{}
;
\node
[rnnnode,fill=green!20,right=
1.8
\base of decemb1]
(decemb2)
{}
;
\node
[rnnnode,draw=white,fill=white,right=
1.8
\base of decemb2]
(decemb3)
{$
\cdots
$}
;
\node
[rnnnode,fill=green!20,right=
1.8
\base of decemb3]
(decemb4)
{}
;
\node
[rnnnode,above=\base of decemb1]
(dec11)
{}
;
\node
[rnnnode,above=\base of decemb2]
(dec12)
{}
;
...
...
@@ -189,7 +189,7 @@
\end{scope}
% attention connections
\draw
[-latex',rounded corners=2pt]
(dec11) -| ([xshift=-0.
4
cm]attention.south east);
\draw
[-latex',rounded corners=2pt]
(dec11) -| ([xshift=-0.
2
cm]attention.south east);
\ExtractX
{$
([
xshift
=
9
pt
]
attention.east
)
$}
\ExtractY
{$
([
yshift
=
2
pt
]
dec
11
.north
)
$}
...
...
@@ -224,11 +224,11 @@
\draw
[decorate,decoration={brace,mirror}]
([xshift=5pt]dec14.south east) to node [auto,swap,font=
\scriptsize
,name=label2]
{
8层
}
([xshift=5pt]dec54.north east);
\begin{pgfonlayer}
{
background
}
\coordinate
(tmp) at ([xshift=-4pt]label1.west);
\node
[draw,densely dashed,rounded corners=2pt,inner sep=2pt,fit=(label1) (encword1) (attention) (tmp)]
(encoder)
{}
;
\node
[
thick,
draw,densely dashed,rounded corners=2pt,inner sep=2pt,fit=(label1) (encword1) (attention) (tmp)]
(encoder)
{}
;
\ExtractX
{$
([
xshift
=
4
pt
]
label
2
.east
)
$}
\ExtractY
{$
([
yshift
=
6
pt
]
decoutword
4
.north
)
$}
\coordinate
(tmp) at (
\XCoord
,
\YCoord
);
\node
[draw,densely dashed,rounded corners=2pt,inner sep=2pt,fit=(label2) (decinword1) (decoutword4) (tmp)]
(decoder)
{}
;
\node
[
thick,
draw,densely dashed,rounded corners=2pt,inner sep=2pt,fit=(label2) (decinword1) (decoutword4) (tmp)]
(decoder)
{}
;
\end{pgfonlayer}
\node
[wnode,anchor=north west]
() at (encoder.north west)
{
编码器
}
;
\node
[wnode,anchor=north east]
() at (decoder.north east)
{
解码器
}
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论