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
d0d33685
Commit
d0d33685
authored
Aug 14, 2020
by
单韦乔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
第13章-旧版本内容重组
parent
cbf2b2e6
全部展开
显示空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
619 行增加
和
0 行删除
+619
-0
Chapter13/Figures/figure-batch-generation-method.tex
+55
-0
Chapter13/Figures/figure-computation-of-dropout.tex
+72
-0
Chapter13/Figures/figure-difference-between-word-level-and-sequence-level-in-knowledge-distillation.tex
+0
-0
Chapter13/Figures/figure-ensemble-knowledge-distillation.tex
+60
-0
Chapter13/Figures/figure-increase-the-encoder.tex
+61
-0
Chapter13/Figures/figure-label-smoothing.tex
+74
-0
Chapter13/Figures/figure-network-with-dropout.tex
+78
-0
Chapter13/Figures/figure-norm.tex
+85
-0
Chapter13/Figures/figure-randomly-generation-vs-generate-by-sentence-length.tex
+31
-0
Chapter13/Figures/figure-underfitting-vs-overfitting.tex
+103
-0
Chapter13/chapter13.tex
+0
-0
没有找到文件。
Chapter13/Figures/figure-batch-generation-method.tex
0 → 100644
查看文件 @
d0d33685
\begin{tikzpicture}
\tikzstyle
{
node
}
= [minimum height=1.0*1.2em,draw,fill=green!20]
\tikzstyle
{
legend
}
= [minimum height=1.0*1.2em,minimum width=1.0*1.2em,draw]
\tikzstyle
{
node2
}
= [minimum width=1.0*1.2em,minimum height=4.1*1.2em,draw,fill=blue!20]
\node
[node,minimum width=2.8*1.2em]
(node1) at (0,0)
{}
;
\node
[node,minimum width=4.0*1.2em,anchor=north west]
(node2) at (node1.south west)
{}
;
\node
[node,minimum width=3.2*1.2em,anchor=north west]
(node3) at (node2.south west)
{}
;
\node
[node,minimum width=3.0*1.2em,anchor=north west]
(node4) at (node3.south west)
{}
;
\node
[node2,anchor = north west]
(grad1) at ([xshift=1.2em]node1.north east)
{}
;
\node
[node,minimum width=3.7*1.2em,anchor=north west]
(node5) at (grad1.north east)
{}
;
\node
[node,minimum width=2.8*1.2em,anchor=north west]
(node6) at (node5.south west)
{}
;
\node
[node,minimum width=3.2*1.2em,anchor=north west]
(node7) at (node6.south west)
{}
;
\node
[node,minimum width=4.0*1.2em,anchor=north west]
(node8) at (node7.south west)
{}
;
\node
[font=\footnotesize,anchor=east]
(line1) at (node1.west)
{
GPU1
}
;
\node
[font=\footnotesize,anchor=east]
(line2) at (node2.west)
{
GPU2
}
;
\node
[font=\footnotesize,anchor=east]
(line3) at (node3.west)
{
GPU3
}
;
\node
[font=\footnotesize,anchor=east]
(line4) at (node4.west)
{
GPU4
}
;
\node
[node2,anchor = north west]
(grad2) at ([xshift=0.3em]node5.north east)
{}
;
\draw
[->,thick]
(-1.4em*1.2,-3.62*1.2em) -- (9em*1.2,-3.62*1.2em);
\node
[node,minimum width=2.8*1.2em]
(node9) at (16em,0)
{}
;
\node
[node,minimum width=4.0*1.2em,anchor=north west]
(node10) at (node9.south west)
{}
;
\node
[node,minimum width=3.2*1.2em,anchor=north west]
(node11) at (node10.south west)
{}
;
\node
[node,minimum width=3.0*1.2em,anchor=north west]
(node12) at (node11.south west)
{}
;
\node
[node,minimum width=3.7*1.2em,anchor=north west]
(node13) at (node9.north east)
{}
;
\node
[node,minimum width=2.8*1.2em,anchor=north west]
(node14) at (node10.north east)
{}
;
\node
[node,minimum width=3.2*1.2em,anchor=north west]
(node15) at (node11.north east)
{}
;
\node
[node,minimum width=4.0*1.2em,anchor=north west]
(node16) at (node12.north east)
{}
;
\node
[node2,anchor = north west]
(grad3) at ([xshift=0.5em]node13.north east)
{}
;
\node
[font=\footnotesize,anchor=east]
(line1) at (node9.west)
{
GPU1
}
;
\node
[font=\footnotesize,anchor=east]
(line2) at (node10.west)
{
GPU2
}
;
\node
[font=\footnotesize,anchor=east]
(line3) at (node11.west)
{
GPU3
}
;
\node
[font=\footnotesize,anchor=east]
(line4) at (node12.west)
{
GPU4
}
;
\draw
[->,thick]
(node12.south west) -- ([xshift=3em]node16.south east);
\begin{pgfonlayer}
{
background
}
\node
[rectangle,inner sep=-0.0em,draw] [fit = (node1) (node2) (node3) (node4)] (box1)
{}
;
\node
[rectangle,inner sep=-0.0em,draw] [fit = (node5) (node6) (node7) (node8)] (box2)
{}
;
\node
[rectangle,inner sep=-0.0em,draw] [fit = (node9) (node13) (node12) (node16)] (box2)
{}
;
\end{pgfonlayer}
\node
[font=\footnotesize,anchor=north]
(legend1) at ([xshift=3em]node4.south)
{
一步一更新
}
;
\node
[font=\footnotesize,anchor=north]
(legend2) at ([xshift=2.5em]node12.south)
{
累积两步更新
}
;
\node
[font=\footnotesize,anchor=north]
(time1) at (grad2.south)
{
time
}
;
\node
[font=\footnotesize,anchor=north]
(time1) at (grad3.south)
{
time
}
;
\node
[legend]
(legend3) at (2em,2em)
{}
;
\node
[font=\footnotesize,anchor=west]
(idle) at (legend3.east)
{
:空闲
}
;
\node
[legend,anchor=west,draw,fill=green!30]
(legend4) at ([xshift = 2em]idle.east)
{}
;
\node
[font=\footnotesize,anchor=west]
(FB) at (legend4.east)
{
:前向/反向
}
;
\node
[legend,anchor=west,draw,fill=blue!30]
(legend5) at ([xshift = 2em]FB.east)
{}
;
\node
[font=\footnotesize,anchor=west]
(grad
_
sync) at (legend5.east)
{
:梯度更新
}
;
\end{tikzpicture}
\ No newline at end of file
Chapter13/Figures/figure-computation-of-dropout.tex
0 → 100644
查看文件 @
d0d33685
\begin{tikzpicture}
\def\neuronsep
{
1.5
}
\def\nodespace
{
1
}
\def\picturespace
{
0.8
}
\tikzstyle
{
neuronnode
}
= [minimum size=1.8em,circle,draw,very thick,ublue,inner sep=0pt, fill=white,align=center]
%standard
\node
[neuronnode] (neuron
_
b) at (0,0)
{
\scriptsize
{$
b
_{
i
}^{
l
}$}}
;
\node
[neuronnode] (neuron
_
y3) at (0,-1*
\neuronsep
)
{
\scriptsize
{$
x
_{
3
}^{
l
}$}}
;
\node
[neuronnode] (neuron
_
y2) at (0,-2*
\neuronsep
)
{
\scriptsize
{$
x
_{
2
}^{
l
}$}}
;
\node
[neuronnode] (neuron
_
y1) at (0,-3*
\neuronsep
)
{
\scriptsize
{$
x
_{
1
}^{
l
}$}}
;
\node
[neuronnode] (neuron
_
z) at (1.2 *
\nodespace
,-1.5 *
\neuronsep
)
{
\scriptsize
{$
z
_{
i
}^{
l
+
1
}$}}
;
\node
[neuronnode] (neuron
_
y') at (2.4 *
\nodespace
,-1.5 *
\neuronsep
)
{
\scriptsize
{$
x
_{
i
}^{
l
+
1
}$}}
;
\node
[anchor=north,ublue] (standard) at ([yshift=-4em]neuron
_
z.south)
{
\scriptsize
{
standard
}}
;
\node
[ublue] (standard) at ([xshift=-1em]neuron
_
z.west)
{
\scriptsize
{$
\mathbf
{
w
}_{
i
}^{
l
}$}}
;
\node
[ublue] (standard) at ([xshift=0.6em,yshift=0.3em]neuron
_
z.east)
{
\scriptsize
{$
f
$}}
;
\draw
[->,line width=0.3mm] (neuron
_
b.east) -- (neuron
_
z.west);
\draw
[->,line width=0.3mm] (neuron
_
y3.east) -- (neuron
_
z.west);
\draw
[->,line width=0.3mm] (neuron
_
y2.east) -- (neuron
_
z.west);
\draw
[->,line width=0.3mm] (neuron
_
y1.east) -- (neuron
_
z.west);
\draw
[->,line width=0.3mm] (neuron
_
z.east) -- (neuron
_
y'.west);
%dropout
\node
[neuronnode] (drop
_
neuron
_
b) at (5*
\nodespace
,0)
{
\scriptsize
{$
b
_{
i
}^{
l
}$}}
;
\node
[neuronnode] (drop
_
neuron
_
y3') at (5*
\nodespace
,-1*
\neuronsep
)
{
\scriptsize
{$
\tilde
{
x
}_{
3
}^{
l
}$}}
;
\node
[neuronnode] (drop
_
neuron
_
y2') at (5*
\nodespace
,-2*
\neuronsep
)
{
\scriptsize
{$
\tilde
{
x
}_{
2
}^{
l
}$}}
;
\node
[neuronnode] (drop
_
neuron
_
y1') at (5*
\nodespace
,-3*
\neuronsep
)
{
\scriptsize
{$
\tilde
{
x
}_{
1
}^{
l
}$}}
;
\node
[neuronnode] (drop
_
neuron
_
z) at (6.2 *
\nodespace
,-1.5 *
\neuronsep
)
{
\scriptsize
{$
z
_{
i
}^{
l
+
1
}$}}
;
\node
[neuronnode] (drop
_
neuron
_
y') at (7.4 *
\nodespace
,-1.5 *
\neuronsep
)
{
\scriptsize
{$
x
_{
i
}^{
l
+
1
}$}}
;
\node
[neuronnode] (drop
_
neuron
_
y3) at (3.8*
\nodespace
,-1*
\neuronsep
)
{
\scriptsize
{$
x
_{
3
}^{
l
}$}}
;
\node
[neuronnode] (drop
_
neuron
_
y2) at (3.8*
\nodespace
,-2*
\neuronsep
)
{
\scriptsize
{$
x
_{
2
}^{
l
}$}}
;
\node
[neuronnode] (drop
_
neuron
_
y1) at (3.8*
\nodespace
,-3*
\neuronsep
)
{
\scriptsize
{$
x
_{
1
}^{
l
}$}}
;
\node
[neuronnode] (drop
_
neuron
_
r3) at (4.4*
\nodespace
,-0.5*
\neuronsep
)
{
\scriptsize
{$
r
_{
3
}^{
l
}$}}
;
\node
[neuronnode] (drop
_
neuron
_
r2) at (4.4*
\nodespace
,-1.5*
\neuronsep
)
{
\scriptsize
{$
r
_{
2
}^{
l
}$}}
;
\node
[neuronnode] (drop
_
neuron
_
r1) at (4.4*
\nodespace
,-2.5*
\neuronsep
)
{
\scriptsize
{$
r
_{
1
}^{
l
}$}}
;
\node
[anchor=north,ublue] (standard) at ([yshift=-4em]drop
_
neuron
_
z.south)
{
\scriptsize
{
dropout
}}
;
\node
[ublue] (standard) at ([xshift=-1em]drop
_
neuron
_
z.west)
{
\scriptsize
{$
\mathbf
{
w
}_{
i
}^{
l
}$}}
;
\node
[ublue] (standard) at ([xshift=0.6em,yshift=0.3em]drop
_
neuron
_
z.east)
{
\scriptsize
{$
f
$}}
;
%structure
\draw
[->,line width=0.3mm] (drop
_
neuron
_
b.east) -- (drop
_
neuron
_
z.west);
\draw
[->,line width=0.3mm] (drop
_
neuron
_
y3'.east) -- (drop
_
neuron
_
z.west);
\draw
[->,line width=0.3mm] (drop
_
neuron
_
y2'.east) -- (drop
_
neuron
_
z.west);
\draw
[->,line width=0.3mm] (drop
_
neuron
_
y1'.east) -- (drop
_
neuron
_
z.west);
\draw
[->,line width=0.3mm] (drop
_
neuron
_
z.east) -- (drop
_
neuron
_
y'.west);
%r
\draw
[->,line width=0.3mm] (drop
_
neuron
_
y3.east) -- (drop
_
neuron
_
y3'.west);
\draw
[->,line width=0.3mm] (drop
_
neuron
_
y2.east) -- (drop
_
neuron
_
y2'.west);
\draw
[->,line width=0.3mm] (drop
_
neuron
_
y1.east) -- (drop
_
neuron
_
y1'.west);
\draw
[-,line width=0.3mm] (drop
_
neuron
_
r3.south) -- ([yshift=-1em]drop
_
neuron
_
r3.south);
\draw
[-,line width=0.3mm] (drop
_
neuron
_
r2.south) -- ([yshift=-1em]drop
_
neuron
_
r2.south);
\draw
[-,line width=0.3mm] (drop
_
neuron
_
r1.south) -- ([yshift=-1em]drop
_
neuron
_
r1.south);
%equ
\node
[anchor=west,inner sep = 2pt] (line1) at (9*
\nodespace
,0)
{
未应用dropout:
}
;
\node
[anchor=north west,inner sep = 2pt] (line2) at (line1.south west)
{$
z
_{
i
}^{
l
+
1
}
=
\mathbf
{
w
}_{
i
}^{
l
}
\mathbf
{
x
}
+
b
_{
i
}^{
l
}$}
;
\node
[anchor=north west,inner sep = 2pt] (line3) at (line2.south west)
{$
x
_{
i
}^{
l
+
1
}
=
f
\left
(
x
_{
i
}^{
l
}
\right
)
$}
;
\node
[anchor=north west,inner sep = 2pt] (line4) at (line3.south west)
{
应用dropout:
}
;
\node
[anchor=north west,inner sep = 2pt] (line5) at (line4.south west)
{$
r
_{
j
}^{
l
}
\sim
$
Bernoulli
$
(
1
-
p
)
$}
;
\node
[anchor=north west,inner sep = 2pt] (line6) at (line5.south west)
{$
\tilde
{
\mathbf
{
x
}}
=
\mathbf
{
r
}
*
\mathbf
{
x
}$}
;
\node
[anchor=north west,inner sep = 2pt] (line7) at (line6.south west)
{$
z
_{
i
}^{
l
+
1
}
=
\mathbf
{
w
}_{
i
}^{
l
}
\widetilde
{
\mathbf
{
x
}}
+
b
_{
i
}^{
l
}$}
;
\node
[anchor=north west,inner sep = 2pt] (line8) at (line7.south west)
{$
x
_{
i
}^{
l
+
1
}
=
f
\left
(
z
_{
i
}^{
l
}
\right
)
$}
;
\end{tikzpicture}
\ No newline at end of file
Chapter13/Figures/figure-difference-between-word-level-and-sequence-level-in-knowledge-distillation.tex
0 → 100644
查看文件 @
d0d33685
差异被折叠。
点击展开。
Chapter13/Figures/figure-ensemble-knowledge-distillation.tex
0 → 100644
查看文件 @
d0d33685
\begin{tikzpicture}
\newlength
{
\YShift
}
\newlength
{
\XShift
}
\setlength
{
\YShift
}{
0.8
\base
}
\setlength
{
\XShift
}{
0.8
\base
}
\tikzstyle
{
modelnode
}
= [rectangle,draw,rounded corners=2pt,inner sep=0pt,minimum height=4.2em,minimum width=2em,font=
\small
,anchor=north]
\coordinate
(stu01) at (0,0);
\coordinate
(stu02) at ([xshift=3em]stu01);
\coordinate
(stu03) at ([xshift=3em]stu02);
\coordinate
(stu04) at ([xshift=3em]stu03);
\coordinate
(stu05) at ([xshift=3em]stu04);
\coordinate
(tea01) at ([xshift=8em]stu05);
\coordinate
(tea02) at ([xshift=3em]tea01);
% iterations
\foreach
\curr
/
\prev
in
{
1/0,2/1,3/2
}
{
% models
\node
[modelnode,fill=yellow!20]
(stu
\curr
1) at ([yshift=-2em]stu
\prev
1.south)
{
\rotatebox
{
90
}{
Student
$
1
$}}
;
\node
[modelnode,fill=yellow!20]
(stu
\curr
2) at ([yshift=-2em]stu
\prev
2.south)
{
\rotatebox
{
90
}{
Student
$
2
$}}
;
\node
[modelnode,fill=yellow!20]
(stu
\curr
3) at ([yshift=-2em]stu
\prev
3.south)
{
\rotatebox
{
90
}{
Student
$
3
$}}
;
\node
[modelnode,fill=yellow!20]
(stu
\curr
4) at ([yshift=-2em]stu
\prev
4.south)
{
\rotatebox
{
90
}{
Student
$
4
$}}
;
\node
[modelnode,fill=yellow!20]
(stu
\curr
5) at ([yshift=-2em]stu
\prev
5.south)
{
\rotatebox
{
90
}{
Student
$
5
$}}
;
\node
[modelnode]
(tea
\curr
1) at ([yshift=-2em]tea
\prev
1.south)
{
\rotatebox
{
90
}{
\color
{
red!60
}
Teacher
$
1
$}}
;
\node
[modelnode]
(tea
\curr
2) at ([yshift=-2em]tea
\prev
2.south)
{
\rotatebox
{
90
}{
\color
{
blue!60
}
Teacher
$
2
$}}
;
% ensemble labels
\draw
[-latex']
([xshift=2pt]stu
\curr
5.east) to node [auto]
{
\small
Ensemble
}
([xshift=-2pt]tea
\curr
1.west);
}
% iteration labels
\node
[font=\small,anchor=east,purple!80]
(iterate1) at ([xshift=-1em]stu21.west)
{
\rotatebox
{
90
}{
Iteration
$
1
$}}
;
\node
[font=\small,anchor=east,purple!80]
(iterate2) at ([xshift=-1em]stu31.west)
{
\rotatebox
{
90
}{
Iteration
$
2
$}}
;
% distillation labels
\node
[font=\small,anchor=south west]
(distill1) at ([yshift=0.2em]iterate1.north west)
{
Distillation
}
;
\node
[font=\small,anchor=south west]
(distill2) at ([yshift=0.2em]iterate2.north west)
{
Distillation
}
;
% student groups
\begin{pgfonlayer}
{
background
}
\node
[rectangle,draw,very thick,red!60,densely dotted,inner sep=2pt,rounded corners=2pt,fill=red!20]
[fit = (stu21) (stu22) (stu23) ] (group21)
{}
;
\node
[rectangle,draw,very thick,blue!60,densely dotted,inner sep=2pt,rounded corners=2pt,fill=blue!20]
[fit = (stu24) (stu25) ] (group22)
{}
;
\node
[rectangle,draw,very thick,blue!60,densely dotted,inner sep=2pt,rounded corners=2pt,fill=blue!20]
[fit = (stu31) (stu32) ] (group31)
{}
;
\node
[rectangle,draw,very thick,red!60,densely dotted,inner sep=2pt,rounded corners=2pt,fill=red!20]
[fit = (stu33) (stu34) (stu35) ] (group32)
{}
;
\end{pgfonlayer}
% distillation
\draw
[-latex',red!60,very thick]
(tea11.south) .. controls +(south:1.5em) and +(north:2em) .. (group21.north);
\draw
[-latex',blue!60,very thick]
(tea12.south) .. controls +(south:2em) and +(north:1.5em) .. (group22.north);
\draw
[-latex',red!60,very thick]
(tea21.south) .. controls +(south:2em) and +(north:2.5em) .. (group32.north);
\draw
[-latex',blue!60,very thick]
(tea22.south) .. controls +(south:2em) and +(north:1.5em) .. (group31.north);
\end{tikzpicture}
\ No newline at end of file
Chapter13/Figures/figure-increase-the-encoder.tex
0 → 100644
查看文件 @
d0d33685
\begin{tikzpicture}
\setlength
{
\base
}{
1.2em
}
\tikzstyle
{
node
}
= [rounded corners=1pt,minimum width=1.2em,minimum height=1.2em,draw,fill=green!30!white]
\tikzstyle
{
node2
}
= [rounded corners=1pt,minimum width=1.2em,minimum height=1.2em,draw,fill=blue!30!white]
\node
[node]
(enc1) at (0,0)
{}
;
\node
[node]
(enc2) at ([xshift =
\base
]enc1.east)
{}
;
\node
[node]
(enc3) at ([xshift =
\base
]enc2.east)
{}
;
\node
[node]
(enc4) at ([xshift =
\base
]enc3.east)
{}
;
\node
[node]
(enc5) at ([xshift =
\base
]enc4.east)
{}
;
\node
[node]
(enc6) at ([xshift =
\base
]enc5.east)
{}
;
\node
[]
(enc7) at ([xshift =
\base
]enc6.east)
{
...
}
;
\node
[node]
(enc8) at ([xshift =
\base
]enc7.east)
{}
;
\node
[node]
(enc9) at ([xshift =
\base
]enc8.east)
{}
;
\node
[node]
(enc10) at ([xshift =
\base
]enc9.east)
{}
;
\node
[font=\scriptsize,rotate=270]
(src) at ([xshift = -
\base
]enc1.west)
{
src
}
;
\draw
[->] ([xshift=-0.75em]enc1.west) -- (enc1.west);
\draw
[decorate,decoration=
{
brace
}
] ([yshift=0.3em]enc1.north west) to node [auto,anchor=south,font=
\scriptsize
]
{$
N
$
x
}
([yshift=0.3em]enc10.north east);
\draw
[->] (enc1.east) -- (enc2.west);
\draw
[->] (enc2.east) -- (enc3.west);
\draw
[->] (enc3.east) -- (enc4.west);
\draw
[->] (enc4.east) -- (enc5.west);
\draw
[->] (enc5.east) -- (enc6.west);
\draw
[->] (enc8.east) -- (enc9.west);
\draw
[->] (enc9.east) -- (enc10.west);
\node
[node2,anchor=north]
(dec1) at ([yshift=-2em]enc1.south)
{}
;
\node
[node2,anchor=north]
(dec2) at ([yshift=-2em]enc2.south)
{}
;
\node
[node2,anchor=north]
(dec3) at ([yshift=-2em]enc3.south)
{}
;
\node
[node2,anchor=north]
(dec4) at ([yshift=-2em]enc4.south)
{}
;
\node
[node2,anchor=north]
(dec5) at ([yshift=-2em]enc5.south)
{}
;
\node
[node2,anchor=north]
(dec6) at ([yshift=-2em]enc6.south)
{}
;
\node
[font=\scriptsize,rotate=270]
(tgt) at ([xshift = -
\base
]dec1.west)
{
tgt
}
;
\node
[font=\scriptsize,rotate=270]
(tgt) at ([xshift =
\base
]dec6.east)
{
out
}
;
\draw
[->] ([xshift=-0.75em]dec1.west) -- (dec1.west);
\draw
[->] (dec6.east) -- ([xshift=0.75em]dec6.east);
\draw
[decorate,decoration=
{
brace,mirror
}
] ([yshift=-0.3em]dec1.south west) to node [auto,anchor=north,font=
\scriptsize
]
{
6x
}
([yshift=-0.3em]dec6.south east);
\draw
[->] (dec1.east) -- (dec2.west);
\draw
[->] (dec2.east) -- (dec3.west);
\draw
[->] (dec3.east) -- (dec4.west);
\draw
[->] (dec4.east) -- (dec5.west);
\draw
[->] (dec5.east) -- (dec6.west);
\node
[node]
(enc
_
legend) at ([xshift = 2
\base
]enc10.east)
{}
;
\node
[node2,anchor=north]
(dec
_
legend) at ([yshift = -
\base
]enc
_
legend.south)
{}
;
\node
[font=\scriptsize,anchor=west]
(line1) at (enc
_
legend.east)
{
:编码层
}
;
\node
[font=\scriptsize,anchor=west]
(line1) at (dec
_
legend.east)
{
:解码层
}
;
%\node[node] (dec1) at ([xshift=4em]enc1.east) {Decoder};
%\node[node2] (enc2) at ([xshift=4em]dec1.east) {Encoder};
%\node[node] (dec2) at ([xshift=4em]enc2.east) {Decoder};
\coordinate
(c1) at ([xshift=1em]enc10.east);
\coordinate
(c2) at ([yshift=-1.6em]c1.south);
\draw
[->,rounded corners] (enc10.east) -- (c1) -- (c2)--([yshift=1em]dec1.north) -- (dec1.north);
\draw
[->,rounded corners] (enc10.east) -- (c1) -- (c2)--([yshift=1em]dec2.north) -- (dec2.north);
\draw
[->,rounded corners] (enc10.east) -- (c1) -- (c2)--([yshift=1em]dec3.north) -- (dec3.north);
\draw
[->,rounded corners] (enc10.east) -- (c1) -- (c2)--([yshift=1em]dec4.north) -- (dec4.north);
\draw
[->,rounded corners] (enc10.east) -- (c1) -- (c2)--([yshift=1em]dec5.north) -- (dec5.north);
\draw
[->,rounded corners] (enc10.east) -- (c1) -- (c2)--([yshift=1em]dec6.north) -- (dec6.north);
\end{tikzpicture}
\ No newline at end of file
Chapter13/Figures/figure-label-smoothing.tex
0 → 100644
查看文件 @
d0d33685
\begin{tikzpicture}
\node
[font=\scriptsize]
(model) at (0,0)
{
Model Output:
}
;
\node
[anchor=north west,font=\scriptsize]
(label
_
smooth) at ([yshift=-1.8em]model.south west)
{
Label Smoothing:
}
;
\node
[anchor=south west,font=\scriptsize]
(one-hot) at ([yshift=2em]model.north west)
{
One-hot:
}
;
%model out
\node
[anchor=west,minimum width=1.2em,minimum height=0.2em,fill=ublue!80,inner sep=0pt] (model
_
label1) at ([xshift=1.5em,yshift=-0.5em]model.east)
{}
;
\node
[anchor=south,font=
\scriptsize
] (model
_
w1) at (model
_
label1.north)
{$
p
_{
1
}$}
;
\node
[anchor=south west,minimum width=1.2em,minimum height=0.1em,fill=ublue!80,inner sep=0pt] (model
_
label2) at (model
_
label1.south east)
{}
;
\node
[anchor=south,font=
\scriptsize
] (model
_
w2) at (model
_
label2.north)
{$
p
_{
2
}$}
;
\node
[anchor=south west,minimum width=1.2em,minimum height=0.7em,fill=ublue!80,inner sep=0pt] (model
_
label3) at (model
_
label2.south east)
{}
;
\node
[anchor=south,font=
\scriptsize
] (model
_
w3) at (model
_
label3.north)
{{
\color
{
red
}
$
p
_{
3
}$}}
;
\node
[anchor=south west,minimum width=1.2em,minimum height=0.4em,fill=ublue!80,inner sep=0pt] (model
_
label4) at (model
_
label3.south east)
{}
;
\node
[anchor=south,font=
\scriptsize
] (model
_
w5) at (model
_
label4.north)
{$
p
_{
4
}$}
;
\node
[anchor=south west,minimum width=1.2em,minimum height=0.1em,fill=ublue!80,inner sep=0pt] (model
_
label5) at (model
_
label4.south east)
{}
;
\node
[anchor=south,font=
\scriptsize
] (model
_
w6) at (model
_
label5.north)
{$
p
_{
5
}$}
;
\node
[anchor=south west,minimum width=1.2em,minimum height=0.3em,fill=ublue!80,inner sep=0pt] (model
_
label6) at (model
_
label5.south east)
{}
;
\node
[anchor=south,font=
\scriptsize
] (model
_
w7) at (model
_
label6.north)
{$
p
_{
6
}$}
;
\node
[anchor=south west,minimum width=1.2em,minimum height=0.2em,fill=ublue!80,inner sep=0pt] (model
_
label7) at (model
_
label6.south east)
{}
;
\node
[anchor=south,font=
\scriptsize
] (model
_
w8) at (model
_
label7.north)
{$
p
_{
7
}$}
;
%no label smooth
\node
[anchor=west,minimum width=1.2em,minimum height=0.05em,fill=orange!50,inner sep=0pt,font=
\tiny
] (one
_
hot
_
label1) at ([xshift=1.5em,yshift=3em]model.east)
{}
;
\node
[anchor=south,font=
\scriptsize
] (one
_
hot
_
w1) at (one
_
hot
_
label1.north)
{$
0
$}
;
\node
[anchor=south west,minimum width=1.2em,minimum height=0.05em,fill=orange!50,inner sep=0pt,font=
\tiny
] (one
_
hot
_
label2) at (one
_
hot
_
label1.south east)
{}
;
\node
[anchor=south,font=
\scriptsize
] (one
_
hot
_
w2) at (one
_
hot
_
label2.north)
{$
0
$}
;
\node
[anchor=south west,minimum width=1.2em,minimum height=1.5em,fill=orange!50,inner sep=0pt] (one
_
hot
_
label3) at (one
_
hot
_
label2.south east)
{}
;
\node
[anchor=south,font=
\scriptsize
] (one
_
hot
_
w3) at (one
_
hot
_
label3.north)
{{
\color
{
red
}
$
1
$}}
;
\node
[anchor=south west,minimum width=1.2em,minimum height=0.05em,fill=orange!50,inner sep=0pt,font=
\tiny
] (one
_
hot
_
label4) at (one
_
hot
_
label3.south east)
{}
;
\node
[anchor=south,font=
\scriptsize
] (one
_
hot
_
w4) at (one
_
hot
_
label4.north)
{$
0
$}
;
\node
[anchor=south west,minimum width=1.2em,minimum height=0.05em,fill=orange!50,inner sep=0pt,font=
\tiny
] (one
_
hot
_
label5) at (one
_
hot
_
label4.south east)
{}
;
\node
[anchor=south,font=
\scriptsize
] (one
_
hot
_
w5) at (one
_
hot
_
label5.north)
{$
0
$}
;
\node
[anchor=south west,minimum width=1.2em,minimum height=0.05em,fill=orange!50,inner sep=0pt,font=
\tiny
] (one
_
hot
_
label6) at (one
_
hot
_
label5.south east)
{}
;
\node
[anchor=south,font=
\scriptsize
] (one
_
hot
_
w6) at (one
_
hot
_
label6.north)
{$
0
$}
;
\node
[anchor=south west,minimum width=1.12em,minimum height=0.05em,fill=orange!50,inner sep=0pt,font=
\tiny
] (one
_
hot
_
label7) at (one
_
hot
_
label6.south east)
{}
;
\node
[anchor=south,font=
\scriptsize
] (one
_
hot
_
w7) at (one
_
hot
_
label7.north)
{$
0
$}
;
%label smoothing
\node
[anchor=west,minimum width=1.2em,minimum height=0.2em,fill=red!50,inner sep=0pt] (label1) at ([xshift=1.5em,yshift=-3.2em]model.east)
{}
;
\node
[anchor=south,font=
\scriptsize
] (w1) at (label1.north)
{$
0
.
1
$}
;
\node
[anchor=south west,minimum width=1.2em,minimum height=0.2em,fill=red!50,inner sep=0pt] (label2) at (label1.south east)
{}
;
\node
[anchor=south,font=
\scriptsize
] (w2) at (label2.north)
{$
0
.
1
$}
;
\node
[anchor=south west,minimum width=1.2em,minimum height=0.8em,fill=red!50,inner sep=0pt] (label3) at (label2.south east)
{}
;
\node
[anchor=south,font=
\scriptsize
] (w3) at (label3.north)
{{
\color
{
red
}
$
0
.
4
$}}
;
\node
[anchor=south west,minimum width=1.2em,minimum height=0.2em,fill=red!50,inner sep=0pt] (label4) at (label3.south east)
{}
;
\node
[anchor=south,font=
\scriptsize
] (w5) at (label4.north)
{$
0
.
1
$}
;
\node
[anchor=south west,minimum width=1.2em,minimum height=0.2em,fill=red!50,inner sep=0pt] (label5) at (label4.south east)
{}
;
\node
[anchor=south,font=
\scriptsize
] (w6) at (label5.north)
{$
0
.
1
$}
;
\node
[anchor=south west,minimum width=1.2em,minimum height=0.2em,fill=red!50,inner sep=0pt] (label6) at (label5.south east)
{}
;
\node
[anchor=south,font=
\scriptsize
] (w7) at (label6.north)
{$
0
.
1
$}
;
\node
[anchor=south west,minimum width=1.2em,minimum height=0.2em,fill=red!50,inner sep=0pt] (label7) at (label6.south east)
{}
;
\node
[anchor=south,font=
\scriptsize
] (w8) at (label7.north)
{$
0
.
1
$}
;
\node
[font=\scriptsize]
(line1) at ([xshift=9em,yshift=-1.5em]model
_
label7.east)
{$
loss
=-
0
.
3
\log
p
_{
3
}
-
\sum
_{
i
=
1
}^{
7
}
0
.
1
\log
p
_{
i
}$}
;
\node
[font=\scriptsize]
(line2) at ([xshift=5.9em,yshift=3.5em]model
_
label7.east)
{$
loss
=-
\log
p
_{
3
}$}
;
\begin{pgfonlayer}
{
background
}
\node
[rectangle,inner sep=0.1em,rounded corners=1pt,very thick,dotted,draw=red] [fit = (one
_
hot
_
label1) (one
_
hot
_
w3) (one
_
hot
_
label7) (model
_
label1) (model
_
label7)] (box1)
{}
;
\node
[rectangle,inner sep=0.2em,rounded corners=1pt,fill=purple!10,drop shadow,draw=purple] [fit = (line2)] (box3)
{}
;
\draw
[->,dotted,very thick,red] ([yshift=-1em]box1.east) .. controls +(east:1) and +(west:1) .. (box3.west);
\node
[rectangle,inner sep=0.1em,rounded corners=1pt,very thick,dotted,draw=ugreen] [fit = (label1) (label7) (model
_
label1) (model
_
label7) (model
_
w3)] (box2)
{}
;
\node
[rectangle,inner sep=0.2em,rounded corners=1pt,fill=green!10,drop shadow,draw=ugreen] [fit = (line1)] (box4)
{}
;
\draw
[->,dotted,very thick,ugreen] ([yshift=1em]box2.east) .. controls +(east:1) and +(west:1) .. (box4.west);
\end{pgfonlayer}
\end{tikzpicture}
\ No newline at end of file
Chapter13/Figures/figure-network-with-dropout.tex
0 → 100644
查看文件 @
d0d33685
\begin{tikzpicture}
\def\neuronsep
{
1
}
\tikzstyle
{
neuronnode
}
= [minimum size=1.0em,circle,draw,thick,ublue,inner sep=1pt, fill=white,align=center]
%standard
\foreach
\n
in
{
1,...,4
}{
\node
[neuronnode] (neuron0
\n
) at (0,
\n
*
\neuronsep
)
{}
;
}
\foreach
\n
in
{
1,...,4
}{
\node
[neuronnode] (neuron1
\n
) at (1.2
\neuronsep
,
\n
*
\neuronsep
)
{}
;
}
\foreach
\n
in
{
1,...,4
}{
\node
[neuronnode] (neuron2
\n
) at (2.4*
\neuronsep
,
\n
*
\neuronsep
)
{}
;
}
\node
[neuronnode] (neuron3) at (3.6*
\neuronsep
,2.5 *
\neuronsep
)
{}
;
\foreach
\n
in
{
1,...,4
}{
\foreach
\m
in
{
1,...,4
}{
\draw
[->] (neuron0
\n
.east) -- (neuron1
\m
.west);
}
}
\foreach
\n
in
{
1,...,4
}{
\foreach
\m
in
{
1,...,4
}{
\draw
[->] (neuron1
\n
.east) -- (neuron2
\m
.west);
}
}
\foreach
\n
in
{
1,...,4
}{
\draw
[->] (neuron2
\n
.east) -- (neuron3.west);
}
%drop
%layer1
\foreach
\n
in
{
1,3,4
}{
\node
[neuronnode] (neuron4
\n
) at (5*
\neuronsep
,
\n
*
\neuronsep
)
{}
;
}
\node
[neuronnode,dashed] (neuron42) at (5*
\neuronsep
,2 *
\neuronsep
)
{}
;
%layer1
\foreach
\n
in
{
1,2,4
}{
\node
[neuronnode] (neuron5
\n
) at (6.2*
\neuronsep
,
\n
*
\neuronsep
)
{}
;
}
\node
[neuronnode,dashed] (neuron53) at (6.2*
\neuronsep
,3 *
\neuronsep
)
{}
;
%layer3
\foreach
\n
in
{
1,4
}{
\node
[neuronnode] (neuron6
\n
) at (7.4*
\neuronsep
,
\n
*
\neuronsep
)
{}
;
}
\node
[neuronnode,dashed] (neuron62) at (7.4*
\neuronsep
,2 *
\neuronsep
)
{}
;
\node
[neuronnode,dashed] (neuron63) at (7.4*
\neuronsep
,3 *
\neuronsep
)
{}
;
%layer4
\node
[neuronnode] (neuron7) at (8.6*
\neuronsep
,2.5 *
\neuronsep
)
{}
;
\foreach
\n
in
{
1,3,4
}{
\foreach
\m
in
{
1,2,4
}{
\draw
[->] (neuron4
\n
.east) -- (neuron5
\m
.west);
}
}
\foreach
\n
in
{
1,2,4
}{
\foreach
\m
in
{
1,4
}{
\draw
[->] (neuron5
\n
.east) -- (neuron6
\m
.west);
}
}
\foreach
\n
in
{
1,4
}{
\draw
[->] (neuron6
\n
.east) -- (neuron7.west);
}
\end{tikzpicture}
\ No newline at end of file
Chapter13/Figures/figure-norm.tex
0 → 100644
查看文件 @
d0d33685
\begin{tikzpicture}
\tikzstyle
{
sublayernode
}
= [rectangle,draw,thick,inner sep=3pt,rounded corners=2pt,align=center,minimum height=1.5em,minimum width=1.5em,font=
\scriptsize
]
\tikzstyle
{
inputnode
}
= [rectangle,inner sep=3pt,align=center,font=
\scriptsize
]
%\tikzstyle{circlenode} = [circle,draw,thick,minimum size=0.3\base,font=\small,inner sep=0pt]
\tikzstyle
{
mnode
}
= [circle,thick,minimum size=0.7em,font=
\small
,inner sep=0pt,draw]
\node
[anchor=south west,inputnode]
(input) at (0,0)
{$
x
_{
i
}^{
l
}$}
;
\node
[anchor=west,sublayernode,fill=red!10]
(ln) at ([xshift=1.2em]input.east)
{
LN
}
;
\node
[anchor=west,sublayernode,fill=green!10]
(fn) at ([xshift=1.2em]ln.east)
{
F
}
;
\node
[anchor=west,mnode]
(m) at ([xshift=2em]fn.east)
{}
;
\node
[]
(res) at ([xshift=2.4em]fn.east)
{
+
}
;
\node
[anchor=west,sublayernode,fill=red!10]
(ln1) at ([xshift=2em]m.east)
{
LN
}
;
\node
[anchor=west,sublayernode,fill=green!10]
(fn1) at ([xshift=1.2em]ln1.east)
{
F
}
;
\node
[anchor=west,mnode]
(m1) at ([xshift=2em]fn1.east)
{}
;
\node
[]
(res1) at ([xshift=2.4em]fn1.east)
{
+
}
;
\node
[anchor=west,inputnode]
(output) at ([xshift=1.2em]res1.east)
{$
x
_{
i
}^{
l
+
1
}$}
;
\node
[anchor=west,inputnode]
(legend1) at (6em,-1em)
{
(a) 标准Transformer网络
}
;
%\coordinate (mend) at ([xshift=1em]m.west);
\draw
[-latex',thick]
(input)--(ln);
\draw
[-latex',thick]
(ln)--(fn);
\draw
[-latex',thick]
(fn)--(m);
%\draw[-,thick] (mend)--(res);
\coordinate
(h) at ([xshift=-0.7em]ln.west);
\draw
[-latex',thick,rounded corners]
(h) -- ([yshift=1.35em]h.north) -- ([yshift=1em]m.north) -- (m.north);
%\coordinate (mend1) at ([xshift=1.0\hseg]m1.west);
\draw
[-latex',thick]
(m)--(ln1);
\draw
[-latex',thick]
(ln1)--(fn1);
\draw
[-latex',thick]
(fn1)--(m1);
%\draw[-,thick] (mend1)--(res1);
\draw
[-latex',thick]
(m1)--(output);
\coordinate
(h1) at ([xshift=-0.7em]ln1.west);
\draw
[-latex',thick,rounded corners]
(h1) -- ([yshift=1.35em]h1.north) -- ([yshift=1em]m1.north) -- (m1.north);
%--------------------------------------------------------
\node
[anchor=south west,inputnode]
(input
_
2) at (0,-6em)
{$
x
_{
i
}^{
l
}$}
;
\node
[anchor=west,sublayernode,fill=red!10]
(ln
_
2) at ([xshift=1.2em]input
_
2.east)
{
LN
}
;
\node
[anchor=west,sublayernode,fill=green!10]
(fn
_
2) at ([xshift=1.2em]ln
_
2.east)
{
F
}
;
\node
[anchor=west,mnode]
(m
_
2) at ([xshift=2em]fn
_
2.east)
{}
;
\node
[]
(res
_
2) at ([xshift=2.4em]fn
_
2.east)
{
+
}
;
\node
[anchor=west,sublayernode,fill=red!10]
(ln1
_
2) at ([xshift=2em]m
_
2.east)
{
LN
}
;
\node
[anchor=west,sublayernode,fill=green!10]
(fn1
_
2) at ([xshift=1.2em]ln1
_
2.east)
{
F
}
;
\node
[anchor=west,mnode]
(m1
_
2) at ([xshift=2em]fn1
_
2.east)
{}
;
\node
[]
(res1
_
2) at ([xshift=2.4em]fn1
_
2.east)
{
+
}
;
\node
[anchor=west,inputnode]
(output
_
2) at ([xshift=1.2em]res1
_
2.east)
{$
x
_{
i
}^{
l
+
1
}$}
;
\node
[anchor=west,inputnode]
(legend2) at (2.5em,-7.5em)
{
(b) 引入Layer Dropout后的Transformer网络
}
;
\node
[anchor=south west,inputnode,red,font=\tiny]
(mlable) at ([xshift=-2.2em,yshift=-0.6em]m
_
2.south)
{
M=1
}
;
\node
[anchor=south west,inputnode,red,font=\tiny]
(mlable1) at ([xshift=-2.2em,yshift=-0.6em]m1
_
2.south)
{
M=0
}
;
\coordinate
(start
_
1) at ([xshift=-1.3em]m
_
2.west);
\coordinate
(end
_
1) at ([xshift=-0.5em]m
_
2.west);
%\node[red,font=\scriptsize] (dot1) at (start_1) {$\cdot$};
\draw
[-latex',thick]
(input
_
2)--(ln
_
2);
\draw
[-latex',thick]
(ln
_
2)--(fn
_
2);
\draw
[-latex',thick]
(fn
_
2)--(start
_
1);
\draw
[-,thick,red]
(start
_
1)--(end
_
1);
\draw
[-,thick]
(end
_
1)--(m
_
2);
%\draw[-,thick] (mend)--(res);
\coordinate
(h
_
2) at ([xshift=-0.7em]ln
_
2.west);
\draw
[-latex',thick,rounded corners]
(h
_
2) -- ([yshift=1.35em]h
_
2.north) -- ([yshift=1em]m
_
2.north) -- (m
_
2.north);
%\coordinate (mend1) at ([xshift=1.0\hseg]m1.west);
\coordinate
(start
_
2) at ([xshift=-1.3em]m1
_
2.west);
\coordinate
(end
_
2) at ([xshift=-0.5em]m1
_
2.west);
\draw
[-latex',thick]
(m
_
2)--(ln1
_
2);
\draw
[-latex',thick]
(ln1
_
2)--(fn1
_
2);
\draw
[-latex',thick]
(fn1
_
2)--(start
_
2);
\draw
[-,thick,red]
(start
_
2)--([yshift=0.3em]end
_
2);
\draw
[-,thick]
(end
_
2)--(m1
_
2);
%\draw[-,thick] (mend1)--(res1);
\draw
[-latex',thick]
(m1
_
2)--(output
_
2);
\coordinate
(h1
_
2) at ([xshift=-0.7em]ln1
_
2.west);
\draw
[-latex',thick,rounded corners]
(h1
_
2) -- ([yshift=1.35em]h1
_
2.north) -- ([yshift=1em]m1
_
2.north) -- (m1
_
2.north);
\end{tikzpicture}
\ No newline at end of file
Chapter13/Figures/figure-randomly-generation-vs-generate-by-sentence-length.tex
0 → 100644
查看文件 @
d0d33685
\begin{tikzpicture}
\tikzstyle
{
node
}
= [minimum height=1.0*1.2em,draw,fill=green!20]
\node
[node,minimum width=2.0*1.2em]
(sent1) at (0,0)
{}
;
\node
[node,minimum width=5.0*1.2em,anchor=north west]
(sent2) at (sent1.south west)
{}
;
\node
[node,minimum width=1.0*1.2em,anchor=north west]
(sent3) at (sent2.south west)
{}
;
\node
[node,minimum width=3.0*1.2em,anchor=north west]
(sent4) at (sent3.south west)
{}
;
\node
[node,minimum width=4.0*1.2em]
(sent5) at (14em,0)
{}
;
\node
[node,minimum width=4.5*1.2em,anchor=north west]
(sent6) at (sent5.south west)
{}
;
\node
[node,minimum width=4.5*1.2em,anchor=north west]
(sent7) at (sent6.south west)
{}
;
\node
[node,minimum width=5*1.2em,anchor=north west]
(sent8) at (sent7.south west)
{}
;
\node
[font=\footnotesize,anchor=east]
(line1) at (sent1.west)
{
句子1
}
;
\node
[font=\footnotesize,anchor=east]
(line2) at (sent2.west)
{
句子2
}
;
\node
[font=\footnotesize,anchor=east]
(line3) at (sent3.west)
{
句子3
}
;
\node
[font=\footnotesize,anchor=east]
(line4) at (sent4.west)
{
句子4
}
;
\node
[font=\footnotesize,anchor=east]
(line5) at (sent5.west)
{
句子1
}
;
\node
[font=\footnotesize,anchor=east]
(line6) at (sent6.west)
{
句子2
}
;
\node
[font=\footnotesize,anchor=east]
(line7) at (sent7.west)
{
句子3
}
;
\node
[font=\footnotesize,anchor=east]
(line8) at (sent8.west)
{
句子4
}
;
\begin{pgfonlayer}
{
background
}
\node
[rectangle,inner sep=-0.0em,draw] [fit = (sent1) (sent2) (sent3) (sent4)] (box1)
{}
;
\node
[rectangle,inner sep=-0.0em,draw] [fit = (sent5) (sent6) (sent7) (sent8)] (box2)
{}
;
\end{pgfonlayer}
\node
[font=\footnotesize]
(node1) at ([yshift=-3.4em]sent2.south)
{
随机生成
}
;
\node
[font=\footnotesize]
(node2) at ([yshift=-1em]sent8.south)
{
排序生成
}
;
\end{tikzpicture}
\ No newline at end of file
Chapter13/Figures/figure-underfitting-vs-overfitting.tex
0 → 100644
查看文件 @
d0d33685
\begin{tabular}
{
l l l
}
\begin{tikzpicture}
\draw
[->, thick]
(0,0) to (3,0);
\draw
[->, thick]
(0,-0) to (0,2);
\node
(a) at (1*0.3,6*0.2)
{}
;
\node
(b) at (2*0.3,4*0.2)
{}
;
\node
(c) at (3*0.3,3*0.2)
{}
;
\node
(d) at (4*0.3,3*0.2)
{}
;
\node
(e) at (6*0.3,4*0.2)
{}
;
\node
(f) at (7*0.3,6*0.2)
{}
;
\node
(g) at (8*0.3,8.4*0.2)
{}
;
\node
(h) at (9*0.3,9.7*0.2)
{}
;
\fill
[black] (a) circle(1pt);
\fill
[black] (b) circle(1pt);
\fill
[black] (c) circle(1pt);
\fill
[black] (d) circle(1pt);
\fill
[black] (e) circle(1pt);
\fill
[black] (f) circle(1pt);
\fill
[black] (g) circle(1pt);
\fill
[black] (h) circle(1pt);
% y=0.73x + 2.54
\draw
[thick,red] (0.5*0.3,1.81*0.2) to (10*0.3,9.84*0.2);
\node
[font=
\footnotesize
] at (1.5,-0.5)
{
欠拟合
}
;
\end{tikzpicture}
&
\begin{tikzpicture}
\draw
[->, thick]
(0,0) to (3,0);
\draw
[->, thick]
(0,-0) to (0,2);
\node
(a) at (1*0.3,6*0.2)
{}
;
\node
(b) at (2*0.3,4*0.2)
{}
;
\node
(c) at (3*0.3,3*0.2)
{}
;
\node
(d) at (4*0.3,3*0.2)
{}
;
\node
(e) at (6*0.3,4*0.2)
{}
;
\node
(f) at (7*0.3,6*0.2)
{}
;
\node
(g) at (8*0.3,8.4*0.2)
{}
;
\node
(h) at (9*0.3,9.7*0.2)
{}
;
\fill
[black] (a) circle(1pt);
\fill
[black] (b) circle(1pt);
\fill
[black] (c) circle(1pt);
\fill
[black] (d) circle(1pt);
\fill
[black] (e) circle(1pt);
\fill
[black] (f) circle(1pt);
\fill
[black] (g) circle(1pt);
\fill
[black] (h) circle(1pt);
\draw
[thick,red] (0.5*0.3,6.15*0.2) to [bend right] (5*0.3,3*0.2) ;
\draw
[thick,red] (5*0.3,3*0.2) to [bend right] (8.5*0.3,10*0.2) ;
\node
[font=
\footnotesize
] at (1.5,-0.5)
{
拟合合适
}
;
\end{tikzpicture}
&
\begin{tikzpicture}
\draw
[->, thick]
(0,0) to (3,0);
\draw
[->, thick]
(0,-0) to (0,2);
\node
(a) at (1*0.3,6*0.2)
{}
;
\node
(b) at (2*0.3,4*0.2)
{}
;
\node
(c) at (3*0.3,3*0.2)
{}
;
\node
(d) at (4*0.3,3*0.2)
{}
;
\node
(e) at (6*0.3,4*0.2)
{}
;
\node
(f) at (7*0.3,6*0.2)
{}
;
\node
(g) at (8.4*0.3,8.4*0.2)
{}
;
\node
(h) at (9.4*0.3,9.7*0.2)
{}
;
\fill
[black] (a) circle(1pt);
\fill
[black] (b) circle(1pt);
\fill
[black] (c) circle(1pt);
\fill
[black] (d) circle(1pt);
\fill
[black] (e) circle(1pt);
\fill
[black] (f) circle(1pt);
\fill
[black] (g) circle(1pt);
\fill
[black] (h) circle(1pt);
%0-a
\draw
[thick,red] (0.2*0.3,4*0.2) to [bend left] (1*0.3,6*0.2) ;
% a-b
\draw
[thick,red] (1*0.3,6*0.2) to [bend left] (2*0.3,3*0.2) ;
% b-c
\draw
[thick,red] (2*0.3,3*0.2) to [bend right] (3*0.3,2.5*0.2) ;
% c-d
\draw
[thick,red] (3*0.3,2.5*0.2) to [bend left] (3.5*0.3,4*0.2) ;
\draw
[thick,red] (3.5*0.3,4*0.2) to [bend left] (4.3*0.3,2*0.2) ;
\draw
[thick,red] (4.3*0.3,2*0.2) to [bend right] (5*0.3,1.5*0.2) ;
% d-e
\draw
[thick,red] (5*0.3,1.5*0.2) to [bend right] (6.2*0.3,7*0.2) ;
\draw
[thick,red] (6.2*0.3,7*0.2) to [bend right] (6.5*0.3,7*0.2) ;
% e-f
\draw
[thick,red] (6.5*0.3,7*0.2) to [bend left] (7*0.3,5*0.2) ;
\draw
[thick,red] (7*0.3,5*0.2) to [bend right] (7.5*0.3,4*0.2) ;
\draw
[thick,red] (7.5*0.3,4*0.2) to [bend right] (8*0.3,4*0.2) ;
%
% f-g
\draw
[thick,red] (8*0.3,4*0.2) to [bend right] (8*0.3,10*0.2) ;
\draw
[thick,red] (8*0.3,10*0.2) to [bend left] (8.7*0.3,10*0.2) ;
% g-h
\draw
[thick,red] (8.7*0.3,10*0.2) to [bend left] (9.7*0.3,9.4*0.2) ;
\node
[font=
\footnotesize
] at (1.5,-0.5)
{
过拟合
}
;
\end{tikzpicture}
\\
\end{tabular}
\ No newline at end of file
Chapter13/chapter13.tex
查看文件 @
d0d33685
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论