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
286aaa92
Commit
286aaa92
authored
Mar 11, 2020
by
曹润柘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update to the latest
parent
acacfe9f
全部展开
显示空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
49 行增加
和
48 行删除
+49
-48
Book/Chapter6/Chapter6.tex
+16
-17
Book/Chapter6/Figures/figure-Automatic-generation-of-ancient-poems-based-on-encoder-decoder-framework.tex
+0
-0
Book/Chapter6/Figures/figure-Automatically-generate-instances-of-couplets.tex
+2
-2
Book/Chapter6/Figures/figure-Comparison-of-the-number-of-padding-in-batch.tex
+2
-0
Book/Chapter6/Figures/figure-Example-of-automatic-translation-of-classical-Chinese.tex
+4
-4
Book/Chapter6/Figures/figure-GRU01.tex
+1
-1
Book/Chapter6/Figures/figure-GRU02.tex
+1
-1
Book/Chapter6/Figures/figure-GRU03.tex
+1
-1
Book/Chapter6/Figures/figure-LSTM01.tex
+1
-1
Book/Chapter6/Figures/figure-LSTM02.tex
+1
-1
Book/Chapter6/Figures/figure-LSTM03.tex
+1
-1
Book/Chapter6/Figures/figure-LSTM04.tex
+1
-1
Book/Chapter6/Figures/figure-convergence&lr.tex
+4
-4
Book/Chapter6/Figures/figure-lrate-of-transformer.tex
+2
-2
Book/Chapter6/Figures/figure-self-att-vs-enco-deco-att.tex
+5
-5
Book/Chapter6/Figures/figure-softmax.tex
+2
-2
Book/Chapter6/Figures/figure-the-whole-of-LSTM.tex
+5
-5
Book/mt-book.bbl
+0
-0
没有找到文件。
Book/Chapter6/Chapter6.tex
查看文件 @
286aaa92
差异被折叠。
点击展开。
Book/Chapter6/Figures/figure-Automatic-generation-of-ancient-poems-based-on-encoder-decoder-framework.tex
查看文件 @
286aaa92
Book/Chapter6/Figures/figure-Automatically-generate-instances-of-couplets.tex
查看文件 @
286aaa92
...
...
@@ -2,8 +2,8 @@
\begin{tikzpicture}
\begin{scope}
\tikzstyle
{
lnode
}
= [minimum height=2.5em,minimum width=12em,inner sep=3pt,
very thick,
rounded corners=2pt,draw=red!75!black,fill=red!5];
\tikzstyle
{
rnode
}
= [minimum height=2.5em,minimum width=12em,inner sep=3pt,
very thick,
rounded corners=2pt,draw=blue!75!black,fill=blue!5];
\tikzstyle
{
lnode
}
= [minimum height=2.5em,minimum width=12em,inner sep=3pt,rounded corners=2pt,draw=red!75!black,fill=red!5];
\tikzstyle
{
rnode
}
= [minimum height=2.5em,minimum width=12em,inner sep=3pt,rounded corners=2pt,draw=blue!75!black,fill=blue!5];
\tikzstyle
{
standard
}
= [rounded corners=3pt]
\node
[lnode,anchor=west] (l1) at (0,0)
{
上联:翠竹千支歌盛世
}
;
...
...
Book/Chapter6/Figures/figure-Comparison-of-the-number-of-padding-in-batch.tex
查看文件 @
286aaa92
...
...
@@ -25,4 +25,5 @@
\node
[rectangle,inner sep=0.5em,rounded corners=2pt,very thick,dotted,draw=ugreen!80] [fit = (s1) (s3) (p1) (p3)] (box0)
{}
;
\node
[rectangle,inner sep=0.5em,rounded corners=2pt,very thick,dotted,draw=ugreen!80] [fit = (s4) (s6) (p4) (p5)] (box0)
{}
;
\end{tikzpicture}
\ No newline at end of file
Book/Chapter6/Figures/figure-Example-of-automatic-translation-of-classical-Chinese.tex
查看文件 @
286aaa92
...
...
@@ -3,13 +3,13 @@
\begin{frame}
{}
\begin{tcolorbox}
[size=normal,left=2mm,right=1mm,colback=red!5!white,colframe=red!75!black]
\begin{tcolorbox}
[size=normal,left=2mm,right=1mm,colback=red!5!white,colframe=red!75!black
,boxrule=1pt
]
{
\small
{
古文:侍卫步军都指挥使、彰信节度使李继勋营于寿州城南,唐刘仁赡伺继勋无备,出兵击之,杀士卒数百人,焚其攻具。
}
}
\end{tcolorbox}
\vspace
{
-0.4em
}
\begin{tcolorbox}
[size=normal,left=2mm,right=1mm,colback=blue!5!white,colframe=blue!75!black]
\begin{tcolorbox}
[size=normal,left=2mm,right=1mm,colback=blue!5!white,colframe=blue!75!black
,boxrule=1pt
]
{
\small
{
现代文:侍卫步军都指挥使、彰信节度使李继勋在寿州城南扎营,唐刘仁赡窥伺李继勋没有防备,出兵攻打他,杀死士兵几百人,烧毁李继勋的攻城器
}
}
...
...
@@ -17,13 +17,13 @@
\vspace
{
0.2em
}
\begin{tcolorbox}
[size=normal,left=2mm,right=1mm,colback=red!5!white,colframe=red!75!black]
\begin{tcolorbox}
[size=normal,left=2mm,right=1mm,colback=red!5!white,colframe=red!75!black
,boxrule=1pt
]
{
\small
{
古文:其后人稍稍识之,多延至其家,使为弟子论学。
}
}
\end{tcolorbox}
\vspace
{
-0.4em
}
\begin{tcolorbox}
[size=normal,left=2mm,right=1mm,colback=blue!5!white,colframe=blue!75!black]
\begin{tcolorbox}
[size=normal,left=2mm,right=1mm,colback=blue!5!white,colframe=blue!75!black
,boxrule=1pt
]
{
\small
{
现代文:后来的人渐渐认识他,多把他请到家里,让他为弟子讲授学问。
}
}
...
...
Book/Chapter6/Figures/figure-GRU01.tex
查看文件 @
286aaa92
...
...
@@ -86,7 +86,7 @@
\node
[]
(tanh) at (aux46)
{}
;
\begin{pgfonlayer}
{
background
}
\node
[draw,very thick,rectangle,fill=blue!
3
0!white,rounded corners=5pt,inner sep=6pt,fit=(aux22) (aux76) (z76) (tanh)]
(GRU)
{}
;
\node
[draw,very thick,rectangle,fill=blue!
1
0!white,rounded corners=5pt,inner sep=6pt,fit=(aux22) (aux76) (z76) (tanh)]
(GRU)
{}
;
\end{pgfonlayer}
...
...
Book/Chapter6/Figures/figure-GRU02.tex
查看文件 @
286aaa92
...
...
@@ -99,7 +99,7 @@
\node
[]
(tanh) at (aux46)
{}
;
\begin{pgfonlayer}
{
background
}
\node
[draw,very thick,rectangle,fill=blue!
3
0!white,rounded corners=5pt,inner sep=6pt,fit=(aux22) (aux76) (z76) (tanh)]
(GRU)
{}
;
\node
[draw,very thick,rectangle,fill=blue!
1
0!white,rounded corners=5pt,inner sep=6pt,fit=(aux22) (aux76) (z76) (tanh)]
(GRU)
{}
;
\end{pgfonlayer}
...
...
Book/Chapter6/Figures/figure-GRU03.tex
查看文件 @
286aaa92
...
...
@@ -118,7 +118,7 @@
\end{scope}
\begin{pgfonlayer}
{
background
}
\node
[draw,very thick,rectangle,fill=blue!
3
0!white,rounded corners=5pt,inner sep=6pt,fit=(aux22) (aux76) (z76) (tanh)]
(GRU)
{}
;
\node
[draw,very thick,rectangle,fill=blue!
1
0!white,rounded corners=5pt,inner sep=6pt,fit=(aux22) (aux76) (z76) (tanh)]
(GRU)
{}
;
\end{pgfonlayer}
...
...
Book/Chapter6/Figures/figure-LSTM01.tex
查看文件 @
286aaa92
...
...
@@ -93,7 +93,7 @@
\node
[ ]
(o27) at (aux27)
{
}
;
\begin{pgfonlayer}
{
background
}
\node
[draw,very thick,rectangle,fill=blue!
3
0!white,rounded corners=5pt,inner sep=4pt,fit=(aux22) (aux58) (u55) (o27)]
(LSTM)
{}
;
\node
[draw,very thick,rectangle,fill=blue!
1
0!white,rounded corners=5pt,inner sep=4pt,fit=(aux22) (aux58) (u55) (o27)]
(LSTM)
{}
;
\end{pgfonlayer}
...
...
Book/Chapter6/Figures/figure-LSTM02.tex
查看文件 @
286aaa92
...
...
@@ -108,7 +108,7 @@
\node
[ ]
(o27) at (aux27)
{
}
;
\begin{pgfonlayer}
{
background
}
\node
[draw,very thick,rectangle,fill=blue!
3
0!white,rounded corners=5pt,inner sep=4pt,fit=(aux22) (aux58) (u55) (o27)]
(LSTM)
{}
;
\node
[draw,very thick,rectangle,fill=blue!
1
0!white,rounded corners=5pt,inner sep=4pt,fit=(aux22) (aux58) (u55) (o27)]
(LSTM)
{}
;
\end{pgfonlayer}
...
...
Book/Chapter6/Figures/figure-LSTM03.tex
查看文件 @
286aaa92
...
...
@@ -125,7 +125,7 @@
\node
[ ]
(o27) at (aux27)
{
}
;
\begin{pgfonlayer}
{
background
}
\node
[draw,very thick,rectangle,fill=blue!
3
0!white,rounded corners=5pt,inner sep=4pt,fit=(aux22) (aux58) (u55) (o27)]
(LSTM)
{}
;
\node
[draw,very thick,rectangle,fill=blue!
1
0!white,rounded corners=5pt,inner sep=4pt,fit=(aux22) (aux58) (u55) (o27)]
(LSTM)
{}
;
\end{pgfonlayer}
...
...
Book/Chapter6/Figures/figure-LSTM04.tex
查看文件 @
286aaa92
...
...
@@ -144,7 +144,7 @@
\end{scope}
\begin{pgfonlayer}
{
background
}
\node
[draw,very thick,rectangle,fill=blue!
3
0!white,rounded corners=5pt,inner sep=4pt,fit=(aux22) (aux58) (u55) (o27)]
(LSTM)
{}
;
\node
[draw,very thick,rectangle,fill=blue!
1
0!white,rounded corners=5pt,inner sep=4pt,fit=(aux22) (aux58) (u55) (o27)]
(LSTM)
{}
;
\end{pgfonlayer}
...
...
Book/Chapter6/Figures/figure-convergence&lr.tex
查看文件 @
286aaa92
...
...
@@ -7,8 +7,8 @@
ytick=
{
0,1,...,4
}
,
xticklabel style=
{
opacity=0
}
,
yticklabel style=
{
opacity=0
}
,
xlabel=
{
\textbf
{$
\textrm
{
W
}_
t
$}
}
,
ylabel=
{
\textbf
{
L(
$
\textrm
{
W
}_
t
$
)
}
}
,
xlabel=
{
$
w
$
}
,
ylabel=
{
$
L
(
w
)
$
}
,
axis line style=
{
->
}
,
xlabel style=
{
xshift=2.2cm,yshift=1.2cm
}
,
ylabel style=
{
rotate=-90,xshift=1.5cm,yshift=1.6cm
}
,
...
...
@@ -34,8 +34,8 @@
ytick=
{
0,1,...,4
}
,
xticklabel style=
{
opacity=0
}
,
yticklabel style=
{
opacity=0
}
,
xlabel=
{
\textbf
{$
\textrm
{
W
}_
t
$}
}
,
ylabel=
{
\textbf
{
L(
$
\textrm
{
W
}_
t
$
)
}
}
,
xlabel=
{
$
w
$
}
,
ylabel=
{
$
L
(
w
)
$
}
,
axis line style=
{
->
}
,
xlabel style=
{
xshift=2.2cm,yshift=1.2cm
}
,
ylabel style=
{
rotate=-90,xshift=1.5cm,yshift=1.6cm
}
,
...
...
Book/Chapter6/Figures/figure-lrate-of-transformer.tex
查看文件 @
286aaa92
...
...
@@ -7,8 +7,8 @@
width=.60
\textwidth
,
height=.40
\textwidth
,
legend style=
{
at=
{
(0.60,0.08)
}
, anchor=south west
}
,
xlabel=
{
\footnotesize
{
num update
(10k)
}}
,
ylabel=
{
\footnotesize
{
Learn rate
(
\scriptsize
{$
10
^{
-
3
}$
)
}}}
,
xlabel=
{
\footnotesize
{
更新步数
(10k)
}}
,
ylabel=
{
\footnotesize
{
学习率
(
\scriptsize
{$
10
^{
-
3
}$
)
}}}
,
ylabel style=
{
yshift=-1em
}
,xlabel style=
{
yshift=0.0em
}
,
yticklabel style=
{
/pgf/number format/precision=2,/pgf/number format/fixed zerofill
}
,
ymin=0,ymax=0.9, ytick=
{
0.2, 0.4, 0.6, 0.8
}
,
...
...
Book/Chapter6/Figures/figure-self-att-vs-enco-deco-att.tex
查看文件 @
286aaa92
...
...
@@ -13,11 +13,11 @@
\node
[anchor=north,rounded corners=1pt,minimum width=11.0em,minimum height=3.5em,draw=ugreen!70,very thick,dotted]
(p1-1) at ([yshift=-5.2em]p1.south)
{
\small
{
解码端每个位置的表示
}}
;
\draw
[->,thick,dashed] (word3.south) .. controls +(south:1
em) and +(north:1em) .. (
p1-1.north);
\draw
[->,thick,dashed] (word3.south) .. controls +(south:1
.5em) and +(north:1.5em) .. ([xshift=-0.4em]
p1-1.north);
\draw
[->,thick,dashed](word1.south) --(p1-1.north);
\draw
[->,thick,dashed] (word2.south) .. controls +(south:1
em) and +(north:1em) .. (
p1-1.north);
\draw
[->,thick,dashed] (word2.south) .. controls +(south:1
.0em) and +(north:1.5em) .. ([xshift=0.4em]
p1-1.north);
\node
[anchor=north]
(caption1) at ([xshift=0.0em,yshift=-9.5em]p1.south)
{
\small
{
(a)Self-Attention的输入
}}
;
\node
[anchor=north]
(caption1) at ([xshift=0.0em,yshift=-9.5em]p1.south)
{
\small
{
(a)
Self-Attention的输入
}}
;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\node
[anchor=west,rounded corners=1pt,minimum width=14.0em,minimum height=2.0em,fill=pink!30,draw=black]
(p2) at ([xshift=5.0em]p1.east)
{
\small
{
Encoder-Decoder Attention
}}
;
...
...
@@ -48,10 +48,10 @@
\draw
[<-,thick,dashed]
([xshift=-3.6em,yshift=-3.2em]word1-2.north)--([xshift=-3.6em,yshift=-3.2em]p2.south);
\draw
[<-,thick,dashed]
([xshift=3.6em,yshift=-3.2em]word1-2.north)--([xshift=3.6em,yshift=-3.2em]p2.south);
\draw
[->,thick,dashed] (word1-2.south) .. controls +(south:1em) and +(north:1
em) .. ([yshift=0.3
em]p2-3.north);
\draw
[->,thick,dashed] (word1-2.south) .. controls +(south:1em) and +(north:1
.5em) .. ([yshift=0.3em,xshift=-0.4
em]p2-3.north);
\node
[anchor=north]
(caption2) at ([xshift=0.0em,yshift=-9.5em]p2.south)
{
\small
{
(b)Encoder-Decoder Attention的输入
}}
;
\node
[anchor=north]
(caption2) at ([xshift=0.0em,yshift=-9.5em]p2.south)
{
\small
{
(b)
Encoder-Decoder Attention的输入
}}
;
...
...
Book/Chapter6/Figures/figure-softmax.tex
查看文件 @
286aaa92
...
...
@@ -4,8 +4,8 @@
width=8cm, height=5cm,
xtick=
{
-6,-4,...,6
}
,
ytick=
{
0,0.5,1
}
,
xlabel=
{
\small
{
\textbf
{
x
}
}}
,
ylabel=
{
\small
{
\textbf
{
Softmax(x)
}
}}
,
xlabel=
{
\small
{
$
x
$
}}
,
ylabel=
{
\small
{
Softmax(
$
x
$
)
}}
,
xlabel style=
{
xshift=3.0cm,yshift=1cm
}
,
axis y line=middle,
ylabel style=
{
xshift=-2.4cm,yshift=-0.2cm
}
,
...
...
Book/Chapter6/Figures/figure-the-whole-of-LSTM.tex
查看文件 @
286aaa92
...
...
@@ -154,25 +154,25 @@
\end{scope}
\begin{pgfonlayer}
{
background
}
\node
[draw,very thick,rectangle,fill=blue!
3
0!white,rounded corners=5pt,inner sep=4pt,fit=(aux22) (aux58) (u55) (o27)]
(LSTM)
{}
;
\node
[draw,very thick,rectangle,fill=blue!
1
0!white,rounded corners=5pt,inner sep=4pt,fit=(aux22) (aux58) (u55) (o27)]
(LSTM)
{}
;
\end{pgfonlayer}
\begin{scope}
{
% forget gate formula
\node
[formulanode,anchor=south east,text width=
3.4c
m]
() at ([shift=
{
(4
\base
,1.5
\base
)
}
]aux51)
{
遗忘门
\\
$
\mathbf
{
f
}_
t
=
\sigma
(
\mathbf
{
W
}_
f
[
\mathbf
{
h
}_{
t
-
1
}
,
\mathbf
{
x
}_
t
]+
\mathbf
{
b
}_
f
)
$}
;
\node
[formulanode,anchor=south east,text width=
10e
m]
() at ([shift=
{
(4
\base
,1.5
\base
)
}
]aux51)
{
遗忘门
\\
$
\mathbf
{
f
}_
t
=
\sigma
(
\mathbf
{
W
}_
f
[
\mathbf
{
h
}_{
t
-
1
}
,
\mathbf
{
x
}_
t
]+
\mathbf
{
b
}_
f
)
$}
;
}
{
% input gate formula
\node
[formulanode,anchor=north east]
() at ([shift=
{
(4
\base
,-1.5
\base
)
}
]aux21)
{
输入门
\\
$
\mathbf
{
i
}_
t
=
\sigma
(
\mathbf
{
W
}_
i
[
\mathbf
{
h
}_{
t
-
1
}
,
\mathbf
{
x
}_
t
]+
\mathbf
{
b
}_
i
)
$
\\
$
\hat
{
\mathbf
{
c
}}_
t
=
\mathrm
{
tanh
}
(
\mathbf
{
W
}_
c
[
\mathbf
{
h
}_{
t
-
1
}
,
\mathbf
{
x
}_
t
]+
\mathbf
{
b
}_
c
)
$}
;
\node
[formulanode,anchor=north east
,text width=10em
]
() at ([shift=
{
(4
\base
,-1.5
\base
)
}
]aux21)
{
输入门
\\
$
\mathbf
{
i
}_
t
=
\sigma
(
\mathbf
{
W
}_
i
[
\mathbf
{
h
}_{
t
-
1
}
,
\mathbf
{
x
}_
t
]+
\mathbf
{
b
}_
i
)
$
\\
$
\hat
{
\mathbf
{
c
}}_
t
=
\mathrm
{
tanh
}
(
\mathbf
{
W
}_
c
[
\mathbf
{
h
}_{
t
-
1
}
,
\mathbf
{
x
}_
t
]+
\mathbf
{
b
}_
c
)
$}
;
}
{
% cell update formula
\node
[formulanode,anchor=south west,text width=
3.02c
m]
() at ([shift=
{
(-4
\base
,1.5
\base
)
}
]aux59)
{
记忆更新
\\
$
\mathbf
{
c
}_{
t
}
=
\mathbf
{
f
}_
t
\cdot
\mathbf
{
c
}_{
t
-
1
}
+
\mathbf
{
i
}_
t
\cdot
\hat
{
\mathbf
{
c
}}_
t
$}
;
\node
[formulanode,anchor=south west,text width=
10e
m]
() at ([shift=
{
(-4
\base
,1.5
\base
)
}
]aux59)
{
记忆更新
\\
$
\mathbf
{
c
}_{
t
}
=
\mathbf
{
f
}_
t
\cdot
\mathbf
{
c
}_{
t
-
1
}
+
\mathbf
{
i
}_
t
\cdot
\hat
{
\mathbf
{
c
}}_
t
$}
;
}
{
% output gate formula
\node
[formulanode,anchor=north west]
() at ([shift=
{
(-4
\base
,-1.5
\base
)
}
]aux29)
{
输出门
\\
$
\mathbf
{
o
}_
t
=
\sigma
(
\mathbf
{
W
}_
o
[
\mathbf
{
h
}_{
t
-
1
}
,
\mathbf
{
x
}_
t
]+
\mathbf
{
b
}_
o
)
$
\\
$
\mathbf
{
h
}_{
t
}
=
\mathbf
{
o
}_
t
\cdot
\mathrm
{
tanh
}
(
\mathbf
{
c
}_{
t
}
)
$}
;
\node
[formulanode,anchor=north west
,text width=10em
]
() at ([shift=
{
(-4
\base
,-1.5
\base
)
}
]aux29)
{
输出门
\\
$
\mathbf
{
o
}_
t
=
\sigma
(
\mathbf
{
W
}_
o
[
\mathbf
{
h
}_{
t
-
1
}
,
\mathbf
{
x
}_
t
]+
\mathbf
{
b
}_
o
)
$
\\
$
\mathbf
{
h
}_{
t
}
=
\mathbf
{
o
}_
t
\cdot
\mathrm
{
tanh
}
(
\mathbf
{
c
}_{
t
}
)
$}
;
}
\end{scope}
\end{tikzpicture}
...
...
Book/mt-book.bbl
0 → 100644
查看文件 @
286aaa92
This source diff could not be displayed because it is too large. You can
view the blob
instead.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论