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
23840ce4
Commit
23840ce4
authored
May 16, 2020
by
zengxin
Browse files
Options
Browse Files
Download
Plain Diff
合并分支 'zengxin' 到 'caorunzhe'
Zengxin 查看合并请求
!202
parents
a6e534a0
12146671
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
25 行增加
和
23 行删除
+25
-23
Book/Chapter6/Figures/figure-beam-search-process.tex
+13
-13
Book/Chapter6/Figures/figure-data-parallel-process.tex
+4
-2
Book/Chapter6/Figures/figure-multi-head-attention-model.tex
+8
-8
没有找到文件。
Book/Chapter6/Figures/figure-beam-search-process.tex
查看文件 @
23840ce4
...
@@ -43,32 +43,32 @@
...
@@ -43,32 +43,32 @@
\node
[wnode,anchor=north] (wt1) at ([yshift=-0.8em]t1.south)
{
\scriptsize
{$
\langle
$
sos
$
\rangle
$}}
;
\node
[wnode,anchor=north] (wt1) at ([yshift=-0.8em]t1.south)
{
\scriptsize
{$
\langle
$
sos
$
\rangle
$}}
;
{
{
\node
[wnode,anchor=north] (wt2) at ([yshift=-0.8em]t2.south)
{
\scriptsize
{
Have
}}
;
\node
[wnode,anchor=north] (wt2) at ([yshift=-0.8em]t2.south)
{
\scriptsize
{}}
;
\node
[wnode,anchor=north] (wt2copy1) at ([xshift=-0.2em,yshift=-0.2em]wt2.north)
{
\scriptsize
{
Have
}}
;
\node
[wnode,anchor=north] (wt2copy1) at ([xshift=-0.2em,yshift=-0.2em]wt2.north)
{
\scriptsize
{}}
;
\node
[wnode,anchor=north] (wt2copy2) at ([xshift=-0.4em,yshift=-0.4em]wt2.north)
{
\scriptsize
{
Have
}}
;
\node
[wnode,anchor=north] (wt2copy2) at ([xshift=-0.4em,yshift=-0.4em]wt2.north)
{
\scriptsize
{
Have
}}
;
}
}
{
{
\node
[wnode,anchor=north,inner sep=2pt] (wt3) at ([yshift=-0.8em]t3.south)
{
\scriptsize
{
you
}}
;
\node
[wnode,anchor=north,inner sep=2pt] (wt3) at ([yshift=-0.8em]t3.south)
{
\scriptsize
{}}
;
\node
[wnode,anchor=north] (wt3copy1) at ([xshift=-0.2em,yshift=-0.2em]wt3.north)
{
\scriptsize
{
you
}}
;
\node
[wnode,anchor=north] (wt3copy1) at ([xshift=-0.2em,yshift=-0.2em]wt3.north)
{
\scriptsize
{}}
;
\node
[wnode,anchor=north] (wt3copy2) at ([xshift=-0.4em,yshift=-0.4em]wt3.north)
{
\scriptsize
{
you
}}
;
\node
[wnode,anchor=north] (wt3copy2) at ([xshift=-0.4em,yshift=-0.4em]wt3.north)
{
\scriptsize
{
you
}}
;
}
}
{
{
\node
[wnode,anchor=center,inner sep=2pt] (wo1) at ([xshift=0.4em,yshift=1.8em]o1.north)
{
\scriptsize
{
Have
}}
;
\node
[wnode,anchor=center,inner sep=2pt] (wo1) at ([xshift=0.4em,yshift=1.8em]o1.north)
{
\scriptsize
{}}
;
\node
[wnode,anchor=north] (wo1copy1) at ([xshift=-0.2em,yshift=-0.2em]wo1.north)
{
\scriptsize
{
Have
}}
;
\node
[wnode,anchor=north] (wo1copy1) at ([xshift=-0.2em,yshift=-0.2em]wo1.north)
{
\scriptsize
{}}
;
\node
[wnode,anchor=north] (wo1copy2) at ([xshift=-0.4em,yshift=-0.4em]wo1.north)
{
\scriptsize
{
Have
}}
;
\node
[wnode,anchor=north] (wo1copy2) at ([xshift=-0.4em,yshift=-0.4em]wo1.north)
{
\scriptsize
{
Have
}}
;
}
}
{
{
\node
[wnode,anchor=center,inner sep=2pt] (wo2) at ([xshift=0.4em,yshift=1.8em]o2.north)
{
\scriptsize
{
you
}}
;
\node
[wnode,anchor=center,inner sep=2pt] (wo2) at ([xshift=0.4em,yshift=1.8em]o2.north)
{
\scriptsize
{}}
;
\node
[wnode,anchor=north] (wo2copy1) at ([xshift=-0.2em,yshift=-0.2em]wo2.north)
{
\scriptsize
{
you
}}
;
\node
[wnode,anchor=north] (wo2copy1) at ([xshift=-0.2em,yshift=-0.2em]wo2.north)
{
\scriptsize
{}}
;
\node
[wnode,anchor=north] (wo2copy2) at ([xshift=-0.4em,yshift=-0.4em]wo2.north)
{
\scriptsize
{
you
}}
;
\node
[wnode,anchor=north] (wo2copy2) at ([xshift=-0.4em,yshift=-0.4em]wo2.north)
{
\scriptsize
{
you
}}
;
}
}
{
{
\node
[wnode,anchor=center,inner sep=2pt] (wo3) at ([xshift=0.4em,yshift=1.8em]o3.north)
{
\scriptsize
{
learned
}}
;
\node
[wnode,anchor=center,inner sep=2pt] (wo3) at ([xshift=0.4em,yshift=1.8em]o3.north)
{
\scriptsize
{}}
;
\node
[wnode,anchor=north] (wo3copy1) at ([xshift=-0.2em,yshift=-0.2em]wo3.north)
{
\scriptsize
{
learned
}}
;
\node
[wnode,anchor=north] (wo3copy1) at ([xshift=-0.2em,yshift=-0.2em]wo3.north)
{
\scriptsize
{}}
;
\node
[wnode,anchor=north] (wo3copy2) at ([xshift=-0.4em,yshift=-0.4em]wo3.north)
{
\scriptsize
{
learned
}}
;
\node
[wnode,anchor=north] (wo3copy2) at ([xshift=-0.4em,yshift=-0.4em]wo3.north)
{
\scriptsize
{
learned
}}
;
}
}
...
@@ -121,7 +121,7 @@
...
@@ -121,7 +121,7 @@
}
}
{
{
\node
[circle,draw,anchor=north,inner sep=2pt,fill=orange!20] (c2) at ([yshift=-2.5em]t1.south)
{
\scriptsize
{$
\textbf
{
C
}_
2
$}}
;
\node
[circle,draw,anchor=north,inner sep=2pt,fill=orange!20
,text=orange!20
] (c2) at ([yshift=-2.5em]t1.south)
{
\scriptsize
{$
\textbf
{
C
}_
2
$}}
;
\node
[circle,draw,inner sep=2pt,fill=orange!20] (c2copy1) at ([yshift=-0.1em,xshift=-0.1em]c2)
{
\scriptsize
{$
\textbf
{
C
}_
2
$}}
;
\node
[circle,draw,inner sep=2pt,fill=orange!20] (c2copy1) at ([yshift=-0.1em,xshift=-0.1em]c2)
{
\scriptsize
{$
\textbf
{
C
}_
2
$}}
;
\node
[circle,draw,inner sep=2pt,fill=orange!20] (c2copy2) at ([yshift=-0.2em,xshift=-0.2em]c2)
{
\scriptsize
{$
\textbf
{
C
}_
2
$}}
;
\node
[circle,draw,inner sep=2pt,fill=orange!20] (c2copy2) at ([yshift=-0.2em,xshift=-0.2em]c2)
{
\scriptsize
{$
\textbf
{
C
}_
2
$}}
;
\draw
[->] ([xshift=-0.9em]c2.west) -- ([xshift=-0.3em]c2.west);
\draw
[->] ([xshift=-0.9em]c2.west) -- ([xshift=-0.3em]c2.west);
...
@@ -129,8 +129,8 @@
...
@@ -129,8 +129,8 @@
}
}
{
{
\node
[circle,draw,anchor=north,inner sep=2pt,fill=orange!20] (c3) at ([yshift=-2.5em]t2.south)
{
\scriptsize
{$
\textbf
{
C
}_
3
$}}
;
\node
[circle,draw,anchor=north,inner sep=2pt,fill=orange!20
,text=orange!20
] (c3) at ([yshift=-2.5em]t2.south)
{
\scriptsize
{$
\textbf
{
C
}_
3
$}}
;
\node
[circle,draw,inner sep=2pt,fill=orange!20] (c3copy1) at ([yshift=-0.1em,xshift=-0.1em]c3)
{
\scriptsize
{$
\textbf
{
C
}_
3
$}}
;
\node
[circle,draw,inner sep=2pt,fill=orange!20
,text=orange!20
] (c3copy1) at ([yshift=-0.1em,xshift=-0.1em]c3)
{
\scriptsize
{$
\textbf
{
C
}_
3
$}}
;
\node
[circle,draw,inner sep=2pt,fill=orange!20] (c3copy2) at ([yshift=-0.2em,xshift=-0.2em]c3)
{
\scriptsize
{$
\textbf
{
C
}_
3
$}}
;
\node
[circle,draw,inner sep=2pt,fill=orange!20] (c3copy2) at ([yshift=-0.2em,xshift=-0.2em]c3)
{
\scriptsize
{$
\textbf
{
C
}_
3
$}}
;
\draw
[->] ([xshift=-0.9em]c3.west) -- ([xshift=-0.3em]c3.west);
\draw
[->] ([xshift=-0.9em]c3.west) -- ([xshift=-0.3em]c3.west);
\draw
[->] ([xshift=0.1em]c3.east) .. controls +(east:1.5) and +(west:0.8) ..([yshift=-0.3em,xshift=-0.1em]s3.west);
\draw
[->] ([xshift=0.1em]c3.east) .. controls +(east:1.5) and +(west:0.8) ..([yshift=-0.3em,xshift=-0.1em]s3.west);
...
...
Book/Chapter6/Figures/figure-data-parallel-process.tex
查看文件 @
23840ce4
...
@@ -11,8 +11,10 @@
...
@@ -11,8 +11,10 @@
\begin{scope}
\begin{scope}
\coordinate
(batch0) at (0,0);
\coordinate
(batch0) at (0,0);
\foreach
\i
[count=
\j
from 0,evaluate=
\i
as
\k
using int(4-
\i
)] in
{
1,2,3
}
\foreach
\i
[count=
\j
from 0,evaluate=
\i
as
\k
using int(4-
\i
)] in
{
1,2
}
\node
[samplenode,anchor=south west,font=
\scriptsize
] (batch
\i
) at ([shift=
{
(-1em,-0.5em)
}
]batch
\j
.south west)
{
句子
\k
}
;
\node
[samplenode,anchor=south west,font=
\scriptsize
] (batch
\i
) at ([shift=
{
(-1em,-0.5em)
}
]batch
\j
.south west)
{
\qquad
\k
}
;
\foreach
\i
[count=
\j
from 2,evaluate=
\i
as
\k
using int(4-
\i
)] in
{
3
}
\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);
\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=4em]batch2.east)
{
句子2
}
;
\node
[samplenode,anchor=west,font=
\scriptsize
] (sample2) at ([xshift=4em]batch2.east)
{
句子2
}
;
...
...
Book/Chapter6/Figures/figure-multi-head-attention-model.tex
查看文件 @
23840ce4
...
@@ -3,23 +3,23 @@
...
@@ -3,23 +3,23 @@
\begin{tikzpicture}
\begin{tikzpicture}
\begin{scope}
\begin{scope}
\node
[anchor=west,draw=black!30,inner sep=4pt,fill=ugreen!20!white] (Linear0) at (0,0)
{
\footnotesize
{
Linear
}}
;
\node
[anchor=west,draw=black!30,inner sep=4pt,fill=ugreen!20!white
,text=ugreen!20!white
] (Linear0) at (0,0)
{
\footnotesize
{
Linear
}}
;
\node
[anchor=south west,draw=black!50,fill=ugreen!20!white,draw,inner sep=4pt] (Linear01) at ([shift=
{
(-0.2em,-0.2em)
}
]Linear0.south west)
{
\footnotesize
{
Linear
}}
;
\node
[anchor=south west,draw=black!50,fill=ugreen!20!white,draw,inner sep=4pt
,text=ugreen!20!white
] (Linear01) at ([shift=
{
(-0.2em,-0.2em)
}
]Linear0.south west)
{
\footnotesize
{
Linear
}}
;
\node
[anchor=south west,fill=ugreen!20!white,draw,inner sep=4pt] (Linear02) at ([shift=
{
(-0.2em,-0.2em)
}
]Linear01.south west)
{
\footnotesize
{
Linear
}}
;
\node
[anchor=south west,fill=ugreen!20!white,draw,inner sep=4pt] (Linear02) at ([shift=
{
(-0.2em,-0.2em)
}
]Linear01.south west)
{
\footnotesize
{
Linear
}}
;
\node
[anchor=north] (Q) at ([xshift=0em,yshift=-1em]Linear02.south)
{
\footnotesize
{$
\mathbf
{
Q
}$}}
;
\node
[anchor=north] (Q) at ([xshift=0em,yshift=-1em]Linear02.south)
{
\footnotesize
{$
\mathbf
{
Q
}$}}
;
\node
[anchor=west,draw=black!30,inner sep=4pt,fill=ugreen!20!white] (Linear1) at ([xshift=1.5em]Linear0.east)
{
\footnotesize
{
Linear
}}
;
\node
[anchor=west,draw=black!30,inner sep=4pt,fill=ugreen!20!white
,text=ugreen!20!white
] (Linear1) at ([xshift=1.5em]Linear0.east)
{
\footnotesize
{
Linear
}}
;
\node
[anchor=south west,draw=black!50,fill=ugreen!20!white,draw,inner sep=4pt] (Linear11) at ([shift=
{
(-0.2em,-0.2em)
}
]Linear1.south west)
{
\footnotesize
{
Linear
}}
;
\node
[anchor=south west,draw=black!50,fill=ugreen!20!white,draw,inner sep=4pt
,text=ugreen!20!white
] (Linear11) at ([shift=
{
(-0.2em,-0.2em)
}
]Linear1.south west)
{
\footnotesize
{
Linear
}}
;
\node
[anchor=south west,fill=ugreen!20!white,draw,inner sep=4pt] (Linear12) at ([shift=
{
(-0.2em,-0.2em)
}
]Linear11.south west)
{
\footnotesize
{
Linear
}}
;
\node
[anchor=south west,fill=ugreen!20!white,draw,inner sep=4pt] (Linear12) at ([shift=
{
(-0.2em,-0.2em)
}
]Linear11.south west)
{
\footnotesize
{
Linear
}}
;
\node
[anchor=north] (K) at ([xshift=0em,yshift=-1em]Linear12.south)
{
\footnotesize
{$
\mathbf
{
K
}$}}
;
\node
[anchor=north] (K) at ([xshift=0em,yshift=-1em]Linear12.south)
{
\footnotesize
{$
\mathbf
{
K
}$}}
;
\node
[anchor=west,draw=black!30,inner sep=4pt,fill=ugreen!20!white] (Linear2) at ([xshift=1.5em]Linear1.east)
{
\footnotesize
{
Linear
}}
;
\node
[anchor=west,draw=black!30,inner sep=4pt,fill=ugreen!20!white
,text=ugreen!20!white
] (Linear2) at ([xshift=1.5em]Linear1.east)
{
\footnotesize
{
Linear
}}
;
\node
[anchor=south west,draw=black!50,fill=ugreen!20!white,draw,inner sep=4pt] (Linear21) at ([shift=
{
(-0.2em,-0.2em)
}
]Linear2.south west)
{
\footnotesize
{
Linear
}}
;
\node
[anchor=south west,draw=black!50,fill=ugreen!20!white,draw,inner sep=4pt
,text=ugreen!20!white
] (Linear21) at ([shift=
{
(-0.2em,-0.2em)
}
]Linear2.south west)
{
\footnotesize
{
Linear
}}
;
\node
[anchor=south west,fill=ugreen!20!white,draw,inner sep=4pt] (Linear22) at ([shift=
{
(-0.2em,-0.2em)
}
]Linear21.south west)
{
\footnotesize
{
Linear
}}
;
\node
[anchor=south west,fill=ugreen!20!white,draw,inner sep=4pt] (Linear22) at ([shift=
{
(-0.2em,-0.2em)
}
]Linear21.south west)
{
\footnotesize
{
Linear
}}
;
\node
[anchor=north] (V) at ([xshift=0em,yshift=-1em]Linear22.south)
{
\footnotesize
{$
\mathbf
{
V
}$}}
;
\node
[anchor=north] (V) at ([xshift=0em,yshift=-1em]Linear22.south)
{
\footnotesize
{$
\mathbf
{
V
}$}}
;
\node
[anchor=south,draw=black!30,minimum width=12em,minimum height=2em,inner sep=4pt,fill=blue!20!white] (Scale) at ([yshift=1em]Linear1.north)
{
\footnotesize
{
Scaled Dot-Product Attention
}}
;
\node
[anchor=south,draw=black!30,minimum width=12em,minimum height=2em,inner sep=4pt,fill=blue!20!white] (Scale) at ([yshift=1em]Linear1.north)
{
\footnotesize
{}}
;
\node
[anchor=south west,draw=black!50,minimum width=12em,minimum height=2em,fill=blue!20!white,draw,inner sep=4pt] (Scale1) at ([shift=
{
(-0.2em,-0.2em)
}
]Scale.south west)
{
\footnotesize
{
Scaled Dot-Product Attention
}}
;
\node
[anchor=south west,draw=black!50,minimum width=12em,minimum height=2em,fill=blue!20!white,draw,inner sep=4pt] (Scale1) at ([shift=
{
(-0.2em,-0.2em)
}
]Scale.south west)
{
\footnotesize
{}}
;
\node
[anchor=south west,fill=blue!20!white,draw,minimum width=12em,minimum height=2em,inner sep=4pt] (Scale2) at ([shift=
{
(-0.2em,-0.2em)
}
]Scale1.south west)
{
\footnotesize
{
Scaled Dot-Product Attention
}}
;
\node
[anchor=south west,fill=blue!20!white,draw,minimum width=12em,minimum height=2em,inner sep=4pt] (Scale2) at ([shift=
{
(-0.2em,-0.2em)
}
]Scale1.south west)
{
\footnotesize
{
Scaled Dot-Product Attention
}}
;
\node
[anchor=south,draw,minimum width=4em,inner sep=4pt,fill=yellow!30] (Concat) at ([yshift=1em]Scale2.north)
{
\footnotesize
{
Concat
}}
;
\node
[anchor=south,draw,minimum width=4em,inner sep=4pt,fill=yellow!30] (Concat) at ([yshift=1em]Scale2.north)
{
\footnotesize
{
Concat
}}
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论