-
Notifications
You must be signed in to change notification settings - Fork 0
/
ep2017.tex
394 lines (354 loc) · 11.2 KB
/
ep2017.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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
\documentclass[handout]{beamer}
%\usepackage{pgfpages}
%%\setbeameroption{show notes}
%\setbeameroption{show notes on second screen=right}
\setbeamertemplate{caption}[numbered]
\usepackage{tikz}
\usetikzlibrary{calc, matrix, arrows, automata, shapes, positioning, shadows, trees}
\usepackage{graphicx}
\usepackage{multimedia}
\usepackage[latin1]{inputenc}
\usecolortheme{lily}
\setbeamercovered{transparent}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\usepackage{color}
\usepackage{subfigure}
\tikzset{basic/.style={draw}}
\tikzset{input/.style={basic, circle}}
\tikzset{bias/.style={basic, rectangle}}
\tikzset{neuron/.style={basic, circle}}
\tikzset{>=stealth, font=\scriptsize}
\tikzset{sectors/.style n args={2}{%
circle, draw, minimum width=3.444em,
append after command={%
\pgfextra{ %
\draw (\tikzlastnode.north) -- (\tikzlastnode.south);
\path (\tikzlastnode.center) -- node[] {#1} (\tikzlastnode.west);
\path (\tikzlastnode.center) -- node[] {#2} (\tikzlastnode.east);
}
}
}
}
% argmax
\newcommand{\argmax}[1]{\underset{#1}{\operatorname{arg}\,\operatorname{max}}\;}
\title[\insertdate]{Nonparametric Bayes}
\author{Omar Guti\'errez}
\institute{@trinogz}
\date{June 15, 2015}
\begin{document}
\begin{frame}
\titlepage
Mostly based on \textbf{A Tutorial on Bayesian Nonparametric Models} by Samuel J. Gershman.
\end{frame}
\note{
Nothing
}
\begin{frame}
\frametitle{Outline}
\tableofcontents
\end{frame}
\note{
Nothing
}
\section{Introduction}
\begin{frame}{Introduction}
\begin{itemize}
%\item Before to start: Statistics was already there, even before than Machine Learning (ML)
\item What we do in ML is fitting a model to the data
\item That is, we adjust the values of certain parameters
\end{itemize}
\end{frame}
\note{
\begin{itemize}
\item Machine Learning in a nutshell
\begin{itemize}
\item Cloud - Internet
\item Ubiquituos computing - IoT
\item Eigenfaces
\item Statistics - Data Science
\item That is marketing :)
\end{itemize}
\end{itemize}
}
\begin{frame}{Linear Regression}
\begin{figure}[H]
\centering
\input{diagrams/regression.tex}
\caption{Linear Regression}
\end{figure}
\end{frame}
\note{
In linear models, we adjust the $\beta$ values
}
\begin{frame}{Neural Networks}
\begin{figure}[H]
\centering
\input{diagrams/perceptron_and.tex}
\caption{Perceptron}
\end{figure}
\end{frame}
\note{
In neural networks, we adjust the value of the weights.
}
\begin{frame}{Hidden Markov Models}
\begin{figure}[H]
\centering
\input{diagrams/hidden.tex}
\caption{Hidden Markov Models}
\end{figure}
\end{frame}
\note{
In HMM, we adjust the hidden states
}
\begin{frame}{Bertrand Russell\textsc{\char13}s Inductivist Turkey}
\begin{figure}[H]
\centering
\subfigure[One Model]{
\input{diagrams/model_a.tex}
}\quad
\subfigure[Another Model]{
\input{diagrams/model_b.tex}
}
\caption{A comparison of models}
\end{figure}
\end{frame}
\note{
Now that we know more about models, which is the best model?
}
\begin{frame}{Bertrand Russell\textsc{\char13}s Inductivist Turkey}
\begin{figure}[H]
\centering
\subfigure[One Model]{
\input{diagrams/model_c.tex}
}\quad
\subfigure[Another Model]{
\input{diagrams/model_d.tex}
}
\caption{A comparison of models}
\end{figure}
\end{frame}
\note{
Howevers, these models are incomplete
}
\begin{frame}{Bayesian Learning}
\Huge
\begin{equation}
\textcolor{red}{P(h|D)} =
\frac{
\textcolor{green}{P(D|h)}
\textcolor{blue}{P(h)}
}
{\textcolor{brown}{P(D)}}
\end{equation}
\end{frame}
\note{
\begin{itemize}
\item And now, let's talk about the models we are concerned with
\item The interesting facts in our datasets are governed by probabilities distributions ...
\item by reasoning about these probabilities we can do inferences
\item Bayesian reasoning give us a basis to manipulate probabilities
\item Bayesian is not exactly Bayesian, is the same as if we think in we are Newtonian only because we use Calculus
\item $P(h)$ initial probability for hypothesis $h$, prior probability, prior knowledge
\item $P(D)$ prior probability of the trainig data
\item $P(D|h)$ likelihood of $h$
\item $P(h|D)$ posterior probability of ...
\end{itemize}
}
\begin{frame}{Maximum Likelihood Estimation}
\Large
\begin{equation}
\begin{aligned}
h_{MAP} &\equiv \argmax {h \in H} P(h|D)\\
&= \argmax {h \in H} \frac{P(D|h)P(h)}{P(D)}\\
&= \argmax {h \in H} P(D|h)P(h)\\
h_{MLE} &= \argmax {h \in H} P(D|h)
\end{aligned}
\end{equation}
\end{frame}
\note{
\begin{itemize}
\item If you want to learn machine learning put this in your hearth
\item Now we have seen the very basic idea behind Bayes reasoning...
\item ... we will return to this later
\end{itemize}
}
\section{Example: clustering}
\begin{frame}{Data is a mess}
\begin{itemize}
\item The articles in Wikipedia
\item The species in the planet
\item The hashtags on Twitter
\end{itemize}
\end{frame}
\note{
Let's think in the next examples...
The data is evolving
}
\subsection{Traditional Approach}
\begin{frame}{How the problem is \textit{sometimes} addressed}
\begin{itemize}
\item Let's start with the classic approach
\item Let's do clustering
\item Let's use Gaussian Mixture Models (GMM)
\item We can fit several models and then compare them with some metric.
% add an original scatterplot
% add an image with clusters classified
% add an image with BIC
\end{itemize}
\end{frame}
\note{
\begin{itemize}
\item We can use Gaussian Mixture Models
\item How many classes should I use in my mixture model?
\item Do the connection with Maximum Likelihood, EM, and GMM
\item Do the connection with Maximum Likelihood, and linear models
%\item Learning more from the data as we see it.
\end{itemize}
}
\begin{frame}{How the problem is \textit{sometimes} addressed}
\begin{figure}[H]
\centering
\subfigure[2]{
\includegraphics[width=0.30\textwidth]{code/generated_images/bic_compo_2.jpg}
}\quad
\subfigure[3]{
\includegraphics[width=0.30\textwidth]{code/generated_images/bic_compo_3.jpg}
}\quad
\subfigure[4]{
\includegraphics[width=0.30\textwidth]{code/generated_images/bic_compo_4.jpg}
}\quad
\subfigure[5]{
\includegraphics[width=0.30\textwidth]{code/generated_images/bic_compo_5.jpg}
}
\subfigure[6]{
\includegraphics[width=0.30\textwidth]{code/generated_images/bic_compo_6.jpg}
}
\caption{A comparison of clusterings classified with GMM}
\end{figure}
\end{frame}
\begin{frame}{How the problem is \textit{sometimes} addressed}
\begin{figure}[H]
\centering
\includegraphics[width=0.75\textwidth]{code/generated_images/result_bic.jpg}
\caption{Bayesian Information Criterion (BIC)}
\end{figure}
\end{frame}
\subsection{Alternative Approach}
\begin{frame}{How we can \textit{alternatively} approach the problem}
\begin{itemize}
\item Another interesting approach is to use Bayesian Nonparametric (BNP) models
\item BNP models will build a model than can adapt its complexity to the data
\end{itemize}
\end{frame}
\note{
\begin{itemize}
\item Learning more from the data as we see it
\end{itemize}
}
\begin{frame}{Bayesian nonparametric models}
\begin{figure}[H]
\centering
\input{diagrams/bayesian_models.tex}
\end{figure}
\end{frame}
\begin{frame}{Chinese Restaurant Process}
\begin{figure}[H]
\centering
\includegraphics[width=0.75\textwidth]{figures/crp2.png}\par
\end{figure}
\begin{itemize}
\item Infinite number of tables
\item A sequence of customers entering the restaurant and sitting down
\item The first customer enters and sits at the first table
\item The second customer enters and sits...
\begin{itemize}
\item at the first table with probability $\frac{1}{1 + \alpha}$
\item at the second table with probability $\frac{\alpha}{1 + \alpha}$
\end{itemize}
\end{itemize}
\end{frame}
\note{
\begin{itemize}
\item We realize that CRP is a form of clustering: $K$ groups and each group with size $N_k$
\end{itemize}
}
\begin{frame}{How we can \textit{alternatively} approach the problem}
{\centering
\begin{figure}[H]
\includegraphics[width=0.75\textwidth]{code/generated_images/dpgmm.jpg}
\caption{Points classified with Infinite GMM}
\end{figure}
}
\end{frame}
\begin{frame}{What else can be done?}
{\centering
\begin{figure}[H]
\includegraphics[width=0.75\textwidth]{figures/mnist.png}
\caption{Digit recognition (datamicroscopes)}
\end{figure}
}
\end{frame}
\begin{frame}{What else can be done?}
{\centering
\begin{figure}[H]
\includegraphics[width=0.75\textwidth]{figures/topic_modeling.png}
\caption{Topic Modeling (datamicroscopes)}
\end{figure}
}
\end{frame}
\section{Conclusions}
\begin{frame}{Recap: Bayesian parametric vs nonparametric models}
\begin{itemize}
\item Traditional approach (finite)
\begin{itemize}
\item The number of parameters $\theta$ (e.g. clusters) is prespecified
\item We have a prior distribution over parameters $P(\theta)$
\item For example, in the Gaussian mixture model, each cluster will be modelled
using a parametric model (e. g. Gaussian)
\end{itemize}
\item Bayesian nonparametric models
\begin{itemize}
\item We assume that there is an \textbf{infinite} number of latent clusters
\item A finite number of clusters is \textit{inferred} from data
\item The number of clusters grow as new data points are observed
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}{Libraries in Python}
\begin{itemize}
\item Sklearn
\item Datamicroscopes
\end{itemize}
\end{frame}
%\section{Bayesian Inference}
%\begin{frame}{Bayesian Inference}
% \begin{itemize}
% \item $P(A|D) \propto P(D|A) P(A)$
% \end{itemize}
%\end{frame}
%\section{Generative Model}
%\begin{frame}{Generative Model}
% \begin{itemize}
% \item *
% \end{itemize}
%\end{frame}
\begin{frame}{What else to learn?}
\begin{itemize}
\item What is the $\beta$ distribution?
\item What is the Dirichlet distribution?
\item Dirichlet process
\end{itemize}
\end{frame}
\begin{frame}{References}
\begin{itemize}
\item \textbf{Machine Learning} by Tom Mitchell
\item \textbf{A Tutorial on Bayesian Nonparametric Models} by Samuel J. Gershman
\item \textbf{datamicroscopes} library
\end{itemize}
\end{frame}
\begin{frame}
\huge{Thank you}\\
\huge{Questions?}\\
\end{frame}
\end{document}