-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnn.tex
196 lines (172 loc) · 5.58 KB
/
nn.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
\documentclass[x11names, 10pt]{beamer}
\usefonttheme{professionalfonts}
\usepackage[T1]{fontenc}
\usepackage{newpxtext}
\usepackage{newpxmath}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{amsmath}
\usepackage{bm}
\usepackage{centernot}
\usepackage{natbib}
\usepackage[absolute, overlay]{textpos} % showboxes to show boxes.
\usepackage{tikz}
\usepackage{wasysym}
\usepackage{xfrac}
% Sets.
\newcommand*{\M}{\mathcal{M}}
\newcommand*{\Reals}{\mathbb{R}}
\renewcommand*{\S}{\mathcal{S}}
\newcommand*{\X}{\mathcal{X}}
\newcommand*{\Y}{\mathcal{Y}}
\newcommand*{\Yh}{\hat{\Y}}
% Operators.
\DeclareMathOperator{\bnabla}{\bm{\nabla}}
\DeclareMathOperator{\E}{\mathrm{E}}
\renewcommand*{\O}{\mathcal{O}}
\DeclareMathOperator{\Prob}{\mathrm{P}}
\DeclareMathOperator*{\argmax}{arg\,max}
\renewcommand*{\d}[2]{\dfrac{d #1}{d #2}}
\newcommand*{\p}[2]{\dfrac{\partial #1}{\partial #2}}
\DeclareMathOperator{\softmax}{\mathrm{softmax}}
% Matrices.
\newcommand*{\V}{\mathbf{V}}
\newcommand*{\W}{\mathbf{W}}
% Vectors.
\renewcommand*{\b}{\mathbf{b}}
\newcommand*{\cc}{\mathbf{c}}
\newcommand*{\e}{\mathbf{e}}
\newcommand*{\f}{\mathbf{f}}
\newcommand*{\h}{\mathbf{h}}
\newcommand*{\SIGMA}{\bm{\sigma}}
\newcommand*{\THETA}{\bm{\theta}}
\renewcommand*{\v}{\mathbf{v}}
\newcommand*{\w}{\mathbf{w}}
\newcommand*{\x}{\mathbf{x}}
\newcommand*{\dx}{\mathbf{dx}}
\newcommand*{\y}{\mathbf{y}}
\newcommand*{\dy}{\mathbf{dy}}
\newcommand*{\yh}{\hat{\y}}
\newcommand*{\z}{\mathbf{z}}
% LaTeX things.
\renewcommand{\thefootnote}{\fnsymbol{footnote}}
% Links.
\newcommand*{\bluelink}[2]{\href{#1}{\textcolor{blue}{#2}}}
\newcommand*{\blueurl}[1]{\textcolor{blue}{\url{#1}}}
% TikZ commands.
% Entry on a horizontal arrow.
\newcommand{\entry}[2]{
\draw [thick] (#2, \pos - 0.2) -- (#2, \pos + 0.2) node [below, pos=0] {#1};
}
% Args: top left x coordinate, top left y coordinate, size
\newcommand{\featuremap}[3]{\grid{green}{#1}{#2}{#3}}
% Args: top left x coordinate, top left y coordinate
\newcommand{\filter}[2]{\grid{red}{#1}{#2}{5}}
% Args: color, top left x coordinate, top left y coordinate, size
\newcommand{\grid}[4]{
\fill [#1!20] (#2, #3) rectangle (#2 + #4, #3 - #4);
\draw [image] (#2, #3) grid (#2 + #4, #3 - #4);
\draw [very thick] (#2, #3) rectangle (#2 + #4, #3 - #4);
}
% Args: top left x coordinate, top left y coordinate
\newcommand{\image}[2]{\grid{blue}{#1}{#2}{20}}
\newcommand{\mlpblock}{
\begin{block}{}
\vspace{-1em}
\begin{align*}
\hat{y}_k &= \sum_{j=1}^n v_{kj} \sigma\left(\sum_{i=1}^q w_{ji} x_i + b_j\right) + c_k,
\quad
k = 1, \ldots, p \\
L(\y, \yh) &= \frac{1}{p} \sum_{k=1}^p (y_k - \hat{y}_k)^2, \qquad
\p{L}{\hat{y}_k} = \frac{2 (\hat{y}_k - y_k)}{p}
\end{align*}
\end{block}
}
\newcommand{\scale}[2]{
\draw [Latex-Latex, very thick] (-3.6, \pos) -- (3.6, \pos)
node [left, pos=0, align=right] {#1}
node [right, pos=1, align=left] {#2};
}
\newcommand{\smallfilter}[2]{\grid{red}{#1}{#2}{4}}
% Make a variant of \vdots without the top vertical space.
\makeatletter
\DeclareRobustCommand{\vvdots}{%
\vbox{
\baselineskip4\p@\lineskiplimit\z@
\kern-\p@
\hbox{.}\hbox{.}\hbox{.}
}
}
\makeatother
% Theme settings.
\usetheme{Frankfurt}
\usefonttheme{serif}
% Other Beamer settings.
\setbeamercovered{transparent}
\AtBeginSection[]{%
\begin{frame}{Outline}
\tableofcontents[currentsection]
\end{frame}
}
% TikZ commands.
\usetikzlibrary{arrows.meta, positioning}
\tikzset{
onslide/.code args={<#1>#2}{
\only<#1>{\pgfkeysalso{#2}} % \pgfkeysalso doesn't change the path
}
}
\tikzset{
temporal/.code args={<#1>#2#3#4}{
% \pgfkeysalso doesn't change the path
\temporal<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}}{\pgfkeysalso{#4}}
}
}
\tikzstyle{activation} = [draw, block, fill=green!20]
\tikzstyle{affine} = [draw, block, fill=blue!20]
\tikzstyle{block} = [minimum width=7mm, minimum height=7mm, thick, rectangle, rounded corners, font=\small, inner sep=2.5pt]
\tikzstyle{image} = [step=1.5mm, gray, very thin]
\tikzstyle{io} = [neuron, fill=yellow!20]
\tikzstyle{io mini} = [neuron mini, fill=yellow]
\tikzstyle{io mini off} = [neuron mini, fill=yellow!20, draw=black!20]
\tikzstyle{neuron} = [draw, minimum width=5mm, minimum height=5mm, thick, rectangle, rounded corners, inner sep=0pt, fill=red!20]
\tikzstyle{neuron mini} = [draw, minimum width=2mm, minimum height=2mm, circle, inner sep=0pt, fill=red]
\tikzstyle{neuron mini off} = [neuron mini, fill=red!20, draw=black!20]
\tikzstyle{path} = [-Latex, thick]
\tikzstyle{scalar} = [draw, block, fill=yellow!20, text height=1.5ex, text depth=0.25ex]
% Figures.
\graphicspath{{figures/}}
% Title, author, date, classification, etc.
\title{Machine learning \& neural network introduction}
\author[Kevin K. Chen]{%
\texorpdfstring{%
Kevin K. Chen \\
\normalsize \href{%
mailto:[email protected]%
}{%
\textcolor{blue}{\texttt{[email protected]}}%
}%
}{%
Kevin K. Chen%
}%
}
\institute[IDA/CCRL]{Institute for Defense Analyses \\ Center for Communications Research - La Jolla}
\date{February 20, 2018}
% Bibliography commands.
\bibliographystyle{plainnat}
\setcitestyle{round}
\begin{document}
\include{sections/preamble}
\include{sections/introduction}
\include{sections/ml}
\include{sections/loss}
\include{sections/dense}
\include{sections/training}
\include{sections/regularization}
\include{sections/cnn}
\include{sections/advice}
\include{sections/references}
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End: