Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
Toy-MT-Introduction
概览
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
Toy-MT-Introduction
Commits
7bffd86e
Commit
7bffd86e
authored
Nov 17, 2019
by
xiaotong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoding figure
parent
3c78fe60
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
161 行增加
和
1 行删除
+161
-1
Section06-Neural-Machine-Translation/section06-test.tex
+161
-1
没有找到文件。
Section06-Neural-Machine-Translation/section06-test.tex
查看文件 @
7bffd86e
...
@@ -155,9 +155,169 @@
...
@@ -155,9 +155,169 @@
\hat
{
\textbf
{
y
}}
=
\argmax
_{
\textbf
{
y
}}
\log\textrm
{
P
}
(
\textbf
{
y
}
|
\textbf
{
x
}
) =
\argmax
_{
\textbf
{
y
}}
\sum
_{
j=1
}^{
n
}
\log\textrm
{
P
}
(y
_
j|
\textbf
{
y
}_{
<j
}
,
\textbf
{
x
}
)
\hat
{
\textbf
{
y
}}
=
\argmax
_{
\textbf
{
y
}}
\log\textrm
{
P
}
(
\textbf
{
y
}
|
\textbf
{
x
}
) =
\argmax
_{
\textbf
{
y
}}
\sum
_{
j=1
}^{
n
}
\log\textrm
{
P
}
(y
_
j|
\textbf
{
y
}_{
<j
}
,
\textbf
{
x
}
)
\end{displaymath}
\end{displaymath}
\item
由于生成
$
y
_
i
$
需要依赖
$
y
_{
i
-
1
}$
因此,无法同时生成
${
y
_
1
,...,y
_
n
}$
。常用的方法是
\item
<2-> 由于
$
y
_
i
$
的生成需要依赖
$
y
_{
i
-
1
}$
,因此无法同时生成
$
\{
y
_
1
,...,y
_
n
\}
$
。常用的方法是自左向右逐个单词生成
\end{itemize}
\end{itemize}
\visible
<3->
{
\vspace
{
-0.5em
}
\begin{center}
\begin{tikzpicture}
\begin{scope}
\tikzstyle
{
rnnnode
}
= [minimum height=1.1em,minimum width=2.1em,inner sep=2pt,rounded corners=1pt,draw,fill=red!20];
\node
[rnnnode,anchor=west] (h1) at (0,0)
{
\tiny
{$
\textbf
{
h
}_
1
$}}
;
\node
[anchor=west] (h2) at ([xshift=1em]h1.east)
{
\tiny
{
...
}}
;
\node
[rnnnode,anchor=west] (h3) at ([xshift=1em]h2.east)
{
\tiny
{$
\textbf
{
h
}_
m
$}}
;
\node
[rnnnode,anchor=north,fill=green!20] (e1) at ([yshift=-1em]h1.south)
{
\tiny
{$
e
_
x
()
$}}
;
\node
[anchor=west] (e2) at ([xshift=1em]e1.east)
{
\tiny
{
...
}}
;
\node
[rnnnode,anchor=west,fill=green!20] (e3) at ([xshift=1em]e2.east)
{
\tiny
{$
e
_
x
()
$}}
;
\node
[anchor=north,inner sep=2pt] (w1) at ([yshift=-0.6em]e1.south)
{
\tiny
{
你
}}
;
\node
[anchor=north,inner sep=2pt] (w2) at ([yshift=-0.8em]e2.south)
{
\tiny
{
...
}}
;
\node
[anchor=north,inner sep=2pt] (w3) at ([yshift=-0.6em]e3.south)
{
\tiny
{
EOS
}}
;
\draw
[->] (w1.north) -- ([yshift=-0.1em]e1.south);
\draw
[->] (w3.north) -- ([yshift=-0.1em]e3.south);
\draw
[->] ([yshift=0.1em]e1.north) -- ([yshift=-0.1em]h1.south);
\draw
[->] ([yshift=0.1em]e3.north) -- ([yshift=-0.1em]h3.south);
\draw
[->] ([xshift=0.1em]h1.east) -- ([xshift=-0.1em]h2.west);
\draw
[->] ([xshift=0.1em]h2.east) -- ([xshift=-0.1em]h3.west);
\draw
[->] ([xshift=-0.8em]h1.west) -- ([xshift=-0.1em]h1.west) node [pos=0,left,inner sep=2pt]
{
\tiny
{
0
}}
;
\node
[anchor=south] (encoder) at ([xshift=-0.2em]h1.north west)
{
\scriptsize
{
\textbf
{
编码器
}}}
;
\visible
<5->
{
\node
[rnnnode,anchor=west,fill=green!20] (t1) at ([xshift=3em]h3.east)
{
\tiny
{$
e
_
y
()
$}}
;
}
\visible
<8->
{
\node
[rnnnode,anchor=west,fill=green!20] (t2) at ([xshift=1.5em]t1.east)
{
\tiny
{$
e
_
y
()
$}}
;
}
\visible
<9->
{
\node
[rnnnode,anchor=west,fill=green!20] (t3) at ([xshift=1.5em]t2.east)
{
\tiny
{$
e
_
y
()
$}}
;
\node
[rnnnode,anchor=west,fill=green!20] (t4) at ([xshift=1.5em]t3.east)
{
\tiny
{$
e
_
y
()
$}}
;
\node
[anchor=west,inner sep=2pt] (t5) at ([xshift=0.3em]t4.east)
{
\tiny
{
...
}}
;
}
\visible
<5->
{
\node
[rnnnode,anchor=south] (s1) at ([yshift=1em]t1.north)
{
\tiny
{$
\textbf
{
s
}_
1
$}}
;
}
\visible
<8->
{
\node
[rnnnode,anchor=south] (s2) at ([yshift=1em]t2.north)
{
\tiny
{$
\textbf
{
s
}_
2
$}}
;
}
\visible
<9->
{
\node
[rnnnode,anchor=south] (s3) at ([yshift=1em]t3.north)
{
\tiny
{$
\textbf
{
s
}_
3
$}}
;
\node
[rnnnode,anchor=south] (s4) at ([yshift=1em]t4.north)
{
\tiny
{$
\textbf
{
s
}_
4
$}}
;
\node
[anchor=west,inner sep=2pt] (s5) at ([xshift=0.3em]s4.east)
{
\tiny
{
...
}}
;
}
\visible
<5->
{
\node
[rnnnode,anchor=south,fill=blue!20] (o1) at ([yshift=1em]s1.north)
{
\tiny
{
softmax
}}
;
\node
[anchor=east] (decoder) at ([xshift=-0.5em]o1.north west)
{
\scriptsize
{
\textbf
{
解码器
}}}
;
}
\visible
<8->
{
\node
[rnnnode,anchor=south,fill=blue!20] (o2) at ([yshift=1em]s2.north)
{
\tiny
{
softmax
}}
;
}
\visible
<9->
{
\node
[rnnnode,anchor=south,fill=blue!20] (o3) at ([yshift=1em]s3.north)
{
\tiny
{
softmax
}}
;
\node
[rnnnode,anchor=south,fill=blue!20] (o4) at ([yshift=1em]s4.north)
{
\tiny
{
softmax
}}
;
\node
[anchor=west,inner sep=2pt] (o5) at ([xshift=0.3em]o4.east)
{
\tiny
{
...
}}
;
}
\visible
<4->
{
\node
[anchor=north,inner sep=2pt] (wt1) at ([yshift=-0.6em]t1.south)
{
\tiny
{
EOS
}}
;
}
\visible
<7->
{
\node
[anchor=north,inner sep=2pt] (wt2) at ([yshift=-0.6em]t2.south)
{
\tiny
{
Have
}}
;
}
\visible
<9->
{
\node
[anchor=north,inner sep=2pt] (wt3) at ([yshift=-0.8em]t3.south)
{
\tiny
{
you
}}
;
\node
[anchor=north,inner sep=2pt] (wt4) at ([yshift=-0.6em]t4.south)
{
\tiny
{
learned
}}
;
}
\visible
<5->
{
\node
[anchor=center,inner sep=2pt] (wo1) at ([yshift=1.2em]o1.north)
{
\tiny
{
Have
}}
;
\node
[anchor=south,inner sep=2pt] (wos1) at (wo1.north)
{
\tiny
{
\textbf
{
[step 1]
}}}
;
}
\visible
<8->
{
\node
[anchor=center,inner sep=2pt] (wo2) at ([yshift=1.2em]o2.north)
{
\tiny
{
you
}}
;
\node
[anchor=south,inner sep=2pt] (wos2) at (wo2.north)
{
\tiny
{
\textbf
{
[step 2]
}}}
;
}
\visible
<9->
{
\node
[anchor=center,inner sep=2pt] (wo3) at ([yshift=1.2em]o3.north)
{
\tiny
{
learned
}}
;
\node
[anchor=south,inner sep=2pt] (wos3) at (wo3.north)
{
\tiny
{
\textbf
{
[step 3]
}}}
;
\node
[anchor=center,inner sep=2pt] (wo4) at ([yshift=1.2em]o4.north)
{
\tiny
{
nothing
}}
;
\node
[anchor=south,inner sep=2pt] (wos4) at (wo4.north)
{
\tiny
{
\textbf
{
[step 4]
}}}
;
}
\visible
<5->
{
\foreach
\x
in
{
1
}{
\draw
[->] ([yshift=-0.7em]t
\x
.south) -- ([yshift=-0.1em]t
\x
.south);
\draw
[->] ([yshift=0.1em]t
\x
.north) -- ([yshift=-0.1em]s
\x
.south);
\draw
[->] ([yshift=0.1em]s
\x
.north) -- ([yshift=-0.1em]o
\x
.south);
\draw
[->] ([yshift=0.1em]o
\x
.north) -- ([yshift=0.8em]o
\x
.north) node [pos=0.5,right]
{
\tiny
{
top1
}}
;
}
}
\visible
<8->
{
\foreach
\x
in
{
2
}{
\draw
[->] ([yshift=-0.7em]t
\x
.south) -- ([yshift=-0.1em]t
\x
.south);
\draw
[->] ([yshift=0.1em]t
\x
.north) -- ([yshift=-0.1em]s
\x
.south);
\draw
[->] ([yshift=0.1em]s
\x
.north) -- ([yshift=-0.1em]o
\x
.south);
\draw
[->] ([yshift=0.1em]o
\x
.north) -- ([yshift=0.8em]o
\x
.north) node [pos=0.5,right]
{
\tiny
{
top1
}}
;
}
}
\visible
<9->
{
\foreach
\x
in
{
3,4
}{
\draw
[->] ([yshift=-0.7em]t
\x
.south) -- ([yshift=-0.1em]t
\x
.south);
\draw
[->] ([yshift=0.1em]t
\x
.north) -- ([yshift=-0.1em]s
\x
.south);
\draw
[->] ([yshift=0.1em]s
\x
.north) -- ([yshift=-0.1em]o
\x
.south);
\draw
[->] ([yshift=0.1em]o
\x
.north) -- ([yshift=0.8em]o
\x
.north) node [pos=0.5,right]
{
\tiny
{
top1
}}
;
}
}
\visible
<5->
{
\draw
[->] ([xshift=-0.8em]s1.west) -- ([xshift=-0.1em]s1.west) node [pos=0,left]
{
\tiny
{
0
}}
;
}
\visible
<8->
{
\draw
[->] ([xshift=0.1em]s1.east) -- ([xshift=-0.1em]s2.west);
}
\visible
<9->
{
\draw
[->] ([xshift=0.1em]s2.east) -- ([xshift=-0.1em]s3.west);
\draw
[->] ([xshift=0.1em]s3.east) -- ([xshift=-0.1em]s4.west);
}
\visible
<7->
{
\draw
[->,thick,dotted] (wo1.east) .. controls +(east:1.1) and +(west:1.0) ..(wt2.west);
}
\visible
<9->
{
\draw
[->,thick,dotted] (wo2.east) .. controls +(east:1.3) and +(west:1.1) ..(wt3.west);
\draw
[->,thick,dotted] (wo3.east) .. controls +(east:0.9) and +(west:0.9) ..(wt4.west);
}
\visible
<6->
{
\node
[circle,draw,anchor=south,inner sep=3pt,fill=orange!20] (c2) at ([yshift=2em]h2.north)
{
\tiny
{$
\textbf
{
C
}_
2
$}}
;
\node
[anchor=south] (c2more) at ([yshift=-1.5em]c2.south)
{
\tiny
{
...
}}
;
\draw
[->] (h1.north) .. controls +(north:0.6) and +(250:0.9) .. (c2.250);
\draw
[->] (h3.north) .. controls +(north:0.6) and +(290:0.9) .. (c2.290);
\draw
[->] ([yshift=-0.3em]s1.west) .. controls +(west:2) and +(-50:0.3) .. (c2.-40);
}
\visible
<8->
{
\draw
[->] (c2.0) -- ([xshift=1.358in]c2.0) -- ([yshift=0.3em,xshift=-1.2em]s2.west) -- ([yshift=0.3em,xshift=-0.1em]s2.west);
}
\visible
<9->
{
\node
[circle,draw,anchor=north,inner sep=3pt,fill=orange!20] (c3) at ([yshift=-2em]t2.south)
{
\tiny
{$
\textbf
{
C
}_
3
$}}
;
\draw
[->] ([xshift=-0.7em]c3.west) -- ([xshift=-0.1em]c3.west);
\draw
[->] ([xshift=0.1em]c3.east) .. controls +(east:0.6) and +(west:0.8) ..([yshift=-0.3em,xshift=-0.1em]s3.west);
}
\visible
<9->
{
\node
[circle,draw,anchor=north,inner sep=3pt,fill=orange!20] (c4) at ([yshift=-2em]t3.south)
{
\tiny
{$
\textbf
{
C
}_
4
$}}
;
\draw
[->] ([xshift=-0.7em]c4.west) -- ([xshift=-0.1em]c4.west);
\draw
[->] ([xshift=0.1em]c4.east) .. controls +(east:0.6) and +(west:0.8) ..([yshift=-0.3em,xshift=-0.1em]s4.west);
}
\end{scope}
\end{tikzpicture}
\end{center}
}
\end{frame}
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
%%%------------------------------------------------------------------------------------------------------------
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论