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
单韦乔
Toy-MT-Introduction
Commits
d2ce90b7
Commit
d2ce90b7
authored
Nov 22, 2019
by
Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add GRU figure
parent
52ecf09c
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
145 行增加
和
0 行删除
+145
-0
Section06-Neural-Machine-Translation/section06.tex
+145
-0
没有找到文件。
Section06-Neural-Machine-Translation/section06.tex
查看文件 @
d2ce90b7
...
...
@@ -1337,6 +1337,151 @@ NLP问题的隐含结构假设 & 无隐含结构假设,端到端学习 \\
\item
GRU
\end{itemize}
%%% 图
\begin{center}
\begin{tikzpicture}
\setlength
{
\base
}{
0.6cm
}
\tikzstyle
{
auxnode
}
= [inner sep=0pt,outer sep=0pt,opacity=0,draw=red,fill=red,circle,minimum size=3pt]
\tikzstyle
{
wordnode
}
= [font=
\scriptsize
]
\tikzstyle
{
opnode
}
= [inner sep=0pt,outer sep=0pt,draw,fill=green!30!white,font=
\scriptsize
,minimum size=10pt]
\tikzstyle
{
standard
}
= [rounded corners=5pt,thick]
\tikzstyle
{
emph
}
= [rounded corners=5pt,thick,draw=red]
\tikzstyle
{
formulanode
}
= [font=
\scriptsize
,align=left,draw=red,rectangle,fill=red!10!white,rounded corners=2pt,drop shadow]
% Skeleton
\begin{scope}
[every label/.append style=
{
label distance=1pt,font=
\tiny
,inner sep=0pt,opacity=0
}
]
\coordinate
(aux12) at (0,0);
\node
[auxnode,label={-45:12}]
() at (aux12)
{}
;
\coordinate
(aux22) at ([yshift=
\base
]aux12);
\node
[auxnode,label={-45:22}]
() at (aux22)
{}
;
\coordinate
(aux23) at ([xshift=0.5
\base
]aux22);
\node
[auxnode,label={-45:23}]
() at (aux23)
{}
;
\coordinate
(aux32) at ([yshift=0.4
\base
]aux22);
\node
[auxnode,label={-45:32}]
() at (aux32)
{}
;
\ExtractX
{$
([
xshift
=
\base
]
aux
23
)
$}
\ExtractY
{$
([
yshift
=
\base
]
aux
32
)
$}
\coordinate
(aux44) at (
\XCoord
,
\YCoord
);
\node
[auxnode,label={-45:44}]
() at (aux44)
{}
;
\coordinate
(aux45) at ([xshift=
\base
]aux44);
\node
[auxnode,label={-45:45}]
() at (aux45)
{}
;
\coordinate
(aux46) at ([xshift=1.3
\base
]aux45);
\node
[auxnode,label={-45:46}]
() at (aux46)
{}
;
\ExtractX
{$
(
aux
23
)
$}
\ExtractY
{$
([
yshift
=
\base
]
aux
44
)
$}
\coordinate
(aux53) at (
\XCoord
,
\YCoord
);
\node
[auxnode,label={-45:53}]
() at (aux53)
{}
;
\coordinate
(aux56) at ([yshift=
\base
]aux46);
\node
[auxnode,label={-45:56}]
() at (aux56)
{}
;
\ExtractX
{$
(
aux
45
)
$}
\ExtractY
{$
([
yshift
=
0
.
5
\base
]
aux
56
)
$}
\coordinate
(aux65) at (
\XCoord
,
\YCoord
);
\node
[auxnode,label={-45:65}]
() at (aux65)
{}
;
\ExtractX
{$
([
xshift
=-
\base
]
aux
12
)
$}
\ExtractY
{$
([
yshift
=
\base
]
aux
65
)
$}
\coordinate
(aux71) at (
\XCoord
,
\YCoord
);
\node
[auxnode,label={-45:71}]
() at (aux71)
{}
;
\coordinate
(aux75) at ([yshift=
\base
]aux65);
\node
[auxnode,label={-45:75}]
() at (aux75)
{}
;
\ExtractX
{$
(
aux
56
)
$}
\ExtractY
{$
(
aux
75
)
$}
\coordinate
(aux76) at (
\XCoord
,
\YCoord
);
\node
[auxnode,label={-45:76}]
() at (aux76)
{}
;
\coordinate
(aux78) at ([xshift=1.7
\base
]aux76);
\node
[auxnode,label={-45:78}]
() at (aux78)
{}
;
\coordinate
(aux87) at ([shift=
{
(0.7
\base
,1.3
\base
)
}
]aux76);
\node
[auxnode,label={-45:87}]
() at (aux87)
{}
;
\end{scope}
\begin{scope}
\node
[opnode,circle,opacity=0]
(r53) at (aux53)
{}
;
\node
[opnode,circle,opacity=0]
(z56) at (aux56)
{}
;
\node
[opnode,circle,opacity=0]
(z75) at (aux75)
{}
;
\node
[opnode,circle,opacity=0]
(z76) at (aux76)
{}
;
% reset gate
\visible
<1>
{
\draw
[-latex,emph]
(aux12) -- (aux32) -| (aux44) |- (r53);
\draw
[emph]
(aux71) -| (aux32) -| (aux44);
\node
[opnode,circle,draw=red,thick]
() at (aux44)
{$
\sigma
$}
;
}
\visible
<2->
{
\draw
[-latex,standard]
(aux12) -- (aux32) -| (aux44) |- (r53);
\draw
[standard]
(aux71) -| (aux32) -| (aux44);
\node
[opnode,circle]
() at (aux44)
{$
\sigma
$}
;
}
% update gate
\visible
<2>
{
\draw
[-latex,emph]
(aux12) -- (aux32) -| (aux45) -- (z75);
\draw
[-latex,emph]
(aux71) -| (aux32) -| (aux45) |- (z56);
\node
[opnode,circle,draw=red,thick]
() at (aux45)
{$
\sigma
$}
;
\node
[opnode,rectangle,rounded corners=2pt,inner sep=2pt,font=\tiny,draw=red,thick]
() at (aux65)
{$
1
-
$}
;
}
\visible
<3->
{
\draw
[-latex,standard]
(aux12) -- (aux32) -| (aux45) -- (z75);
\draw
[-latex,standard]
(aux71) -| (aux32) -| (aux45) |- (z56);
\node
[opnode,circle]
() at (aux45)
{$
\sigma
$}
;
\node
[opnode,rectangle,rounded corners=2pt,inner sep=2pt,font=\tiny]
() at (aux65)
{$
1
-
$}
;
}
% hidden update
\visible
<3>
{
\draw
[-latex,emph]
(aux71) -- (aux78);
\draw
[-latex,emph]
(aux71) -| (aux87);
\draw
[-latex,emph]
(aux71) -| (aux53) -- (aux23) -| (aux46) -- (z76);
\draw
[emph]
(aux12) |- (aux23) -| (aux46);
\node
[opnode,rectangle,rounded corners=2pt,inner sep=2pt,draw=red,thick]
(tanh) at (aux46)
{$
\mathrm
{
tanh
}$}
;
\node
[opnode,circle,draw=red,thick]
() at (aux53)
{
X
}
;
\node
[opnode,circle,draw=red,thick]
() at (aux56)
{
X
}
;
\node
[opnode,circle,draw=red,thick]
() at (aux75)
{
X
}
;
\node
[opnode,circle,draw=red,thick]
() at (aux76)
{
\textbf
{
+
}}
;
}
\visible
<4->
{
\draw
[-latex,standard]
(aux71) -- (aux78);
\draw
[-latex,standard]
(aux71) -| (aux87);
\draw
[-latex,standard]
(aux71) -| (aux53) -- (aux23) -| (aux46) -- (z76);
\draw
[standard]
(aux12) |- (aux23) -| (aux46);
\node
[opnode,rectangle,rounded corners=2pt,inner sep=2pt]
(tanh) at (aux46)
{$
\mathrm
{
tanh
}$}
;
\node
[opnode,circle]
() at (aux53)
{
X
}
;
\node
[opnode,circle]
() at (aux56)
{
X
}
;
\node
[opnode,circle]
() at (aux75)
{
X
}
;
\node
[opnode,circle]
() at (aux76)
{
\textbf
{
+
}}
;
}
\end{scope}
\begin{scope}
\node
[wordnode,anchor=south]
() at (aux71)
{$
h
_
t
$}
;
\node
[wordnode,anchor=west]
() at (aux12)
{$
x
_
t
$}
;
\visible
<3->
{
\node
[wordnode,anchor=east]
() at (aux87)
{$
h
_{
t
+
1
}$}
;
\node
[wordnode,anchor=south]
() at (aux78)
{$
h
_{
t
+
1
}$}
;
}
\end{scope}
\begin{pgfonlayer}
{
background
}
\node
[draw,very thick,rectangle,fill=blue!30!white,rounded corners=5pt,inner sep=6pt,fit=(aux22) (aux76) (z76) (tanh)]
(GRU)
{}
;
\end{pgfonlayer}
\begin{scope}
\visible
<1->
{
% reset gate formula
\node
[formulanode,anchor=west,text width=4cm]
(reset) at ([shift=
{
(
\base
,0.7
\base
)
}
]aux78)
{
重置门
\\
$
r
_
t
=
\sigma
(
W
_
r
[
h
_
t,x
_
t
])
$}
;
}
\visible
<2->
{
% update gate formula
\node
[formulanode,anchor=north west,text width=4cm]
(update) at ([yshift=-0.5
\base
]reset.south west)
{
更新门
\\
$
u
_
t
=
\sigma
(
W
_
u
[
h
_
t,x
_
t
])
$}
;
}
\visible
<3->
{
% hidden update formula
\node
[formulanode,anchor=north west,text width=4cm]
() at ([yshift=-0.5
\base
]update.south west)
{
隐藏状态更新
\\
$
\hat
{
h
}_
t
=
\mathrm
{
tanh
}
(
W
[
r
_
t
\cdot
h
_
t,x
_
t
])
$
\\
$
h
_{
t
+
1
}
=(
1
-
u
_
t
)
\cdot
h
_
t
+
u
_
t
\cdot
\hat
{
h
}_
t
$}
;
}
\end{scope}
\end{tikzpicture}
\end{center}
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论