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
6c626a4f
Commit
6c626a4f
authored
Nov 06, 2020
by
孟霞
Browse files
Options
Browse Files
Download
Plain Diff
合并分支 'mengxia' 到 'caorunzhe'
Mengxia 查看合并请求
!350
parents
6b28ef41
d8b052bd
显示空白字符变更
内嵌
并排
正在显示
25 个修改的文件
包含
148 行增加
和
138 行删除
+148
-138
Chapter9/Figures/figure-4-gram.tex
+8
-8
Chapter9/Figures/figure-absolute-loss.tex
+3
-3
Chapter9/Figures/figure-back-propagation-hid.tex
+8
-8
Chapter9/Figures/figure-back-propagation-output1.tex
+4
-4
Chapter9/Figures/figure-back-propagation-output2.tex
+5
-5
Chapter9/Figures/figure-broadcast.tex
+5
-5
Chapter9/Figures/figure-compare.tex
+23
-0
Chapter9/Figures/figure-corresponence-between-matrix-element-and-output.tex
+1
-1
Chapter9/Figures/figure-deep-learning.jpg
+0
-0
Chapter9/Figures/figure-embedding-matrix.tex
+6
-6
Chapter9/Figures/figure-feature-engineering.jpg
+0
-0
Chapter9/Figures/figure-fit.tex
+2
-2
Chapter9/Figures/figure-forward-propagation-hid.tex
+5
-5
Chapter9/Figures/figure-forward-propagation-output.tex
+5
-5
Chapter9/Figures/figure-four-layers-of-neural-network.tex
+3
-3
Chapter9/Figures/figure-parallel.tex
+37
-37
Chapter9/Figures/figure-residual-structure.tex
+4
-4
Chapter9/Figures/figure-rnn-lm.tex
+8
-8
Chapter9/Figures/figure-single-layer-of-neural-network-for-weather-prediction.tex
+3
-3
Chapter9/Figures/figure-tensor-mul.tex
+3
-3
Chapter9/Figures/figure-translation.tex
+2
-2
Chapter9/Figures/figure-two-layer-neural-network.tex
+1
-1
Chapter9/Figures/figure-weather-forward.tex
+5
-5
Chapter9/Figures/figure-weather.tex
+1
-1
Chapter9/chapter9.tex
+6
-19
没有找到文件。
Chapter9/Figures/figure-4-gram.tex
查看文件 @
6c626a4f
%%%------------------------------------------------------------------------------------------------------------
%%%------------------------------------------------------------------------------------------------------------
\begin{tikzpicture}
\begin{tikzpicture}
\begin{scope}
\begin{scope}
\node
[anchor=west] (w0) at (0,0)
{
\small
{${
\
bm
o
}_{
i
-
3
}$}}
;
\node
[anchor=west] (w0) at (0,0)
{
\small
{${
\
mathbi
{
o
}
}_{
i
-
3
}$}}
;
\node
[anchor=west] (w1) at ([xshift=2.8em]w0.east)
{
\small
{${
\
bm
o
}_{
i
-
2
}$}}
;
\node
[anchor=west] (w1) at ([xshift=2.8em]w0.east)
{
\small
{${
\
mathbi
{
o
}
}_{
i
-
2
}$}}
;
\node
[anchor=west] (w2) at ([xshift=2.8em]w1.east)
{
\small
{${
\
bm
o
}_{
i
-
1
}$}}
;
\node
[anchor=west] (w2) at ([xshift=2.8em]w1.east)
{
\small
{${
\
mathbi
{
o
}
}_{
i
-
1
}$}}
;
\node
[anchor=north] (index0) at ([yshift=0.5em]w0.south)
{
\footnotesize
(index)
}
;
\node
[anchor=north] (index0) at ([yshift=0.5em]w0.south)
{
\footnotesize
(index)
}
;
\node
[anchor=north] (index1) at ([yshift=0.5em]w1.south)
{
\footnotesize
(index)
}
;
\node
[anchor=north] (index1) at ([yshift=0.5em]w1.south)
{
\footnotesize
(index)
}
;
\node
[anchor=north] (index2) at ([yshift=0.5em]w2.south)
{
\footnotesize
(index)
}
;
\node
[anchor=north] (index2) at ([yshift=0.5em]w2.south)
{
\footnotesize
(index)
}
;
\node
[anchor=south,draw,inner sep=3pt,fill=blue!20!white] (e0) at ([yshift=1em]w0.north)
{
\footnotesize
{${
\
bm
e
}_
1
=
{
\bm
o
}_{
i
-
3
}
{
\bm
C
}$}}
;
\node
[anchor=south,draw,inner sep=3pt,fill=blue!20!white] (e0) at ([yshift=1em]w0.north)
{
\footnotesize
{${
\
mathbi
{
e
}}_
1
=
{
\mathbi
{
o
}}_{
i
-
3
}
{
\mathbi
{
C
}
}$}}
;
\node
[anchor=south,draw,inner sep=3pt,fill=blue!20!white] (e1) at ([yshift=1em]w1.north)
{
\footnotesize
{${
\
bm
e
}_
2
=
{
\bm
o
}_{
i
-
2
}
{
\bm
C
}$}}
;
\node
[anchor=south,draw,inner sep=3pt,fill=blue!20!white] (e1) at ([yshift=1em]w1.north)
{
\footnotesize
{${
\
mathbi
{
e
}}_
2
=
{
\mathbi
{
o
}}_{
i
-
2
}
{
\mathbi
{
C
}
}$}}
;
\node
[anchor=south,draw,inner sep=3pt,fill=blue!20!white] (e2) at ([yshift=1em]w2.north)
{
\footnotesize
{${
\
bm
e
}_
3
=
{
\bm
o
}_{
i
-
1
}
{
\bm
C
}$}}
;
\node
[anchor=south,draw,inner sep=3pt,fill=blue!20!white] (e2) at ([yshift=1em]w2.north)
{
\footnotesize
{${
\
mathbi
{
e
}}_
3
=
{
\mathbi
{
o
}}_{
i
-
1
}
{
\mathbi
{
C
}
}$}}
;
\node
[anchor=south,draw,minimum width=11em,inner sep=3pt,fill=orange!20!white] (h0) at ([yshift=1.5em]e1.north)
{
\footnotesize
{${
\
bm
h
}_
0
=
\textrm
{
Tanh
}
([
{
\bm
e
}_
1
,
{
\bm
e
}_
2
,
{
\bm
e
}_
3
]
{
\bm
H
}
+
{
\bm
d
}
)
$}}
;
\node
[anchor=south,draw,minimum width=11em,inner sep=3pt,fill=orange!20!white] (h0) at ([yshift=1.5em]e1.north)
{
\footnotesize
{${
\
mathbi
{
h
}}_
0
=
\textrm
{
Tanh
}
([
{
\mathbi
{
e
}}_
1
,
{
\mathbi
{
e
}}_
2
,
{
\mathbi
{
e
}}_
3
]
{
\mathbi
{
H
}}
+
{
\mathbi
{
d
}
}
)
$}}
;
\node
[anchor=south,draw,minimum width=9em,inner sep=3pt,fill=orange!20!white] (h1) at ([yshift=1.5em]h0.north)
{
\footnotesize
{${
\
bm
y
}
=
\textrm
{
Softmax
}
(
{
\bm
h
}_
0
{
\bm
U
}
)
$}}
;
\node
[anchor=south,draw,minimum width=9em,inner sep=3pt,fill=orange!20!white] (h1) at ([yshift=1.5em]h0.north)
{
\footnotesize
{${
\
mathbi
{
y
}}
=
\textrm
{
Softmax
}
(
{
\mathbi
{
h
}}_
0
{
\mathbi
{
U
}
}
)
$}}
;
\node
[anchor=south] (ylabel) at ([yshift=1em]h1.north)
{
\small
{$
\funp
{
P
}
(
w
_
i|w
_{
i
-
3
}
w
_{
i
-
2
}
w
_{
i
-
1
}
)
$}}
;
\node
[anchor=south] (ylabel) at ([yshift=1em]h1.north)
{
\small
{$
\funp
{
P
}
(
w
_
i|w
_{
i
-
3
}
w
_{
i
-
2
}
w
_{
i
-
1
}
)
$}}
;
\draw
[->,line width=1pt] ([yshift=0.1em]w0.north) -- ([yshift=-0.1em]e0.south);
\draw
[->,line width=1pt] ([yshift=0.1em]w0.north) -- ([yshift=-0.1em]e0.south);
...
...
Chapter9/Figures/figure-absolute-loss.tex
查看文件 @
6c626a4f
...
@@ -8,12 +8,12 @@
...
@@ -8,12 +8,12 @@
\draw
[->,thick]
(-6,0) -- (5,0);
\draw
[->,thick]
(-6,0) -- (5,0);
\draw
[->,thick]
(-5,-4) -- (-5,5);
\draw
[->,thick]
(-5,-4) -- (-5,5);
\draw
[<-] (-2.5,4) -- (-2,5) node [pos=1,right,inner sep=2pt]
{
\footnotesize
{
答案
$
\tilde
{
\
vectorn
{
\emph
{
y
}
}}_
i
$}}
;
\draw
[<-] (-2.5,4) -- (-2,5) node [pos=1,right,inner sep=2pt]
{
\footnotesize
{
答案
$
\tilde
{
\
mathbi
{
y
}}_
i
$}}
;
{
{
\draw
[<-] (-3,-3) -- (-2.5,-2) node [pos=0,left,inner sep=2pt]
{
\footnotesize
{
预测
${
\
vectorn
{
\emph
{
y
}
}}_
i
$}}
;
}
\draw
[<-] (-3,-3) -- (-2.5,-2) node [pos=0,left,inner sep=2pt]
{
\footnotesize
{
预测
${
\
mathbi
{
y
}}_
i
$}}
;
}
{
{
\draw
[<-] (2.3,1) -- (3.3,2) node [pos=1,right,inner sep=2pt]
{
\footnotesize
{
偏差
$
|
\tilde
{
\
vectorn
{
\emph
{
y
}}}_
i
-
{
\vectorn
{
\emph
{
y
}
}}_
i|
$}}
;
\draw
[<-] (2.3,1) -- (3.3,2) node [pos=1,right,inner sep=2pt]
{
\footnotesize
{
偏差
$
|
\tilde
{
\
mathbi
{
y
}}_
i
-
{
\mathbi
{
y
}}_
i|
$}}
;
\foreach
\x
in
{
-3.8,-3.7,...,3.0
}{
\foreach
\x
in
{
-3.8,-3.7,...,3.0
}{
\pgfmathsetmacro
{
\p
}{
- 1/14 * (
\x
+ 4) * (
\x
+ 1) * (
\x
- 1) * (
\x
- 3)
}
;
\pgfmathsetmacro
{
\p
}{
- 1/14 * (
\x
+ 4) * (
\x
+ 1) * (
\x
- 1) * (
\x
- 3)
}
;
\pgfmathsetmacro
{
\q
}{
- 1/14 * (4*
\x*\x*\x
+ 3*
\x*\x
- 26*
\x
- 1)
}
;
\pgfmathsetmacro
{
\q
}{
- 1/14 * (4*
\x*\x*\x
+ 3*
\x*\x
- 26*
\x
- 1)
}
;
...
...
Chapter9/Figures/figure-back-propagation-hid.tex
查看文件 @
6c626a4f
%%%------------------------------------------------------------------------------------------------------------
%%%------------------------------------------------------------------------------------------------------------
\begin{tikzpicture}
\begin{tikzpicture}
\begin{scope}
\begin{scope}
\node
[anchor=center,draw,fill=red!20,minimum height=1.8em,minimum width=2.5em] (h) at (0,0)
{${
\
bm
h
}^{
k
-
1
}$}
;
\node
[anchor=center,draw,fill=red!20,minimum height=1.8em,minimum width=2.5em] (h) at (0,0)
{${
\
mathbi
{
h
}
}^{
k
-
1
}$}
;
\node
[anchor=west,draw,fill=blue!20,minimum height=1.8em,minimum width=2.5em] (s) at ([xshift=6em]h.east)
{${
\
bm
s
}^{
k
}$}
;
\node
[anchor=west,draw,fill=blue!20,minimum height=1.8em,minimum width=2.5em] (s) at ([xshift=6em]h.east)
{${
\
mathbi
{
s
}
}^{
k
}$}
;
\node
[anchor=west,draw,fill=green!20,minimum height=1.8em,minimum width=2.5em] (h2) at ([xshift=6em]s.east)
{${
\
bm
h
}^{
k
}$}
;
\node
[anchor=west,draw,fill=green!20,minimum height=1.8em,minimum width=2.5em] (h2) at ([xshift=6em]s.east)
{${
\
mathbi
{
h
}
}^{
k
}$}
;
\node
[anchor=east] (prev) at ([xshift=-2em]h.west)
{
...
}
;
\node
[anchor=east] (prev) at ([xshift=-2em]h.west)
{
...
}
;
\node
[anchor=west] (next) at ([xshift=2em]h2.east)
{
...
}
;
\node
[anchor=west] (next) at ([xshift=2em]h2.east)
{
...
}
;
\draw
[->,thick] ([xshift=0.1em]prev.east) -- ([xshift=-0.1em]h.west);
\draw
[->,thick] ([xshift=0.1em]prev.east) -- ([xshift=-0.1em]h.west);
\draw
[->,thick] ([xshift=0.1em]h.east) -- ([xshift=-0.1em]s.west) node [pos=0.5,below]
{
\scriptsize
{${
\
bm
s
}^
k
=
{
\bm
h
}^{
k
-
1
}{
\bm
W
}^
k
$}}
;
\draw
[->,thick] ([xshift=0.1em]h.east) -- ([xshift=-0.1em]s.west) node [pos=0.5,below]
{
\scriptsize
{${
\
mathbi
{
s
}}^
k
=
{
\mathbi
{
h
}}^{
k
-
1
}{
\mathbi
{
W
}
}^
k
$}}
;
\draw
[->,thick] ([xshift=0.1em]s.east) -- ([xshift=-0.1em]h2.west) node [pos=0.5,below]
{
\scriptsize
{${
\
bm
h
}^
k
=
f
^
k
(
{
\bm
s
}^{
k
}
)
$}}
;
\draw
[->,thick] ([xshift=0.1em]s.east) -- ([xshift=-0.1em]h2.west) node [pos=0.5,below]
{
\scriptsize
{${
\
mathbi
{
h
}}^
k
=
f
^
k
(
{
\mathbi
{
s
}
}^{
k
}
)
$}}
;
\draw
[->,thick] ([xshift=0.1em]h2.east) -- ([xshift=-0.1em]next.west);
\draw
[->,thick] ([xshift=0.1em]h2.east) -- ([xshift=-0.1em]next.west);
{
{
...
@@ -29,15 +29,15 @@
...
@@ -29,15 +29,15 @@
}
}
{
{
\node
[anchor=south] (h2label) at (h2.north)
{$
\frac
{
\partial
L
}{
\partial
{
\
bm
h
}^{
k
}}$}
;
\node
[anchor=south] (h2label) at (h2.north)
{$
\frac
{
\partial
L
}{
\partial
{
\
mathbi
{
h
}
}^{
k
}}$}
;
}
}
{
{
\node
[anchor=south] (slabel) at (s.north)
{$
\frac
{
\partial
L
}{
\partial
{
\
bm
s
}^{
k
}}$}
;
\node
[anchor=south] (slabel) at (s.north)
{$
\frac
{
\partial
L
}{
\partial
{
\
mathbi
{
s
}
}^{
k
}}$}
;
}
}
{
{
\node
[anchor=south] (hlabel) at (h.north)
{$
\frac
{
\partial
L
}{
\partial
{
\
bm
h
}^{
k
-
1
}}$
,
$
\frac
{
\partial
L
}{
\partial
{
\bm
W
}^{
k
}}$}
;
\node
[anchor=south] (hlabel) at (h.north)
{$
\frac
{
\partial
L
}{
\partial
{
\
mathbi
{
h
}}^{
k
-
1
}}$
,
$
\frac
{
\partial
L
}{
\partial
{
\mathbi
{
W
}
}^{
k
}}$}
;
}
}
\end{scope}
\end{scope}
...
...
Chapter9/Figures/figure-back-propagation-output1.tex
查看文件 @
6c626a4f
%%%------------------------------------------------------------------------------------------------------------
%%%------------------------------------------------------------------------------------------------------------
\begin{tikzpicture}
\begin{tikzpicture}
\begin{scope}
\begin{scope}
\node
[anchor=west,minimum height=1.7em,fill=blue!20,draw] (s) at (0,0)
{$
{
\bm
s
}^{
K
}$}
;
\node
[anchor=west,minimum height=1.7em,fill=blue!20,draw] (s) at (0,0)
{$
\mathbi
{
s
}^{
K
}$}
;
\node
[anchor=west,minimum height=1.7em,fill=green!20,draw] (h2) at ([xshift=5.5em]s.east)
{$
{
\bm
h
}^{
K
}$}
;
\node
[anchor=west,minimum height=1.7em,fill=green!20,draw] (h2) at ([xshift=5.5em]s.east)
{$
\mathbi
{
h
}^{
K
}$}
;
\node
[anchor=west,minimum height=1.7em,fill=orange!20,draw] (l) at ([xshift=5.5em]h2.east)
{$
L
$}
;
\node
[anchor=west,minimum height=1.7em,fill=orange!20,draw] (l) at ([xshift=5.5em]h2.east)
{$
L
$}
;
\draw
[->] (s.east) -- (h2.west);
\draw
[->] (s.east) -- (h2.west);
\draw
[->] (h2.east) -- (l.west);
\draw
[->] (h2.east) -- (l.west);
\draw
[->,very thick,red] ([yshift=1em,xshift=-0.1em]l.north) -- ([yshift=1em,xshift=0.1em]h2.north) node [pos=0.5,above]
{
\scriptsize
{
求梯度
{$
\frac
{
\partial
L
}{
\partial
{
\
bm
h
}^
K
}
=
?
$}}}
;
\draw
[->,very thick,red] ([yshift=1em,xshift=-0.1em]l.north) -- ([yshift=1em,xshift=0.1em]h2.north) node [pos=0.5,above]
{
\scriptsize
{
求梯度
{$
\frac
{
\partial
L
}{
\partial
{
\
mathbi
{
h
}
}^
K
}
=
?
$}}}
;
\draw
[->,very thick,red] ([yshift=1em,xshift=-0.1em]h2.north) -- ([yshift=1em,xshift=0.1em]s.north) node [pos=0.5,above]
{
\scriptsize
{
求梯度
{$
\frac
{
\partial
f
^
K
(
{
\
bm
s
}^
K
)
}{
\partial
{
\bm
s
}^
K
}
=
?
$}}}
;
\draw
[->,very thick,red] ([yshift=1em,xshift=-0.1em]h2.north) -- ([yshift=1em,xshift=0.1em]s.north) node [pos=0.5,above]
{
\scriptsize
{
求梯度
{$
\frac
{
\partial
f
^
K
(
{
\
mathbi
{
s
}}^
K
)
}{
\partial
{
\mathbi
{
s
}
}^
K
}
=
?
$}}}
;
\draw
[-,very thick,red] ([yshift=0.5em]l.north) -- ([yshift=1.5em]l.north);
\draw
[-,very thick,red] ([yshift=0.5em]l.north) -- ([yshift=1.5em]l.north);
\draw
[-,very thick,red] ([yshift=0.5em]h2.north) -- ([yshift=1.5em]h2.north);
\draw
[-,very thick,red] ([yshift=0.5em]h2.north) -- ([yshift=1.5em]h2.north);
\draw
[-,very thick,red] ([yshift=0.5em]s.north) -- ([yshift=1.5em]s.north);
\draw
[-,very thick,red] ([yshift=0.5em]s.north) -- ([yshift=1.5em]s.north);
...
...
Chapter9/Figures/figure-back-propagation-output2.tex
查看文件 @
6c626a4f
%%%------------------------------------------------------------------------------------------------------------
%%%------------------------------------------------------------------------------------------------------------
\begin{tikzpicture}
\begin{tikzpicture}
\begin{scope}
\begin{scope}
\node
[anchor=center,minimum height=1.7em,fill=yellow!20,draw] (h) at (0,0)
{${
\
bm
h
}^{
K
-
1
}$}
;
\node
[anchor=center,minimum height=1.7em,fill=yellow!20,draw] (h) at (0,0)
{${
\
mathbi
{
h
}
}^{
K
-
1
}$}
;
\node
[anchor=west,minimum height=1.7em,fill=blue!20,draw] (s) at ([xshift=6.0em]h.east)
{${
\
bm
s
}^{
K
}$}
;
\node
[anchor=west,minimum height=1.7em,fill=blue!20,draw] (s) at ([xshift=6.0em]h.east)
{${
\
mathbi
{
s
}
}^{
K
}$}
;
\draw
[->] (h.east) -- (s.west);
\draw
[->] (h.east) -- (s.west);
\node
[anchor=south west,inner sep=2pt] (step100) at ([xshift=0.5em,yshift=-0.8em]h.north east)
{
\scriptsize
{${
\
bm
s
}^
K
=
{
\bm
h
}^{
K
-
1
}
{
\bm
W
}^
K
$}}
;
\node
[anchor=south west,inner sep=2pt] (step100) at ([xshift=0.5em,yshift=-0.8em]h.north east)
{
\scriptsize
{${
\
mathbi
{
s
}}^
K
=
{
\mathbi
{
h
}}^{
K
-
1
}
{
\mathbi
{
W
}
}^
K
$}}
;
\node
[anchor=south west] (slabel) at ([yshift=1em,xshift=0.3em]s.north)
{
\scriptsize
{
\textbf
{{
已经得到:
${
\bm
\pi
}^
K
=
\frac
{
\partial
L
}{
\partial
{
\
bm
s
}^
K
}$}}}}
;
\node
[anchor=south west] (slabel) at ([yshift=1em,xshift=0.3em]s.north)
{
\scriptsize
{
\textbf
{{
已经得到:
${
\bm
\pi
}^
K
=
\frac
{
\partial
L
}{
\partial
{
\
mathbi
{
s
}
}^
K
}$}}}}
;
\draw
[->] ([yshift=0.3em]slabel.south) .. controls +(south:0.5) and +(north:0.5) .. ([xshift=0.5em,yshift=0.1em]s.north);
\draw
[->] ([yshift=0.3em]slabel.south) .. controls +(south:0.5) and +(north:0.5) .. ([xshift=0.5em,yshift=0.1em]s.north);
{
{
\draw
[->,very thick,red] ([yshift=1em,xshift=-0.1em]s.north) -- ([yshift=1.0em,xshift=0.1em]h.north) node [pos=0.5,above]
{
\scriptsize
{{$
\frac
{
\partial
L
}{
\partial
{
\
bm
W
}^
K
}
=
?
$
,
$
\frac
{
\partial
L
}{
\partial
{
\bm
h
}^{
K
-
1
}}
=
?
$}}}
;
\draw
[->,very thick,red] ([yshift=1em,xshift=-0.1em]s.north) -- ([yshift=1.0em,xshift=0.1em]h.north) node [pos=0.5,above]
{
\scriptsize
{{$
\frac
{
\partial
L
}{
\partial
{
\
mathbi
{
W
}}^
K
}
=
?
$
,
$
\frac
{
\partial
L
}{
\partial
{
\mathbi
{
h
}
}^{
K
-
1
}}
=
?
$}}}
;
\draw
[-,very thick,red] ([yshift=0.5em]h.north) -- ([yshift=1.5em]h.north);
\draw
[-,very thick,red] ([yshift=0.5em]h.north) -- ([yshift=1.5em]h.north);
\draw
[-,very thick,red] ([yshift=0.5em]s.north) -- ([yshift=1.5em]s.north);
\draw
[-,very thick,red] ([yshift=0.5em]s.north) -- ([yshift=1.5em]s.north);
}
}
...
...
Chapter9/Figures/figure-broadcast.tex
查看文件 @
6c626a4f
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
\node
[fill=orange!20,inner sep=0pt,minimum height=0.49cm,minimum width=0.49cm] at (
\x
,
\y
)
{$
\number\value
{
mycount
1
}$}
;
\node
[fill=orange!20,inner sep=0pt,minimum height=0.49cm,minimum width=0.49cm] at (
\x
,
\y
)
{$
\number\value
{
mycount
1
}$}
;
\addtocounter
{
mycount1
}{
1
}
;
\addtocounter
{
mycount1
}{
1
}
;
}
}
\node
[anchor=south] (varlabel) at (0,0.6)
{$
\
vectorn
{
\emph
{
s
}
}$}
;
\node
[anchor=south] (varlabel) at (0,0.6)
{$
\
mathbi
{
s
}$}
;
\node
[anchor=north] (labelc) at (0,-0.7)
{
\footnotesize
{
(a)
}}
;
\node
[anchor=north] (labelc) at (0,-0.7)
{
\footnotesize
{
(a)
}}
;
\end{scope}
\end{scope}
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
\node
[fill=green!20,inner sep=0pt,minimum height=0.48cm,minimum width=0.48cm] at (
\x
,
\y
)
{$
1
$}
;
\node
[fill=green!20,inner sep=0pt,minimum height=0.48cm,minimum width=0.48cm] at (
\x
,
\y
)
{$
1
$}
;
\addtocounter
{
mycount1
}{
1
}
;
\addtocounter
{
mycount1
}{
1
}
;
}
}
\node
[anchor=south] (varlabel) at (0,0.1)
{$
\
vectorn
{
\emph
{
b
}
}$}
;
\node
[anchor=south] (varlabel) at (0,0.1)
{$
\
mathbi
{
b
}$}
;
\node
[anchor=north] (labelc) at (0,-0.7)
{
\footnotesize
{
(b)
}}
;
\node
[anchor=north] (labelc) at (0,-0.7)
{
\footnotesize
{
(b)
}}
;
\end{scope}
\end{scope}
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
\node
[fill=orange!20,inner sep=0pt,minimum height=0.49cm,minimum width=0.49cm] at (
\x
,
\y
)
{$
\number\value
{
mycount
1
}$}
;
\node
[fill=orange!20,inner sep=0pt,minimum height=0.49cm,minimum width=0.49cm] at (
\x
,
\y
)
{$
\number\value
{
mycount
1
}$}
;
\addtocounter
{
mycount1
}{
1
}
;
\addtocounter
{
mycount1
}{
1
}
;
}
}
\node
[anchor=south] (varlabel) at (0,0.6)
{$
\
vectorn
{
\emph
{
s
}
}$}
;
\node
[anchor=south] (varlabel) at (0,0.6)
{$
\
mathbi
{
s
}$}
;
\end{scope}
\end{scope}
\begin{scope}
[yshift=-1in,xshift=1.5in]
\begin{scope}
[yshift=-1in,xshift=1.5in]
\setcounter
{
mycount1
}{
1
}
\setcounter
{
mycount1
}{
1
}
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
\addtocounter
{
mycount1
}{
1
}
;
\addtocounter
{
mycount1
}{
1
}
;
}
}
\node
[anchor=center] (plabel) at (-4.5em,0)
{
\huge
{$
\mathbf
{
+
}$}}
;
\node
[anchor=center] (plabel) at (-4.5em,0)
{
\huge
{$
\mathbf
{
+
}$}}
;
\node
[anchor=south] (varlabel) at (0,0.6)
{$
\
vectorn
{
\emph
{
b
}
}$}
;
\node
[anchor=south] (varlabel) at (0,0.6)
{$
\
mathbi
{
b
}$}
;
\node
[anchor=north] (labelc) at (0,-0.7)
{
\footnotesize
{
(c)
}}
;
\node
[anchor=north] (labelc) at (0,-0.7)
{
\footnotesize
{
(c)
}}
;
\end{scope}
\end{scope}
\begin{scope}
[yshift=-1in,xshift=3in]
\begin{scope}
[yshift=-1in,xshift=3in]
...
@@ -62,7 +62,7 @@
...
@@ -62,7 +62,7 @@
\addtocounter
{
mycount1
}{
1
}
;
\addtocounter
{
mycount1
}{
1
}
;
}
}
\node
[anchor=center] (plabel) at (-4.5em,0)
{
\huge
{$
\mathbf
{
=
}$}}
;
\node
[anchor=center] (plabel) at (-4.5em,0)
{
\huge
{$
\mathbf
{
=
}$}}
;
\node
[anchor=south] (varlabel) at (0,0.6)
{$
{
\vectorn
{
\emph
{
s
}}}
+
\vectorn
{
\emph
{
b
}
}$}
;
\node
[anchor=south] (varlabel) at (0,0.6)
{$
\mathbi
{
s
}
+
\mathbi
{
b
}$}
;
\end{scope}
\end{scope}
...
...
Chapter9/Figures/figure-compare.tex
0 → 100644
查看文件 @
6c626a4f
%%%------------------------------------------------------------------------------------------------------------
\begin{tikzpicture}
{
\begin{scope}
\node
[] (part1label) at (0,0)
{
\includegraphics
[scale=0.22]
{
./Chapter9/Figures/figure-feature-engineering.jpg
}}
;
\node
[anchor=north,minimum width=2.0em,minimum height=1.5em] (label11) at ([xshift=0.3em,yshift=2em]part1label.north)
{
\large
{
特征工程+机器学习
}}
;
\node
[anchor=north,minimum width=2.0em,minimum height=1.5em] (label12) at ([xshift=-11em,yshift=-6.3em]part1label.north)
{
\normalsize
{
输入
}}
;
\node
[anchor=north,minimum width=2.0em,minimum height=1.5em] (label13) at ([xshift=-1em,yshift=-6.3em]part1label.north)
{
\normalsize
{
特征提取
}}
;
\node
[anchor=north,minimum width=2.0em,minimum height=1.5em] (label14) at ([xshift=6.9em,yshift=-6.3em]part1label.north)
{
\normalsize
{
分类
}}
;
\node
[anchor=north,minimum width=2.0em,minimum height=1.5em] (label15) at ([xshift=14.2em,yshift=-6.3em]part1label.north)
{
\normalsize
{
输出
}}
;
\end{scope}
}
{
\begin{scope}
[yshift=-1.5in]
\node
[] (part1label2) at (0,0)
{
\includegraphics
[scale=0.22]
{
./Chapter9/Figures/figure-deep-learning.jpg
}}
;
\node
[anchor=north,minimum width=2.0em,minimum height=1.5em] (label21) at ([xshift=0.2em,yshift=1.2em]part1label2.north)
{
\large
{
深度学习(端到端学习)
}}
;
\node
[anchor=north,minimum width=2.0em,minimum height=1.5em] (label22) at ([xshift=-11em,yshift=-6em]part1label2.north)
{
\normalsize
{
输入
}}
;
\node
[anchor=north,minimum width=2.0em,minimum height=1.5em] (label23) at ([xshift=3.0em,yshift=-6em]part1label2.north)
{
\normalsize
{
特征提取+分类
}}
;
\node
[anchor=north,minimum width=2.0em,minimum height=1.5em] (label24) at ([xshift=14.2em,yshift=-6em]part1label2.north)
{
\normalsize
{
输出
}}
;
\end{scope}
}
\end{tikzpicture}
%%%------------------------------------------------------------------------------------------------------------
Chapter9/Figures/figure-corresponence-between-matrix-element-and-output.tex
查看文件 @
6c626a4f
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
\node
[anchor=east] (x0) at ([xshift=-6em]neuron00.west)
{$
x
_
1
$}
;
\node
[anchor=east] (x0) at ([xshift=-6em]neuron00.west)
{$
x
_
1
$}
;
\node
[anchor=east] (x1) at ([xshift=-6em]neuron01.west)
{$
x
_
2
$}
;
\node
[anchor=east] (x1) at ([xshift=-6em]neuron01.west)
{$
x
_
2
$}
;
\node
[anchor=east] (x2) at ([xshift=-6em]neuron02.west)
{$
{
\vectorn
{
\emph
{
b
}}
}$}
;
\node
[anchor=east] (x2) at ([xshift=-6em]neuron02.west)
{$
\mathbi
{
b
}$}
;
\node
[anchor=west] (y0) at ([xshift=4em]neuron00.east)
{$
y
_
1
$
:
\scriptsize
{
温度
}}
;
\node
[anchor=west] (y0) at ([xshift=4em]neuron00.east)
{$
y
_
1
$
:
\scriptsize
{
温度
}}
;
...
...
Chapter9/Figures/figure-deep-learning.jpg
查看文件 @
6c626a4f
130 KB
|
W:
|
H:
92.1 KB
|
W:
|
H:
2-up
Swipe
Onion skin
Chapter9/Figures/figure-embedding-matrix.tex
查看文件 @
6c626a4f
%%%------------------------------------------------------------------------------------------------------------
%%%------------------------------------------------------------------------------------------------------------
\begin{tikzpicture}
\begin{tikzpicture}
\begin{scope}
\begin{scope}
\node
[anchor=center,inner sep=2pt] (e) at (0,0)
{
\small
{$
\
vectorn
{
\emph
{
e
}}
=
\vectorn
{
\emph
{
o
}
}$}}
;
\node
[anchor=center,inner sep=2pt] (e) at (0,0)
{
\small
{$
\
mathbi
{
e
}
=
\mathbi
{
o
}$}}
;
\node
[anchor=west,inner sep=2pt] (c) at (e.east)
{
\small
{$
\
vectorn
{
\emph
{
C
}
}$}}
;
\node
[anchor=west,inner sep=2pt] (c) at (e.east)
{
\small
{$
\
mathbi
{
C
}$}}
;
\begin{pgfonlayer}
{
background
}
\begin{pgfonlayer}
{
background
}
\node
[rectangle,inner sep=0.4em,draw,fill=blue!20!white] [fit = (e) (c)] (box)
{}
;
\node
[rectangle,inner sep=0.4em,draw,fill=blue!20!white] [fit = (e) (c)] (box)
{}
;
\end{pgfonlayer}
\end{pgfonlayer}
\draw
[->,thick] ([yshift=-1em]box.south)--([yshift=-0.1em]box.south) node [pos=0,below] (bottom1)
{
\small
{
单词
$
w
$
的one-hot表示
}}
;
\draw
[->,thick] ([yshift=-1em]box.south)--([yshift=-0.1em]box.south) node [pos=0,below] (bottom1)
{
\small
{
单词
$
w
$
的one-hot表示
}}
;
\draw
[->,thick] ([yshift=0.1em]box.north)--([yshift=1em]box.north) node [pos=1,above] (top1)
{
\scriptsize
{$
\
vectorn
{
\emph
{
e
}
}$
=(8,.2,-1,.9,...,1)
}}
;
\draw
[->,thick] ([yshift=0.1em]box.north)--([yshift=1em]box.north) node [pos=1,above] (top1)
{
\scriptsize
{$
\
mathbi
{
e
}$
=(8,.2,-1,.9,...,1)
}}
;
\node
[anchor=north] (bottom2) at ([yshift=0.3em]bottom1.south)
{
\scriptsize
{$
\
vectorn
{
\emph
{
o
}
}$
=(0,0,1,0,...,0)
}}
;
\node
[anchor=north] (bottom2) at ([yshift=0.3em]bottom1.south)
{
\scriptsize
{$
\
mathbi
{
o
}$
=(0,0,1,0,...,0)
}}
;
\node
[anchor=south] (top2) at ([yshift=-0.3em]top1.north)
{
\small
{
单词
$
w
$
的分布式表示
}}
;
\node
[anchor=south] (top2) at ([yshift=-0.3em]top1.north)
{
\small
{
单词
$
w
$
的分布式表示
}}
;
{
{
\node
[anchor=north west,fill=red!20!white] (cmatrix) at ([xshift=3em,yshift=1.0em]c.north east)
{
\scriptsize
{$
\begin
{
pmatrix
}
1
&
.
2
&
-
.
2
&
8
&
...
&
0
\\
.
6
&
.
8
&
-
2
&
1
&
...
&
-
.
2
\\
8
&
.
2
&
-
1
&
.
9
&
...
&
2
.
3
\\
1
&
1
.
2
&
-
.
9
&
3
&
...
&
.
2
\\
...
&
...
&
...
&
...
&
...
&
...
\\
1
&
.
3
&
3
&
.
9
&
...
&
5
.
1
\end
{
pmatrix
}$}}
;
\node
[anchor=north west,fill=red!20!white] (cmatrix) at ([xshift=3em,yshift=1.0em]c.north east)
{
\scriptsize
{$
\begin
{
pmatrix
}
1
&
.
2
&
-
.
2
&
8
&
...
&
0
\\
.
6
&
.
8
&
-
2
&
1
&
...
&
-
.
2
\\
8
&
.
2
&
-
1
&
.
9
&
...
&
2
.
3
\\
1
&
1
.
2
&
-
.
9
&
3
&
...
&
.
2
\\
...
&
...
&
...
&
...
&
...
&
...
\\
1
&
.
3
&
3
&
.
9
&
...
&
5
.
1
\end
{
pmatrix
}$}}
;
\node
[anchor=west,inner sep=2pt,fill=red!30!white] (c) at (e.east)
{
\small
{$
\
vectorn
{
\emph
{
C
}
}$}}
;
\node
[anchor=west,inner sep=2pt,fill=red!30!white] (c) at (e.east)
{
\small
{$
\
mathbi
{
C
}$}}
;
\draw
[<-,thick] (c.east) -- ([xshift=3em]c.east);
\draw
[<-,thick] (c.east) -- ([xshift=3em]c.east);
}
}
{
{
\node
[anchor=south,draw,fill=green!20!white] (e2) at ([yshift=1.5em]cmatrix.north)
{
\scriptsize
{
外部词嵌入系统得到的
$
\
vectorn
{
\emph
{
C
}
}$}}
;
\node
[anchor=south,draw,fill=green!20!white] (e2) at ([yshift=1.5em]cmatrix.north)
{
\scriptsize
{
外部词嵌入系统得到的
$
\
mathbi
{
C
}$}}
;
\draw
[->,very thick,dashed] (e2.south) -- (cmatrix.north);
\draw
[->,very thick,dashed] (e2.south) -- (cmatrix.north);
}
}
...
...
Chapter9/Figures/figure-feature-engineering.jpg
查看文件 @
6c626a4f
132 KB
|
W:
|
H:
93.1 KB
|
W:
|
H:
2-up
Swipe
Onion skin
Chapter9/Figures/figure-fit.tex
查看文件 @
6c626a4f
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
\draw
[-,ublue] (n11.west) -- (n11.east);
\draw
[-,ublue] (n11.west) -- (n11.east);
\node
[anchor=north] (x1) at ([yshift=-6em]n11.south)
{$
x
_
1
$}
;
\node
[anchor=north] (x1) at ([yshift=-6em]n11.south)
{$
x
_
1
$}
;
\node
[anchor=north] (labela) at ([xshift=3.5em,yshift=-0.5em]x1.south)
{
\footnotesize
{
(a) 拟合一小段函数
}}
;
\node
[anchor=north] (labela) at ([xshift=3.5em,yshift=-0.5em]x1.south)
{
\footnotesize
{
(a) 拟合一小段函数
}}
;
\node
[anchor=north] (b) at ([yshift=-6em]n10.south)
{$
\
vectorn
{
\emph
{
b
}
}$}
;
\node
[anchor=north] (b) at ([yshift=-6em]n10.south)
{$
\
mathbi
{
b
}$}
;
{
{
\draw
[->,thick,red] (b.north) -- ([yshift=-0.1em]n10.south);
\draw
[->,thick,red] (b.north) -- ([yshift=-0.1em]n10.south);
\draw
[->,thick,ugreen] (x1.north) -- ([yshift=-0.1em]n10.290);
\draw
[->,thick,ugreen] (x1.north) -- ([yshift=-0.1em]n10.290);
...
@@ -93,7 +93,7 @@
...
@@ -93,7 +93,7 @@
\draw
[-,ublue] (n11.west) -- (n11.east);
\draw
[-,ublue] (n11.west) -- (n11.east);
\node
[anchor=north] (x1) at ([yshift=-6em]n11.south)
{$
x
_
1
$}
;
\node
[anchor=north] (x1) at ([yshift=-6em]n11.south)
{$
x
_
1
$}
;
\node
[anchor=north] (labelb) at ([xshift=6em,yshift=-0.5em]x1.south)
{
\footnotesize
{
(b) 拟合更大一段函数
}}
;
\node
[anchor=north] (labelb) at ([xshift=6em,yshift=-0.5em]x1.south)
{
\footnotesize
{
(b) 拟合更大一段函数
}}
;
\node
[anchor=north] (b) at ([yshift=-6em]n10.south)
{$
\
vectorn
{
\emph
{
b
}
}$}
;
\node
[anchor=north] (b) at ([yshift=-6em]n10.south)
{$
\
mathbi
{
b
}$}
;
{
{
\draw
[->,thick,red] (b.north) -- ([yshift=-0.1em]n10.south);
\draw
[->,thick,red] (b.north) -- ([yshift=-0.1em]n10.south);
\draw
[->,thick,ugreen] (x1.north) -- ([yshift=-0.1em]n10.290);
\draw
[->,thick,ugreen] (x1.north) -- ([yshift=-0.1em]n10.290);
...
...
Chapter9/Figures/figure-forward-propagation-hid.tex
查看文件 @
6c626a4f
%%%------------------------------------------------------------------------------------------------------------
%%%------------------------------------------------------------------------------------------------------------
\begin{tikzpicture}
\begin{tikzpicture}
\begin{scope}
\begin{scope}
\node
[anchor=center,draw,fill=red!20,minimum height=1.8em,minimum width=2.5em] (h) at (0,0)
{${
\
vectorn
{
\emph
{
h
}
}}^{
k
-
1
}$}
;
\node
[anchor=center,draw,fill=red!20,minimum height=1.8em,minimum width=2.5em] (h) at (0,0)
{${
\
mathbi
{
h
}}^{
k
-
1
}$}
;
\node
[anchor=west,draw,fill=blue!20,minimum height=1.8em,minimum width=2.5em] (s) at ([xshift=6em]h.east)
{${
\
vectorn
{
\emph
{
s
}
}}^{
k
}$}
;
\node
[anchor=west,draw,fill=blue!20,minimum height=1.8em,minimum width=2.5em] (s) at ([xshift=6em]h.east)
{${
\
mathbi
{
s
}}^{
k
}$}
;
\node
[anchor=west,draw,fill=green!20,minimum height=1.8em,minimum width=2.5em] (h2) at ([xshift=6em]s.east)
{${
\
vectorn
{
\emph
{
h
}
}}^{
k
}$}
;
\node
[anchor=west,draw,fill=green!20,minimum height=1.8em,minimum width=2.5em] (h2) at ([xshift=6em]s.east)
{${
\
mathbi
{
h
}}^{
k
}$}
;
\node
[anchor=east] (prev) at ([xshift=-2em]h.west)
{
...
}
;
\node
[anchor=east] (prev) at ([xshift=-2em]h.west)
{
...
}
;
\node
[anchor=west] (next) at ([xshift=2em]h2.east)
{
...
}
;
\node
[anchor=west] (next) at ([xshift=2em]h2.east)
{
...
}
;
\draw
[->,thick] ([xshift=0.1em]prev.east) -- ([xshift=-0.1em]h.west);
\draw
[->,thick] ([xshift=0.1em]prev.east) -- ([xshift=-0.1em]h.west);
\draw
[->,thick] ([xshift=0.1em]h.east) -- ([xshift=-0.1em]s.west) node [pos=0.5,above]
{
\scriptsize
{${
\
vectorn
{
\emph
{
s
}}}^
k
=
{
\vectorn
{
\emph
{
h
}}}^{
k
-
1
}{
\vectorn
{
\emph
{
W
}
}}^
k
$}}
;
\draw
[->,thick] ([xshift=0.1em]h.east) -- ([xshift=-0.1em]s.west) node [pos=0.5,above]
{
\scriptsize
{${
\
mathbi
{
s
}}^
k
=
{
\mathbi
{
h
}}^{
k
-
1
}{
\mathbi
{
W
}}^
k
$}}
;
\draw
[->,thick] ([xshift=0.1em]s.east) -- ([xshift=-0.1em]h2.west) node [pos=0.5,above]
{
\scriptsize
{${
\
vectorn
{
\emph
{
h
}}}^
k
=
f
^
k
(
{
\vectorn
{
\emph
{
s
}
}}^{
k
}
)
$}}
;
\draw
[->,thick] ([xshift=0.1em]s.east) -- ([xshift=-0.1em]h2.west) node [pos=0.5,above]
{
\scriptsize
{${
\
mathbi
{
h
}}^
k
=
f
^
k
(
{
\mathbi
{
s
}}^{
k
}
)
$}}
;
\draw
[->,thick] ([xshift=0.1em]h2.east) -- ([xshift=-0.1em]next.west);
\draw
[->,thick] ([xshift=0.1em]h2.east) -- ([xshift=-0.1em]next.west);
...
...
Chapter9/Figures/figure-forward-propagation-output.tex
查看文件 @
6c626a4f
%%%------------------------------------------------------------------------------------------------------------
%%%------------------------------------------------------------------------------------------------------------
\begin{tikzpicture}
\begin{tikzpicture}
\begin{scope}
\begin{scope}
\node
[anchor=center,minimum height=1.7em,fill=yellow!20,draw] (h) at (0,0)
{$
{
\bm
h
}^{
K
-
1
}$}
;
\node
[anchor=center,minimum height=1.7em,fill=yellow!20,draw] (h) at (0,0)
{$
\mathbi
{
h
}^{
K
-
1
}$}
;
\node
[anchor=west,minimum height=1.7em,fill=blue!20,draw] (s) at ([xshift=5.5em]h.east)
{$
{
\bm
s
}^{
K
}$}
;
\node
[anchor=west,minimum height=1.7em,fill=blue!20,draw] (s) at ([xshift=5.5em]h.east)
{$
\mathbi
{
s
}^{
K
}$}
;
\node
[anchor=west,minimum height=1.7em,fill=green!20,draw] (h2) at ([xshift=5.5em]s.east)
{$
{
\bm
h
}^{
K
}$}
;
\node
[anchor=west,minimum height=1.7em,fill=green!20,draw] (h2) at ([xshift=5.5em]s.east)
{$
\mathbi
{
h
}^{
K
}$}
;
\node
[anchor=west,minimum height=1.7em,fill=orange!20,draw] (l) at ([xshift=5.5em]h2.east)
{$
L
$}
;
\node
[anchor=west,minimum height=1.7em,fill=orange!20,draw] (l) at ([xshift=5.5em]h2.east)
{$
L
$}
;
\draw
[->] (h.east) -- (s.west);
\draw
[->] (h.east) -- (s.west);
\draw
[->] (s.east) -- (h2.west);
\draw
[->] (s.east) -- (h2.west);
\draw
[->] (h2.east) -- (l.west) node [pos=0.5,above]
{
\tiny
{
损失
}}
;
\draw
[->] (h2.east) -- (l.west) node [pos=0.5,above]
{
\tiny
{
损失
}}
;
\node
[anchor=south west,inner sep=2pt] (step100) at ([xshift=0.2em,yshift=-0.8em]h.north east)
{
\tiny
{$
{
\bm
s
}^
K
=
{
\bm
h
}^{
K
-
1
}
{
\bm
W
}^
K
$}}
;
\node
[anchor=south west,inner sep=2pt] (step100) at ([xshift=0.2em,yshift=-0.8em]h.north east)
{
\tiny
{$
\mathbi
{
s
}^
K
=
\mathbi
{
h
}^{
K
-
1
}
\mathbi
{
W
}^
K
$}}
;
\node
[anchor=south west,inner sep=2pt] (step101) at ([xshift=1em]step100.north west)
{
\tiny
{
线性变换
}}
;
\node
[anchor=south west,inner sep=2pt] (step101) at ([xshift=1em]step100.north west)
{
\tiny
{
线性变换
}}
;
\node
[anchor=south west,inner sep=2pt] (step200) at ([xshift=0.5em,yshift=-0.8em]s.north east)
{
\tiny
{$
{
\bm
h
}^
K
=
f
^
K
(
{
\bm
s
}^
K
)
$}}
;
\node
[anchor=south west,inner sep=2pt] (step200) at ([xshift=0.5em,yshift=-0.8em]s.north east)
{
\tiny
{$
\mathbi
{
h
}^
K
=
f
^
K
(
\mathbi
{
s
}^
K
)
$}}
;
\node
[anchor=south west,inner sep=2pt] (step201) at ([xshift=1em]step200.north west)
{
\tiny
{
激活函数
}}
;
\node
[anchor=south west,inner sep=2pt] (step201) at ([xshift=1em]step200.north west)
{
\tiny
{
激活函数
}}
;
\node
[anchor=south,inner sep=1pt] (outputlabel) at ([yshift=0.0em]h2.north)
{
\tiny
{
\textbf
{
输出层
}}}
;
\node
[anchor=south,inner sep=1pt] (outputlabel) at ([yshift=0.0em]h2.north)
{
\tiny
{
\textbf
{
输出层
}}}
;
...
...
Chapter9/Figures/figure-four-layers-of-neural-network.tex
查看文件 @
6c626a4f
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
\node
[anchor=north] (x
\n
) at ([yshift=-2em]neuron0
\n
.south)
{$
x
_
\n
$}
;
\node
[anchor=north] (x
\n
) at ([yshift=-2em]neuron0
\n
.south)
{$
x
_
\n
$}
;
}
}
\node
[anchor=west] (w1label) at ([xshift=-0.5em,yshift=0.8em]x5.north east)
{${
\
vectorn
{
\emph
{
W
}
}}^{
[
1
]
}$}
;
\node
[anchor=west] (w1label) at ([xshift=-0.5em,yshift=0.8em]x5.north east)
{${
\
mathbi
{
W
}}^{
[
1
]
}$}
;
\begin{pgfonlayer}
{
background
}
\begin{pgfonlayer}
{
background
}
\node
[rectangle,inner sep=0.2em,fill=red!20] [fit = (neuron01) (neuron05)] (layer01)
{}
;
\node
[rectangle,inner sep=0.2em,fill=red!20] [fit = (neuron01) (neuron05)] (layer01)
{}
;
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
}
}
}
}
\node
[anchor=west] (w2label) at ([xshift=-2.5em,yshift=5.4em]x5.north east)
{${
\
vectorn
{
\emph
{
W
}
}}^{
[
2
]
}$}
;
\node
[anchor=west] (w2label) at ([xshift=-2.5em,yshift=5.4em]x5.north east)
{${
\
mathbi
{
W
}}^{
[
2
]
}$}
;
\begin{pgfonlayer}
{
background
}
\begin{pgfonlayer}
{
background
}
{
{
...
@@ -77,7 +77,7 @@
...
@@ -77,7 +77,7 @@
\draw
[<-,thick] ([yshift=1.1em]neuron2
\n
.north) -- (neuron2
\n
.north);
\draw
[<-,thick] ([yshift=1.1em]neuron2
\n
.north) -- (neuron2
\n
.north);
}
}
\node
[anchor=west] (w3label) at ([xshift=-2.5em,yshift=9.5em]x5.north east)
{${
\
vectorn
{
\emph
{
W
}
}}^{
[
3
]
}$}
;
\node
[anchor=west] (w3label) at ([xshift=-2.5em,yshift=9.5em]x5.north east)
{${
\
mathbi
{
W
}}^{
[
3
]
}$}
;
\begin{pgfonlayer}
{
background
}
\begin{pgfonlayer}
{
background
}
{
{
...
...
Chapter9/Figures/figure-parallel.tex
查看文件 @
6c626a4f
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
% parameter server + processor
% parameter server + processor
\begin{scope}
[]
\begin{scope}
[]
{
\
script
size
{
\
footnote
size
\tikzstyle
{
parametershard
}
= [draw,thick,minimum width=4em,align=left,rounded corners=2pt]
\tikzstyle
{
parametershard
}
= [draw,thick,minimum width=4em,align=left,rounded corners=2pt]
...
@@ -13,31 +13,31 @@
...
@@ -13,31 +13,31 @@
\node
[parametershard,anchor=west,fill=yellow!10]
(param1) at (0,0)
{${
\bm
\theta
}_
o
$}
;
\node
[parametershard,anchor=west,fill=yellow!10]
(param1) at (0,0)
{${
\bm
\theta
}_
o
$}
;
\node
(param2) at ([xshift=1em]param1.east)
{}
;
\node
(param2) at ([xshift=1em]param1.east)
{}
;
\node
[parametershard,anchor=west,fill=red!10]
(param3) at ([xshift=1em]param2.east)
{${
\bm
\theta
}_
h
$}
;
\node
[parametershard,anchor=west,fill=red!10]
(param3) at ([xshift=1em]param2.east)
{${
\bm
\theta
}_
h
$}
;
\node
[anchor=south,inner sep=1pt]
(serverlabel) at ([yshift=0.
2em]param2.north)
{
\footnotesize
{
\textbf
{
参数服务器
}
:
${
\bm
\theta
}_{
\textrm
{
new
}}
=
{
\bm
\theta
}
-
\alpha\cdot
\frac
{
\partial
J
}{
\partial
{
\bm
\theta
}}$}}
;
\node
[anchor=south,inner sep=1pt]
(serverlabel) at ([yshift=0.
8em]param2.north)
{
\small
{
\textbf
{
参数服务器
}
:
${
\bm
\theta
}_{
\textrm
{
new
}}
=
{
\bm
\theta
}
-
\alpha\cdot
\frac
{
\partial
J
}{
\partial
{
\bm
\theta
}}$}}
;
}
}
\begin{pgfonlayer}
{
background
}
\begin{pgfonlayer}
{
background
}
{
{
\node
[rectangle,draw,thick,inner sep=2pt,fill=gray!20]
[fit = (param1) (param2) (param3) (serverlabel)] (serverbox)
{}
;
\node
[rectangle,draw,thick,inner sep=2pt,fill=gray!20]
[fit = (param1) (param2) (param3) (serverlabel)
] (serverbox)
{}
;
}
}
\end{pgfonlayer}
\end{pgfonlayer}
\tikzstyle
{
processor
}
= [draw,thick,fill=orange!20,minimum width=4em,align=left,rounded corners=2pt]
\tikzstyle
{
processor
}
= [draw,thick,fill=orange!20,minimum width=4em,align=left,rounded corners=2pt]
{
{
\node
[processor,anchor=north,align=center] (processor2) at ([yshift=-1.2in]serverlabel.south)
{
\
scriptsize
{
处理器 2
}
\\\script
size
{
(G2)
}}
;
\node
[processor,anchor=north,align=center] (processor2) at ([yshift=-1.2in]serverlabel.south)
{
\
footnotesize
{
处理器 2
}
\\\footnote
size
{
(G2)
}}
;
\node
[anchor=north] (labela) at ([xshift=
4em,yshift=-1em]processor2.south)
{
\footnotesize
{
(a)同步更新
}}
;
\node
[anchor=north] (labela) at ([xshift=
6.5em,yshift=-2em]processor2.south)
{
\small
{
(a)同步更新
}}
;
\node
[processor,anchor=east,align=center] (processor1) at ([xshift=-1em]processor2.west)
{
\
scriptsize
{
处理器 1
}
\\\script
size
{
(G1)
}}
;
\node
[processor,anchor=east,align=center] (processor1) at ([xshift=-1em]processor2.west)
{
\
footnotesize
{
处理器 1
}
\\\footnote
size
{
(G1)
}}
;
\node
[processor,anchor=west,align=center] (processor3) at ([xshift=1em]processor2.east)
{
\
scriptsize
{
处理器 3
}
\\\script
size
{
(G3)
}}
;
\node
[processor,anchor=west,align=center] (processor3) at ([xshift=1em]processor2.east)
{
\
footnotesize
{
处理器 3
}
\\\footnote
size
{
(G3)
}}
;
}
}
{
{
\draw
[->,very thick,red]
([xshift=-0.5em,yshift=2pt]processor2.north) -- ([xshift=-0.5em,yshift=-2pt]serverbox.south) node [pos=0.5,align=right,xshift=-2em] (pushlabel)
{
\
script
size
{$
\frac
{
\partial
J
}{
\partial
{
\bm
\theta
}}$}}
;;
\draw
[->,very thick,red]
([xshift=-0.5em,yshift=2pt]processor2.north) -- ([xshift=-0.5em,yshift=-2pt]serverbox.south) node [pos=0.5,align=right,xshift=-2em] (pushlabel)
{
\
footnote
size
{$
\frac
{
\partial
J
}{
\partial
{
\bm
\theta
}}$}}
;;
\draw
[<-,very thick,blue]
([xshift=0.5em,yshift=2pt]processor2.north) -- ([xshift=0.5em,yshift=-2pt]serverbox.south) node [pos=0.5,align=left,xshift=2.2em] (fetchlabel)
{
\
script
size
{${
\bm
\theta
}_{
\textrm
{
new
}}$}}
;;;
\draw
[<-,very thick,blue]
([xshift=0.5em,yshift=2pt]processor2.north) -- ([xshift=0.5em,yshift=-2pt]serverbox.south) node [pos=0.5,align=left,xshift=2.2em] (fetchlabel)
{
\
footnote
size
{${
\bm
\theta
}_{
\textrm
{
new
}}$}}
;;;
\draw
[->,very thick,red]
([xshift=-0.5em,yshift=2pt]processor3.north) --
\draw
[->,very thick,red]
([xshift=-0.5em,yshift=2pt]processor3.north) --
([xshift=3em,yshift=-2pt]serverbox.south);
([xshift=3em,yshift=-2pt]serverbox.south);
\draw
[<-,very thick,blue]
([xshift=0.5em,yshift=2pt]processor3.north) -- ([xshift=4em,yshift=-2pt]serverbox.south) node [pos=0.
5,align=left,xshift=2.2em] (fetchlabel)
{
\script
size
{
fetch (F)
}}
;
\draw
[<-,very thick,blue]
([xshift=0.5em,yshift=2pt]processor3.north) -- ([xshift=4em,yshift=-2pt]serverbox.south) node [pos=0.
49,align=left,xshift=2.2em] (fetchlabel)
{
\footnote
size
{
fetch (F)
}}
;
\draw
[->,very thick,red]
([xshift=-0.5em,yshift=2pt]processor1.north) -- ([xshift=-4em,yshift=-2pt]serverbox.south) node [pos=0.5,align=right,xshift=-2em] (pushlabel)
{
\
script
size
{
push (P)
}}
;
\draw
[->,very thick,red]
([xshift=-0.5em,yshift=2pt]processor1.north) -- ([xshift=-4em,yshift=-2pt]serverbox.south) node [pos=0.5,align=right,xshift=-2em] (pushlabel)
{
\
footnote
size
{
push (P)
}}
;
\draw
[<-,very thick,blue]
([xshift=0.5em,yshift=2pt]processor1.north) -- ([xshift=-3em,yshift=-2pt]serverbox.south);
\draw
[<-,very thick,blue]
([xshift=0.5em,yshift=2pt]processor1.north) -- ([xshift=-3em,yshift=-2pt]serverbox.south);
}
}
...
@@ -45,18 +45,18 @@
...
@@ -45,18 +45,18 @@
% synchronous mode
% synchronous mode
\tikzstyle
{
job
}
= [draw,rotate=90,minimum height=0.25in]
\tikzstyle
{
job
}
= [draw,rotate=90,minimum height=0.25in]
\
script
size
{
\
footnote
size
{
{
{
\node
[job,anchor=south west,fill=blue!50]
(fetch11) at ([xshift=6em,yshift=
1
em]processor3.east)
{
\textbf
{
F
}}
;
\node
[job,anchor=south west,fill=blue!50]
(fetch11) at ([xshift=6em,yshift=
-0.2
em]processor3.east)
{
\textbf
{
F
}}
;
\node
[job,anchor=west,fill=orange!30]
(minibatch11) at ([yshift=1pt]fetch11.east)
{
\
tiny
{
minibatch3
}}
;
\node
[job,anchor=west,fill=orange!30]
(minibatch11) at ([yshift=1pt]fetch11.east)
{
\
scriptsize
{
minibatch3
}}
;
\node
[job,anchor=west,fill=red!50]
(push11) at ([yshift=1pt]minibatch11.east)
{
\textbf
{
P
}}
;
\node
[job,anchor=west,fill=red!50]
(push11) at ([yshift=1pt]minibatch11.east)
{
\textbf
{
P
}}
;
\node
[job,anchor=north west,fill=blue!50]
(fetch12) at ([xshift=0.8em]fetch11.south west)
{
\textbf
{
F
}}
;
\node
[job,anchor=north west,fill=blue!50]
(fetch12) at ([xshift=0.8em]fetch11.south west)
{
\textbf
{
F
}}
;
\node
[job,anchor=west,fill=orange!30]
(minibatch12) at ([yshift=1pt]fetch12.east)
{
\
tiny
{
minibatch2
}}
;
\node
[job,anchor=west,fill=orange!30]
(minibatch12) at ([yshift=1pt]fetch12.east)
{
\
scriptsize
{
minibatch2
}}
;
\node
[job,anchor=west,fill=red!50]
(push12) at ([yshift=1pt]minibatch12.east)
{
\textbf
{
P
}}
;
\node
[job,anchor=west,fill=red!50]
(push12) at ([yshift=1pt]minibatch12.east)
{
\textbf
{
P
}}
;
\node
[job,anchor=north west,fill=blue!50]
(fetch13) at ([xshift=0.8em]fetch12.south west)
{
\textbf
{
F
}}
;
\node
[job,anchor=north west,fill=blue!50]
(fetch13) at ([xshift=0.8em]fetch12.south west)
{
\textbf
{
F
}}
;
\node
[job,anchor=west,fill=orange!30,minimum width=8em]
(minibatch13) at ([yshift=1pt]fetch13.east)
{
\
script
size
{
minibatch1
}}
;
\node
[job,anchor=west,fill=orange!30,minimum width=8em]
(minibatch13) at ([yshift=1pt]fetch13.east)
{
\
footnote
size
{
minibatch1
}}
;
\node
[job,anchor=west,fill=red!50]
(push13) at ([yshift=1pt]minibatch13.east)
{
\textbf
{
P
}}
;
\node
[job,anchor=west,fill=red!50]
(push13) at ([yshift=1pt]minibatch13.east)
{
\textbf
{
P
}}
;
\node
[anchor=south west,draw,fill=gray!20,minimum width=8.0em]
(update11) at ([yshift=
4.0
em]push11.north east)
{
更新
}
;
\node
[anchor=south west,draw,fill=gray!20,minimum width=8.0em]
(update11) at ([yshift=
3.6
em]push11.north east)
{
更新
}
;
\node
[anchor=north]
(G11) at (fetch11.west)
{
\small
{
G3
}}
;
\node
[anchor=north]
(G11) at (fetch11.west)
{
\small
{
G3
}}
;
\node
[anchor=north]
(G12) at (fetch12.west)
{
\small
{
G2
}}
;
\node
[anchor=north]
(G12) at (fetch12.west)
{
\small
{
G2
}}
;
...
@@ -68,12 +68,12 @@
...
@@ -68,12 +68,12 @@
{
{
\draw
[<->,thin,dotted] ([xshift=-1pt]minibatch11.north) .. controls +(west:3em) and +(east:3em) .. ([xshift=1pt]processor3.east);
\draw
[<->,thin,dotted] ([xshift=-1pt]minibatch11.north) .. controls +(west:3em) and +(east:3em) .. ([xshift=1pt]processor3.east);
\draw
[<->,thin,dotted] ([xshift=-1pt]fetch11.north) .. controls +(west:4em) and +(east:4em) .. ([xshift=
-0.5
em,yshift=0.3in]processor3.north);
\draw
[<->,thin,dotted] ([xshift=-1pt]fetch11.north) .. controls +(west:4em) and +(east:4em) .. ([xshift=
0
em,yshift=0.3in]processor3.north);
\draw
[<->,thin,dotted] ([xshift=-1pt]push11.north) -- ([xshift=-
4
em,yshift=0.8in]processor3.north);
\draw
[<->,thin,dotted] ([xshift=-1pt]push11.north) -- ([xshift=-
2.2
em,yshift=0.8in]processor3.north);
}
}
{
{
\draw
[<->,thin,dotted] ([xshift=-1pt]update11.west) -- ([xshift=1pt,yshift=-1.
5
em]serverbox.north east);
\draw
[<->,thin,dotted] ([xshift=-1pt]update11.west) -- ([xshift=1pt,yshift=-1.
28
em]serverbox.north east);
}
}
...
@@ -83,7 +83,7 @@
...
@@ -83,7 +83,7 @@
\begin{scope}
[yshift=-2.5in]
\begin{scope}
[yshift=-2.5in]
{
\
script
size
{
\
footnote
size
\tikzstyle
{
parametershard
}
= [draw,thick,minimum width=4em,align=left,rounded corners=2pt]
\tikzstyle
{
parametershard
}
= [draw,thick,minimum width=4em,align=left,rounded corners=2pt]
...
@@ -91,7 +91,7 @@
...
@@ -91,7 +91,7 @@
\node
[parametershard,anchor=west,fill=yellow!10]
(param1) at (0,0)
{${
\bm
\theta
}_
o
$}
;
\node
[parametershard,anchor=west,fill=yellow!10]
(param1) at (0,0)
{${
\bm
\theta
}_
o
$}
;
\node
(param2) at ([xshift=1em]param1.east)
{}
;
\node
(param2) at ([xshift=1em]param1.east)
{}
;
\node
[parametershard,anchor=west,fill=red!10]
(param3) at ([xshift=1em]param2.east)
{${
\bm
\theta
}_
h
$}
;
\node
[parametershard,anchor=west,fill=red!10]
(param3) at ([xshift=1em]param2.east)
{${
\bm
\theta
}_
h
$}
;
\node
[anchor=south,inner sep=1pt]
(serverlabel) at ([yshift=0.
2em]param2.north)
{
\footnotesize
{
\textbf
{
参数服务器
}
:
${
\bm
\theta
}_{
\textrm
{
new
}}
=
{
\bm
\theta
}
-
\alpha\cdot
\frac
{
\partial
J
}{
\partial
{
\bm
\theta
}}$}}
;
\node
[anchor=south,inner sep=1pt]
(serverlabel) at ([yshift=0.
8em]param2.north)
{
\small
{
\textbf
{
参数服务器
}
:
${
\bm
\theta
}_{
\textrm
{
new
}}
=
{
\bm
\theta
}
-
\alpha\cdot
\frac
{
\partial
J
}{
\partial
{
\bm
\theta
}}$}}
;
}
}
\begin{pgfonlayer}
{
background
}
\begin{pgfonlayer}
{
background
}
...
@@ -103,19 +103,19 @@
...
@@ -103,19 +103,19 @@
\tikzstyle
{
processor
}
= [draw,thick,fill=orange!20,minimum width=4em,align=left,rounded corners=2pt]
\tikzstyle
{
processor
}
= [draw,thick,fill=orange!20,minimum width=4em,align=left,rounded corners=2pt]
{
{
\node
[processor,anchor=north,align=center] (processor2) at ([yshift=-1.2in]serverlabel.south)
{
\
scriptsize
{
处理器 2
}
\\\script
size
{
(G2)
}}
;
\node
[processor,anchor=north,align=center] (processor2) at ([yshift=-1.2in]serverlabel.south)
{
\
footnotesize
{
处理器 2
}
\\\footnote
size
{
(G2)
}}
;
\node
[anchor=north] (label) at ([xshift=
4em,yshift=-1em]processor2.south)
{
\footnotesize
{
(b)异步更新
}}
;
\node
[anchor=north] (label) at ([xshift=
6.5em,yshift=-2em]processor2.south)
{
\small
{
(b)异步更新
}}
;
\node
[processor,anchor=east,align=center] (processor1) at ([xshift=-1em]processor2.west)
{
\
scriptsize
{
处理器 1
}
\\\script
size
{
(G1)
}}
;
\node
[processor,anchor=east,align=center] (processor1) at ([xshift=-1em]processor2.west)
{
\
footnotesize
{
处理器 1
}
\\\footnote
size
{
(G1)
}}
;
\node
[processor,anchor=west,align=center] (processor3) at ([xshift=1em]processor2.east)
{
\
scriptsize
{
处理器 3
}
\\\script
size
{
(G3)
}}
;
\node
[processor,anchor=west,align=center] (processor3) at ([xshift=1em]processor2.east)
{
\
footnotesize
{
处理器 3
}
\\\footnote
size
{
(G3)
}}
;
}
}
{
{
\draw
[->,very thick,red]
([xshift=-0.5em,yshift=2pt]processor2.north) -- ([xshift=-0.5em,yshift=-2pt]serverbox.south) node [pos=0.5,align=right,xshift=-2em] (pushlabel)
{
\
script
size
{$
\frac
{
\partial
J
}{
\partial
{
\bm
\theta
}}$}}
;;
\draw
[->,very thick,red]
([xshift=-0.5em,yshift=2pt]processor2.north) -- ([xshift=-0.5em,yshift=-2pt]serverbox.south) node [pos=0.5,align=right,xshift=-2em] (pushlabel)
{
\
footnote
size
{$
\frac
{
\partial
J
}{
\partial
{
\bm
\theta
}}$}}
;;
\draw
[<-,very thick,blue]
([xshift=0.5em,yshift=2pt]processor2.north) -- ([xshift=0.5em,yshift=-2pt]serverbox.south) node [pos=0.5,align=left,xshift=2.2em] (fetchlabel)
{
\
script
size
{${
\bm
\theta
}_{
\textrm
{
new
}}$}}
;;;
\draw
[<-,very thick,blue]
([xshift=0.5em,yshift=2pt]processor2.north) -- ([xshift=0.5em,yshift=-2pt]serverbox.south) node [pos=0.5,align=left,xshift=2.2em] (fetchlabel)
{
\
footnote
size
{${
\bm
\theta
}_{
\textrm
{
new
}}$}}
;;;
\draw
[->,very thick,red]
([xshift=-0.5em,yshift=2pt]processor3.north) --
\draw
[->,very thick,red]
([xshift=-0.5em,yshift=2pt]processor3.north) --
([xshift=3em,yshift=-2pt]serverbox.south);
([xshift=3em,yshift=-2pt]serverbox.south);
\draw
[<-,very thick,blue]
([xshift=0.5em,yshift=2pt]processor3.north) -- ([xshift=4em,yshift=-2pt]serverbox.south) node [pos=0.
5,align=left,xshift=2.2em] (fetchlabel)
{
\script
size
{
fetch (F)
}}
;
\draw
[<-,very thick,blue]
([xshift=0.5em,yshift=2pt]processor3.north) -- ([xshift=4em,yshift=-2pt]serverbox.south) node [pos=0.
49,align=left,xshift=2.2em] (fetchlabel)
{
\footnote
size
{
fetch (F)
}}
;
\draw
[->,very thick,red]
([xshift=-0.5em,yshift=2pt]processor1.north) -- ([xshift=-4em,yshift=-2pt]serverbox.south) node [pos=0.5,align=right,xshift=-2em] (pushlabel)
{
\
script
size
{
push (P)
}}
;
\draw
[->,very thick,red]
([xshift=-0.5em,yshift=2pt]processor1.north) -- ([xshift=-4em,yshift=-2pt]serverbox.south) node [pos=0.5,align=right,xshift=-2em] (pushlabel)
{
\
footnote
size
{
push (P)
}}
;
\draw
[<-,very thick,blue]
([xshift=0.5em,yshift=2pt]processor1.north) -- ([xshift=-3em,yshift=-2pt]serverbox.south);
\draw
[<-,very thick,blue]
([xshift=0.5em,yshift=2pt]processor1.north) -- ([xshift=-3em,yshift=-2pt]serverbox.south);
}
}
...
@@ -123,19 +123,19 @@
...
@@ -123,19 +123,19 @@
% synchronous mode
% synchronous mode
\tikzstyle
{
job
}
= [draw,rotate=90,minimum height=0.25in]
\tikzstyle
{
job
}
= [draw,rotate=90,minimum height=0.25in]
\
script
size
{
\
footnote
size
{
{
{
\node
[job,anchor=south west,fill=blue!50]
(fetch21) at ([xshift=6em,yshift=
1
em]processor3.east)
{
\textbf
{
F
}}
;
\node
[job,anchor=south west,fill=blue!50]
(fetch21) at ([xshift=6em,yshift=
-0.3
em]processor3.east)
{
\textbf
{
F
}}
;
\node
[job,anchor=west,fill=orange!30]
(minibatch21) at ([yshift=1pt]fetch21.east)
{
\
tiny
{
minibatch3
}}
;
\node
[job,anchor=west,fill=orange!30]
(minibatch21) at ([yshift=1pt]fetch21.east)
{
\
scriptsize
{
minibatch3
}}
;
\node
[job,anchor=west,fill=red!50]
(push21) at ([yshift=1pt]minibatch21.east)
{
\textbf
{
P
}}
;
\node
[job,anchor=west,fill=red!50]
(push21) at ([yshift=1pt]minibatch21.east)
{
\textbf
{
P
}}
;
\node
[job,anchor=north west,fill=blue!50]
(fetch22) at ([xshift=0.8em]fetch21.south west)
{
\textbf
{
F
}}
;
\node
[job,anchor=north west,fill=blue!50]
(fetch22) at ([xshift=0.8em]fetch21.south west)
{
\textbf
{
F
}}
;
\node
[job,anchor=west,fill=orange!30]
(minibatch22) at ([yshift=1pt]fetch22.east)
{
\
tiny
{
minibatch2
}}
;
\node
[job,anchor=west,fill=orange!30]
(minibatch22) at ([yshift=1pt]fetch22.east)
{
\
scriptsize
{
minibatch2
}}
;
\node
[job,anchor=west,fill=red!50]
(push22) at ([yshift=1pt]minibatch22.east)
{
\textbf
{
P
}}
;
\node
[job,anchor=west,fill=red!50]
(push22) at ([yshift=1pt]minibatch22.east)
{
\textbf
{
P
}}
;
\node
[job,anchor=north west,fill=blue!50]
(fetch23) at ([xshift=0.8em]fetch22.south west)
{
\textbf
{
F
}}
;
\node
[job,anchor=north west,fill=blue!50]
(fetch23) at ([xshift=0.8em]fetch22.south west)
{
\textbf
{
F
}}
;
\node
[job,anchor=west,fill=orange!30,minimum width=8em]
(minibatch23) at ([yshift=1pt]fetch23.east)
{
\
script
size
{
minibatch1
}}
;
\node
[job,anchor=west,fill=orange!30,minimum width=8em]
(minibatch23) at ([yshift=1pt]fetch23.east)
{
\
footnote
size
{
minibatch1
}}
;
\node
[job,anchor=west,fill=red!50]
(push23) at ([yshift=1pt]minibatch23.east)
{
\textbf
{
P
}}
;
\node
[job,anchor=west,fill=red!50]
(push23) at ([yshift=1pt]minibatch23.east)
{
\textbf
{
P
}}
;
\node
[anchor=south west,draw,fill=gray!20,minimum width=0.59in]
(update21) at ([yshift=2pt]push21.north east)
{
更新
}
;
\node
[anchor=south west,draw,fill=gray!20,minimum width=0.59in]
(update21) at ([yshift=2pt]push21.north east)
{
更新
}
;
\node
[anchor=south west,draw,fill=gray!20,minimum width=0.25in]
(update22) at ([yshift=2pt]push23.north east)
{
\
tiny
{
更新
}}
;
\node
[anchor=south west,draw,fill=gray!20,minimum width=0.25in]
(update22) at ([yshift=2pt]push23.north east)
{
\
scriptsize
{
更新
}}
;
\node
[anchor=north]
(G21) at (fetch21.west)
{
\small
{
G3
}}
;
\node
[anchor=north]
(G21) at (fetch21.west)
{
\small
{
G3
}}
;
\node
[anchor=north]
(G22) at (fetch22.west)
{
\small
{
G2
}}
;
\node
[anchor=north]
(G22) at (fetch22.west)
{
\small
{
G2
}}
;
...
@@ -143,7 +143,7 @@
...
@@ -143,7 +143,7 @@
\node
[anchor=north,align=center]
(synlabel) at (G22.south)
{
\small
{
\textbf
{
异步更新
}}}
;
\node
[anchor=north,align=center]
(synlabel) at (G22.south)
{
\small
{
\textbf
{
异步更新
}}}
;
\draw
[->,thick]
([xshift=1em]G23.east) -- ([xshift=1em,yshift=1.4in]G23.east) node [pos=0.5,rotate=90,yshift=-1em]
{
\small
{
时间轴
}}
;
\draw
[->,thick]
([xshift=1em]G23.east) -- ([xshift=1em,yshift=1.4in]G23.east) node [pos=0.5,rotate=90,yshift=-1em]
{
\small
{
时间轴
}}
;
\draw
[<->,thin,dotted] ([xshift=-1pt]update21.west) -- ([xshift=1pt,yshift=-1.5em]serverbox.north east);
\draw
[<->,thin,dotted] ([xshift=-1pt]update21.west) -- ([xshift=1pt,yshift=-1.5
5
em]serverbox.north east);
\draw
[<->,thin,dotted] ([xshift=-1pt]update22.west) -- ([xshift=1pt,yshift=-1.5em]serverbox.north east);
\draw
[<->,thin,dotted] ([xshift=-1pt]update22.west) -- ([xshift=1pt,yshift=-1.5em]serverbox.north east);
}
}
}
}
...
...
Chapter9/Figures/figure-residual-structure.tex
查看文件 @
6c626a4f
...
@@ -10,15 +10,15 @@
...
@@ -10,15 +10,15 @@
\node
[anchor=north,draw,thick](node2)at ([yshift=-1.2em]node3.south)
{
\small
{
weight layer
}}
;
\node
[anchor=north,draw,thick](node2)at ([yshift=-1.2em]node3.south)
{
\small
{
weight layer
}}
;
\draw
[->,thick]
(node2.north)--([yshift=0.35em]node3.south);
\draw
[->,thick]
(node2.north)--([yshift=0.35em]node3.south);
\node
[anchor=west]
(node2-1) at ([xshift=2.1em,yshift=1.2em]node2.east)
{$
{
\bm
x
}$}
;
\node
[anchor=west]
(node2-1) at ([xshift=2.1em,yshift=1.2em]node2.east)
{$
\mathbi
{
x
}$}
;
\node
[anchor=north]
(node2-2) at ([xshift=0.2em,yshift=-0.3em]node2-1.south)
{
\footnotesize
{$
\rm
{
identity
}$}}
;
\node
[anchor=north]
(node2-2) at ([xshift=0.2em,yshift=-0.3em]node2-1.south)
{
\footnotesize
{$
\rm
{
identity
}$}}
;
\node
[anchor=east](node4) at ([xshift=-0.2em]node2.west)
{$
\textrm
{
F
}
(
{
\bm
x
}
)
$}
;
\node
[anchor=east](node4) at ([xshift=-0.2em]node2.west)
{$
\textrm
{
F
}
(
\mathbi
{
x
}
)
$}
;
\node
[anchor=east](node5) at ([xshift=-0.3em]node3.west)
{$
\textrm
{
F
}
(
{
\bm
x
}
)+
{
\bm
x
}$}
;
\node
[anchor=east](node5) at ([xshift=-0.3em]node3.west)
{$
\textrm
{
F
}
(
\mathbi
{
x
}
)+
\mathbi
{
x
}$}
;
\node
[anchor=north](node1) at ([yshift=-1.8em]node2.south)
{}
;
\node
[anchor=north](node1) at ([yshift=-1.8em]node2.south)
{}
;
\draw
[->,thick]
([yshift=0.0em]node1.north)--(node2.south);
\draw
[->,thick]
([yshift=0.0em]node1.north)--(node2.south);
\node
[anchor=east](node1-1) at ([xshift=1em,yshift=0.4em]node1.east)
{$
{
\bm
x
}$}
;
\node
[anchor=east](node1-1) at ([xshift=1em,yshift=0.4em]node1.east)
{$
\mathbi
{
x
}$}
;
\draw
[->,thick]
([xshift=-1.3em,yshift=0.8em]node1-1.east)--([xshift=2.7em,yshift=0.8em]node1-1.east)--([xshift=2.7em,yshift=5.35em]node1-1.east)--([xshift=-0.4em]node3.east);
\draw
[->,thick]
([xshift=-1.3em,yshift=0.8em]node1-1.east)--([xshift=2.7em,yshift=0.8em]node1-1.east)--([xshift=2.7em,yshift=5.35em]node1-1.east)--([xshift=-0.4em]node3.east);
...
...
Chapter9/Figures/figure-rnn-lm.tex
查看文件 @
6c626a4f
...
@@ -7,14 +7,14 @@
...
@@ -7,14 +7,14 @@
\node
[anchor=west,rnnnode] (node13) at ([xshift=2em]node12.east)
{
\scriptsize
{
RNN Cell
}}
;
\node
[anchor=west,rnnnode] (node13) at ([xshift=2em]node12.east)
{
\scriptsize
{
RNN Cell
}}
;
\node
[anchor=west,rnnnode] (node14) at ([xshift=2em]node13.east)
{
\scriptsize
{
RNN Cell
}}
;
\node
[anchor=west,rnnnode] (node14) at ([xshift=2em]node13.east)
{
\scriptsize
{
RNN Cell
}}
;
}
}
\node
[anchor=north,rnnnode,fill=red!30!white] (e1) at ([yshift=-1.2em]node11.south)
{
\tiny
{${
\
bm
e
}_
1
=
{
\bm
o
}_
1
{
\bm
C
}$}}
;
\node
[anchor=north,rnnnode,fill=red!30!white] (e1) at ([yshift=-1.2em]node11.south)
{
\tiny
{${
\
mathbi
{
e
}}_
1
=
{
\mathbi
{
o
}}_
1
{
\mathbi
{
C
}
}$}}
;
\node
[anchor=north,rnnnode,fill=red!30!white] (e2) at ([yshift=-1.2em]node12.south)
{
\tiny
{${
\
bm
e
}_
2
=
{
\bm
wo
}_
2
{
\bm
C
}$}}
;
\node
[anchor=north,rnnnode,fill=red!30!white] (e2) at ([yshift=-1.2em]node12.south)
{
\tiny
{${
\
mathbi
{
e
}}_
2
=
{
\mathbi
{
o
}}_
2
{
\mathbi
{
C
}
}$}}
;
\node
[anchor=north,rnnnode,fill=red!30!white] (e3) at ([yshift=-1.2em]node13.south)
{
\tiny
{${
\
bm
e
}_
3
=
{
\bm
o
}_
3
{
\bm
C
}$}}
;
\node
[anchor=north,rnnnode,fill=red!30!white] (e3) at ([yshift=-1.2em]node13.south)
{
\tiny
{${
\
mathbi
{
e
}}_
3
=
{
\mathbi
{
o
}}_
3
{
\mathbi
{
C
}
}$}}
;
\node
[anchor=north,rnnnode,fill=red!30!white] (e4) at ([yshift=-1.2em]node14.south)
{
\tiny
{${
\
bm
e
}_
4
=
{
\bm
o
}_
4
{
\bm
C
}$}}
;
\node
[anchor=north,rnnnode,fill=red!30!white] (e4) at ([yshift=-1.2em]node14.south)
{
\tiny
{${
\
mathbi
{
e
}}_
4
=
{
\mathbi
{
o
}}_
4
{
\mathbi
{
C
}
}$}}
;
\node
[anchor=north] (w1) at ([yshift=-1em]e1.south)
{
\footnotesize
{${
\
bm
o
}_
1
$}}
;
\node
[anchor=north] (w1) at ([yshift=-1em]e1.south)
{
\footnotesize
{${
\
mathbi
{
o
}
}_
1
$}}
;
\node
[anchor=north] (w2) at ([yshift=-1em]e2.south)
{
\footnotesize
{${
\
bm
o
}_
2
$}}
;
\node
[anchor=north] (w2) at ([yshift=-1em]e2.south)
{
\footnotesize
{${
\
mathbi
{
o
}
}_
2
$}}
;
\node
[anchor=north] (w3) at ([yshift=-1em]e3.south)
{
\footnotesize
{${
\
bm
o
}_
3
$}}
;
\node
[anchor=north] (w3) at ([yshift=-1em]e3.south)
{
\footnotesize
{${
\
mathbi
{
o
}
}_
3
$}}
;
\node
[anchor=north] (w4) at ([yshift=-1em]e4.south)
{
\footnotesize
{${
\
bm
o
}_
4
$}}
;
\node
[anchor=north] (w4) at ([yshift=-1em]e4.south)
{
\footnotesize
{${
\
mathbi
{
o
}
}_
4
$}}
;
\draw
[->,thick] ([yshift=0.1em]w1.north)--([yshift=-0.1em]e1.south);
\draw
[->,thick] ([yshift=0.1em]w1.north)--([yshift=-0.1em]e1.south);
\draw
[->,thick] ([yshift=0.1em]w2.north)--([yshift=-0.1em]e2.south);
\draw
[->,thick] ([yshift=0.1em]w2.north)--([yshift=-0.1em]e2.south);
...
...
Chapter9/Figures/figure-single-layer-of-neural-network-for-weather-prediction.tex
查看文件 @
6c626a4f
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
\node
[anchor=center,neuronnode] (neuron02) at ([yshift=-3em]neuron01)
{}
;
\node
[anchor=center,neuronnode] (neuron02) at ([yshift=-3em]neuron01)
{}
;
\node
[anchor=east] (x0) at ([xshift=-6em]neuron00.west)
{$
x
_
1
$}
;
\node
[anchor=east] (x0) at ([xshift=-6em]neuron00.west)
{$
x
_
1
$}
;
\node
[anchor=east] (x1) at ([xshift=-6em]neuron01.west)
{$
x
_
2
$}
;
\node
[anchor=east] (x1) at ([xshift=-6em]neuron01.west)
{$
x
_
2
$}
;
\node
[anchor=east] (x2) at ([xshift=-6em]neuron02.west)
{$
{
\vectorn
{
\emph
{
b
}}
}$}
;
\node
[anchor=east] (x2) at ([xshift=-6em]neuron02.west)
{$
\mathbi
{
b
}$}
;
\node
[anchor=west] (y0) at ([xshift=4em]neuron00.east)
{$
y
_
1
$}
;
\node
[anchor=west] (y0) at ([xshift=4em]neuron00.east)
{$
y
_
1
$}
;
\draw
[->] (x0.east) -- (neuron00.180) node [pos=0.1,above]
{
\tiny
{$
w
_{
11
}$}}
;
\draw
[->] (x0.east) -- (neuron00.180) node [pos=0.1,above]
{
\tiny
{$
w
_{
11
}$}}
;
...
@@ -29,10 +29,10 @@
...
@@ -29,10 +29,10 @@
\draw
[->] (x2.east) -- (neuron02.180) node [pos=0.3,below]
{
\tiny
{$
b
_{
3
}$}}
;
\draw
[->] (x2.east) -- (neuron02.180) node [pos=0.3,below]
{
\tiny
{$
b
_{
3
}$}}
;
\draw
[->] (neuron02.east) -- (y2.west);
\draw
[->] (neuron02.east) -- (y2.west);
\node
[anchor=east,align=left] (inputlabel) at ([xshift=-0.1em]x1.west)
{
\scriptsize
{
输入向量
}
:
\\\small
{$
{
\vectorn
{
\emph
{
x
}}
}
=(
x
_
1
,x
_
2
)
$}}
;
\node
[anchor=east,align=left] (inputlabel) at ([xshift=-0.1em]x1.west)
{
\scriptsize
{
输入向量
}
:
\\\small
{$
\mathbi
{
x
}
=(
x
_
1
,x
_
2
)
$}}
;
\node
[anchor=west,align=left] (outputlabel) at ([xshift=0.1em]y1.east)
{
\scriptsize
{
输出向量
}
:
\\\small
{$
{
\vectorn
{
\emph
{
y
}}
}
=(
y
_
1
,y
_
2
,y
_
3
)
$}}
;
\node
[anchor=west,align=left] (outputlabel) at ([xshift=0.1em]y1.east)
{
\scriptsize
{
输出向量
}
:
\\\small
{$
\mathbi
{
y
}
=(
y
_
1
,y
_
2
,y
_
3
)
$}}
;
\begin{pgfonlayer}
{
background
}
\begin{pgfonlayer}
{
background
}
...
...
Chapter9/Figures/figure-tensor-mul.tex
查看文件 @
6c626a4f
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
\node
[fill=red!20,inner sep=0pt,minimum height=0.49cm,minimum width=0.49cm] at (
\x
,
\y
)
{$
\number\value
{
mycount
4
}$}
;
\node
[fill=red!20,inner sep=0pt,minimum height=0.49cm,minimum width=0.49cm] at (
\x
,
\y
)
{$
\number\value
{
mycount
4
}$}
;
\addtocounter
{
mycount4
}{
1
}
;
\addtocounter
{
mycount4
}{
1
}
;
}
}
\node
[anchor=north] (xlabel) at (0,-1.2)
{$
\
vectorn
{
\emph
{
x
}
}$}
;
\node
[anchor=north] (xlabel) at (0,-1.2)
{$
\
mathbi
{
x
}$}
;
}
}
\node
[anchor=south west] (label14) at (-1.3,0.9)
{
\footnotesize
{
\ding
{
175
}}}
;
\node
[anchor=south west] (label14) at (-1.3,0.9)
{
\footnotesize
{
\ding
{
175
}}}
;
\end{scope}
\end{scope}
...
@@ -65,7 +65,7 @@
...
@@ -65,7 +65,7 @@
\node
[fill=black!20,inner sep=0pt,minimum height=0.49cm,minimum width=0.49cm] at (0.25,0.25)
{
\small
{$
-
1
$}}
;
\node
[fill=black!20,inner sep=0pt,minimum height=0.49cm,minimum width=0.49cm] at (0.25,0.25)
{
\small
{$
-
1
$}}
;
\node
[fill=black!20,inner sep=0pt,minimum height=0.49cm,minimum width=0.49cm] at (0.25,-0.25)
{$
1
$}
;
\node
[fill=black!20,inner sep=0pt,minimum height=0.49cm,minimum width=0.49cm] at (0.25,-0.25)
{$
1
$}
;
\node
[fill=black!20,inner sep=0pt,minimum height=0.49cm,minimum width=0.49cm] at (0.25,-0.75)
{$
0
$}
;
\node
[fill=black!20,inner sep=0pt,minimum height=0.49cm,minimum width=0.49cm] at (0.25,-0.75)
{$
0
$}
;
\node
[anchor=north] (xlabel) at (0,-1.2)
{$
\
vectorn
{
\emph
{
W
}
}$}
;
\node
[anchor=north] (xlabel) at (0,-1.2)
{$
\
mathbi
{
W
}$}
;
}
}
{
\draw
[->,thick,dashed] (-1.5in+2em+1.5em,-0.3) .. controls +(east:2) and +(west:1) .. (-0.55,0.8) node [pos=0.5,left]
{
\scriptsize
{
\textbf
{
矩阵乘
}}}
;
}
{
\draw
[->,thick,dashed] (-1.5in+2em+1.5em,-0.3) .. controls +(east:2) and +(west:1) .. (-0.55,0.8) node [pos=0.5,left]
{
\scriptsize
{
\textbf
{
矩阵乘
}}}
;
}
...
@@ -129,7 +129,7 @@
...
@@ -129,7 +129,7 @@
}
}
\node
[anchor=south west] (label24) at (-0.8,0.9)
{
\footnotesize
{
\ding
{
175
}}}
;
\node
[anchor=south west] (label24) at (-0.8,0.9)
{
\footnotesize
{
\ding
{
175
}}}
;
{
{
\node
[anchor=north] (xlabel) at (0,-1.2)
{${
\
vectorn
{
\emph
{
x
}}}
\cdot
{
\vectorn
{
\emph
{
W
}
}}$}
;
\node
[anchor=north] (xlabel) at (0,-1.2)
{${
\
mathbi
{
x
}}
\cdot
{
\mathbi
{
W
}}$}
;
\node
[anchor=center] (elabel) at (-0.7in,0)
{
\Huge
{$
\textbf
{
=
}$}}
;
\node
[anchor=center] (elabel) at (-0.7in,0)
{
\Huge
{$
\textbf
{
=
}$}}
;
}
}
\end{scope}
\end{scope}
...
...
Chapter9/Figures/figure-translation.tex
查看文件 @
6c626a4f
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
\node
[above]
at ([xshift=2em,yshift=1em]a2.west)
{
1
}
;
\node
[above]
at ([xshift=2em,yshift=1em]a2.west)
{
1
}
;
\node
[below]
at ([xshift=-0.5em,yshift=0em]a2.west)
{
-1
}
;
\node
[below]
at ([xshift=-0.5em,yshift=0em]a2.west)
{
-1
}
;
\node
[anchor=west] (x) at ([xshift=-3.5cm,yshift=2em]a2.north)
{
\scriptsize
{
\node
[anchor=west] (x) at ([xshift=-3.5cm,yshift=2em]a2.north)
{
\scriptsize
{
$
{
\vectorn
{
\emph
{
W
}}
}
=
\begin
{
pmatrix
}
$
\mathbi
{
W
}
=
\begin
{
pmatrix
}
1
&
0
&
0
\\
1
&
0
&
0
\\
0
&
-
1
&
0
\\
0
&
-
1
&
0
\\
0
&
0
&
1
0
&
0
&
1
...
@@ -44,7 +44,7 @@
...
@@ -44,7 +44,7 @@
\node
[anchor=west] (x) at ([xshift=-4cm,yshift=2em]a3.north)
{
\scriptsize
{
\node
[anchor=west] (x) at ([xshift=-4cm,yshift=2em]a3.north)
{
\scriptsize
{
$
{
\vectorn
{
\emph
{
b
}}
}
=
\begin
{
pmatrix
}
$
\mathbi
{
b
}
=
\begin
{
pmatrix
}
0
.
5
&
0
&
0
\\
0
.
5
&
0
&
0
\\
0
&
0
&
0
\\
0
&
0
&
0
\\
0
&
0
&
0
0
&
0
&
0
...
...
Chapter9/Figures/figure-two-layer-neural-network.tex
查看文件 @
6c626a4f
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
\draw
[-,ublue] (n10.west) -- (n10.east);
\draw
[-,ublue] (n10.west) -- (n10.east);
\draw
[-,ublue] (n11.west) -- (n11.east);
\draw
[-,ublue] (n11.west) -- (n11.east);
\node
[anchor=north] (x1) at ([yshift=-4em]n11.south)
{$
x
_
1
$}
;
\node
[anchor=north] (x1) at ([yshift=-4em]n11.south)
{$
x
_
1
$}
;
\node
[anchor=north] (b) at ([yshift=-4em]n10.south)
{$
\
vectorn
{
\emph
{
b
}
}$}
;
\node
[anchor=north] (b) at ([yshift=-4em]n10.south)
{$
\
mathbi
{
b
}$}
;
{
{
\draw
[->,thick] (b.north) -- ([yshift=-0.1em]n10.south);
\draw
[->,thick] (b.north) -- ([yshift=-0.1em]n10.south);
\draw
[->,thick] (x1.north) -- ([yshift=-0.1em]n10.290);
\draw
[->,thick] (x1.north) -- ([yshift=-0.1em]n10.290);
...
...
Chapter9/Figures/figure-weather-forward.tex
查看文件 @
6c626a4f
...
@@ -15,10 +15,10 @@
...
@@ -15,10 +15,10 @@
\draw
[-,thick](part3.south)--(part4.north);
\draw
[-,thick](part3.south)--(part4.north);
\node
[anchor=north,minimum width=1.5em,minimum height=1.5em] (part4-2) at ([xshift=-1.2em,yshift=-0.2em]part4.south)
{
\scriptsize
{$
1
\times
2
$}}
;
\node
[anchor=north,minimum width=1.5em,minimum height=1.5em] (part4-2) at ([xshift=-1.2em,yshift=-0.2em]part4.south)
{
\scriptsize
{$
1
\times
2
$}}
;
\node
[anchor=north,minimum width=4.0em,minimum height=1.5em] (part5) at ([yshift=-1.4em]part4.south)
{
\footnotesize
{$
{
\vectorn
{
\emph
{
a
}}
}$}}
;
\node
[anchor=north,minimum width=4.0em,minimum height=1.5em] (part5) at ([yshift=-1.4em]part4.south)
{
\footnotesize
{$
\mathbi
{
a
}$}}
;
\draw
[-,thick](part4.south)--([yshift=-0.1em]part5.north);
\draw
[-,thick](part4.south)--([yshift=-0.1em]part5.north);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\node
[anchor=west,minimum width=2.0em,minimum height=1.5em] (part5-3) at ([xshift=-0.8em,yshift=0.2em]part5.east)
{
\footnotesize
{${
\
vectorn
{
\emph
{
W
}
}}^{
[
2
]
}$}}
;
\node
[anchor=west,minimum width=2.0em,minimum height=1.5em] (part5-3) at ([xshift=-0.8em,yshift=0.2em]part5.east)
{
\footnotesize
{${
\
mathbi
{
W
}}^{
[
2
]
}$}}
;
\node
[anchor=west,minimum width=2.0em,minimum height=1.5em] (part5-4) at ([xshift=2.0em,yshift=0.0em]part5-3.east)
{
\footnotesize
{$
b
^{
[
2
]
}$}}
;
\node
[anchor=west,minimum width=2.0em,minimum height=1.5em] (part5-4) at ([xshift=2.0em,yshift=0.0em]part5-3.east)
{
\footnotesize
{$
b
^{
[
2
]
}$}}
;
\draw
[-,thick]
(part4.south)--([xshift=-0.5em]part5-3.north);
\draw
[-,thick]
(part4.south)--([xshift=-0.5em]part5-3.north);
\draw
[-,thick]
(part3.south)--(part5-4.north);
\draw
[-,thick]
(part3.south)--(part5-4.north);
...
@@ -38,11 +38,11 @@
...
@@ -38,11 +38,11 @@
\draw
[-,thick](part7.south)--(part8.north);
\draw
[-,thick](part7.south)--(part8.north);
\node
[anchor=north,minimum width=1.5em,minimum height=1.5em] (part8-2) at ([xshift=-1.2em,yshift=-0.2em]part8.south)
{
\scriptsize
{$
1
\times
3
$}}
;
\node
[anchor=north,minimum width=1.5em,minimum height=1.5em] (part8-2) at ([xshift=-1.2em,yshift=-0.2em]part8.south)
{
\scriptsize
{$
1
\times
3
$}}
;
\node
[anchor=north,minimum width=4.0em,minimum height=1.5em] (part9) at ([yshift=-1.4em]part8.south)
{
\footnotesize
{$
{
\vectorn
{
\emph
{
x
}}
}$}}
;
\node
[anchor=north,minimum width=4.0em,minimum height=1.5em] (part9) at ([yshift=-1.4em]part8.south)
{
\footnotesize
{$
\mathbi
{
x
}$}}
;
\draw
[-,thick](part8.south)--([yshift=-0.1em]part9.north);
\draw
[-,thick](part8.south)--([yshift=-0.1em]part9.north);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\node
[anchor=west,minimum width=2.0em,minimum height=1.5em] (part9-3) at ([xshift=-0.8em,yshift=0.1em]part9.east)
{
\footnotesize
{${
\
vectorn
{
\emph
{
W
}
}}^{
[
1
]
}$}}
;
\node
[anchor=west,minimum width=2.0em,minimum height=1.5em] (part9-3) at ([xshift=-0.8em,yshift=0.1em]part9.east)
{
\footnotesize
{${
\
mathbi
{
W
}}^{
[
1
]
}$}}
;
\node
[anchor=west,minimum width=2.0em,minimum height=1.5em] (part9-4) at ([xshift=2.0em,yshift=0.0em]part9-3.east)
{
\footnotesize
{${
\
vectorn
{
\emph
{
b
}
}}^{
[
1
]
}$}}
;
\node
[anchor=west,minimum width=2.0em,minimum height=1.5em] (part9-4) at ([xshift=2.0em,yshift=0.0em]part9-3.east)
{
\footnotesize
{${
\
mathbi
{
b
}}^{
[
1
]
}$}}
;
\draw
[-,thick]
(part8.south)--([xshift=-0.5em]part9-3.north);
\draw
[-,thick]
(part8.south)--([xshift=-0.5em]part9-3.north);
\draw
[-,thick]
(part7.south)--(part9-4.north);
\draw
[-,thick]
(part7.south)--(part9-4.north);
\node
[anchor=south,minimum width=1.5em,minimum height=1.5em] (part9-3-1) at ([xshift=1.1em,yshift=-0.45em]part9-3.north)
{
\scriptsize
{$
3
\times
2
$}}
;
\node
[anchor=south,minimum width=1.5em,minimum height=1.5em] (part9-3-1) at ([xshift=1.1em,yshift=-0.45em]part9-3.north)
{
\scriptsize
{$
3
\times
2
$}}
;
...
...
Chapter9/Figures/figure-weather.tex
查看文件 @
6c626a4f
%%%------------------------------------------------------------------------------------------------------------
%%%------------------------------------------------------------------------------------------------------------
\begin{tikzpicture}
\begin{tikzpicture}
\tikzstyle
{
neuronnode
}
= [minimum size=2.2em,circle,draw,ublue,very thick,inner sep=1pt, fill=white,align=center,drop shadow=
{
shadow xshift=0.1em,shadow yshift=-0.1em
}
]
\tikzstyle
{
neuronnode
}
= [minimum size=2.2em,circle,draw,ublue,very thick,inner sep=1pt, fill=white,align=center,drop shadow=
{
shadow xshift=0.1em,shadow yshift=-0.1em
}
]
\node
[anchor=west,minimum width=2.0em,minimum height=1.5em] (bias10) at (0,0.05)
{
\footnotesize
{${
\
vectorn
{
\emph
{
b
}
}}^{
[
1
]
}$}}
;
\node
[anchor=west,minimum width=2.0em,minimum height=1.5em] (bias10) at (0,0.05)
{
\footnotesize
{${
\
mathbi
{
b
}}^{
[
1
]
}$}}
;
\node
[anchor=west,minimum width=2.0em,minimum height=1.5em] (bias11) at ([xshift=-1.5em,yshift=-0.3em]bias10.south)
{
\footnotesize
{
偏置1
}}
;
\node
[anchor=west,minimum width=2.0em,minimum height=1.5em] (bias11) at ([xshift=-1.5em,yshift=-0.3em]bias10.south)
{
\footnotesize
{
偏置1
}}
;
\node
[anchor=center,rotate=13,fill=white,inner sep=1pt] (b11) at ([yshift=1.0em,xshift=1.8em]bias10.north)
{
\scriptsize
{$
b
_{
11
}$}}
;
\node
[anchor=center,rotate=13,fill=white,inner sep=1pt] (b11) at ([yshift=1.0em,xshift=1.8em]bias10.north)
{
\scriptsize
{$
b
_{
11
}$}}
;
...
...
Chapter9/chapter9.tex
查看文件 @
6c626a4f
...
@@ -129,27 +129,14 @@
...
@@ -129,27 +129,14 @@
\parinterval
端到端学习使机器学习不再依赖传统的特征工程方法,因此也不需要繁琐的数据预处理、特征选择、降维等过程,而是直接利用人工神经网络自动从输入数据中提取、组合更复杂的特征,大大提升了模型能力和工程效率。以图
\ref
{
fig:9-2
}
中的图像分类为例,在传统方法中,图像分类需要很多阶段的处理。首先,需要提取一些手工设计的图像特征,在将其降维之后,需要利用SVM等分类算法对其进行分类。与这种多阶段的流水线似的处理流程相比,端到端深度学习只训练一个神经网络,输入就是图片的像素表示,输出直接是分类类别。
\parinterval
端到端学习使机器学习不再依赖传统的特征工程方法,因此也不需要繁琐的数据预处理、特征选择、降维等过程,而是直接利用人工神经网络自动从输入数据中提取、组合更复杂的特征,大大提升了模型能力和工程效率。以图
\ref
{
fig:9-2
}
中的图像分类为例,在传统方法中,图像分类需要很多阶段的处理。首先,需要提取一些手工设计的图像特征,在将其降维之后,需要利用SVM等分类算法对其进行分类。与这种多阶段的流水线似的处理流程相比,端到端深度学习只训练一个神经网络,输入就是图片的像素表示,输出直接是分类类别。
%------------------------------------------------------------------------------
%----------------------------------------------
\begin{figure}
[htp]
\begin{figure}
[htp]
\centering
\centering
\subfigcapskip
=8pt
\input
{
./Chapter9/Figures/figure-compare
}
\subfigure
[基于特征工程的机器学习方法做图像分类]
{
\begin{minipage}
{
.9
\textwidth
}
\centering
\includegraphics
[width=8cm]
{
./Chapter9/Figures/figure-feature-engineering.jpg
}
\end{minipage}
%
}
\vfill
\subfigure
[端到端学习方法做图像分类]
{
\begin{minipage}
{
.9
\textwidth
}
\centering
\includegraphics
[width=8cm]
{
./Chapter9/Figures/figure-deep-learning.jpg
}
\end{minipage}
%
}
\caption
{
特征工程
{
\small\sffamily\bfseries
{
vs
}}
端到端学习
}
\caption
{
特征工程
{
\small\sffamily\bfseries
{
vs
}}
端到端学习
}
\label
{
fig:9-2
}
\label
{
fig:9-2
}
\end
{
figure
}
\end{figure}
%----------------------------------------------
--------------------------------
%----------------------------------------------
\parinterval
传统的机器学习需要人工定义特征,这个过程往往需要对问题的隐含假设。这种方法存在三方面的问题:
\parinterval
传统的机器学习需要人工定义特征,这个过程往往需要对问题的隐含假设。这种方法存在三方面的问题:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论