diff --git a/notes/11_density-est/1_kde.tex b/notes/11_density-est/1_kde.tex new file mode 100644 index 0000000..50d11fb --- /dev/null +++ b/notes/11_density-est/1_kde.tex @@ -0,0 +1,72 @@ +\begin{frame} +\end{frame} + +\begin{frame} + +\section{Density Estimation: What and Why?} +\notesonly{ +We observe data. +This data is generated by some unknown probability distribution. Each observation is a sample from this distrubtion. +When we talk about density estimation, we are talking about recovering the underlying probability density function that produced te observed samples. +} + +\question{Why do we care about estimating densities? What can we do with an estimated density?} + +\begin{itemize} +\item data exploration +\item visualization (for 1D and 2D data) +\item deduce moments (mean, variance, \ldots) +\item describe the data in compact form (e.g. this data follows a Gaussian with mean $\mu$ and covariance $\vec \Sigma$) +\item generate new data +\item unsupervised anomaly detection +\end{itemize} + +\end{frame} + +\begin{frame} + +\underline{Density Estimation: How?} + +2 strategies: + +\begin{enumerate}[(A)] +\item \textbf{parametric} methods: +\\ We assume that the data follows some class of distribution and we estimate its paramters (e.g. fit a Gaussian around this data) +\item \textbf{non-parametric}\footnote{non-parametric does not means it is void of paramters. +It is just that the parameters do not directly correspond to the classical parameters of densities such as mean and variance.} methods: +data-driven. Estimate the density with as few assumptions as possible (e.g. Kernel\footnote{Not tied to Mercer Kernels like in Kernel PCA. A kernel is just some non-negative function.} density estimation) +\end{enumerate} + +\end{frame} + +Many people habe already encountered density estimation in the form of histograms. + +\begin{frame} +\end{frame} + +\begin{frame} + +\begin{figure}[ht] + \centering + \savebox{\imagebox}{\includegraphics[width=0.4\textwidth]{img/spiral_data.png}}% + \begin{subfigure}[t]{0.4\textwidth} + \centering + \usebox{\imagebox}% Place largest image + \caption{original observations $\vec x$} + \label{fig:spiral_data} + \end{subfigure} + \hfill + \begin{subfigure}[t]{0.35\textwidth} + \centering + \raisebox{\dimexpr.5\ht\imagebox-.5\height}{% Raise smaller image into place + \includegraphics[width=\textwidth]{img/spiral_pca.png} + } + \caption{projection onto the first 2 PCs} + \label{fig:spiral_pca} + \end{subfigure} + \caption{Dimensionality reduction of ``spiral data''. Points are colored according to their index in the dataset.} + \label{fig:spiral} +\end{figure} + +\end{frame} + diff --git a/notes/11_density-est/Makefile b/notes/11_density-est/Makefile new file mode 100644 index 0000000..dfe51f7 --- /dev/null +++ b/notes/11_density-est/Makefile @@ -0,0 +1,40 @@ +all: slides notes clean +#all: handout + +projname = tutorial +targetname = $(projname)_$(shell basename $(CURDIR)) +compile = pdflatex +projnameS = $(projname).slides +projnameH = $(projname).handout +projnameA = $(projname).notes + +slides: $(projname).slides.tex $(projname).tex + $(compile) $(projname).slides.tex +# bibtex $(projname).slides +# $(compile) --interaction=batchmode $(projname).slides.tex +# $(compile) --interaction=batchmode $(projname).slides.tex + mv $(projname).slides.pdf $(targetname).slides.pdf + +handout: $(projname).handout.tex $(projname).tex + $(compile) $(projname).handout.tex + mv $(projname).handout.pdf $(targetname).handout.pdf + +# Repeat compilation for the references to show up correctly +notes: $(projname).notes.tex $(projname).tex + $(compile) $(projname).notes.tex +# bibtex $(projname).notes +# $(compile) --interaction=batchmode $(projname).notes.tex + $(compile) --interaction=batchmode $(projname).notes.tex + mv $(projname).notes.pdf $(targetname).notes.pdf + +clean: cleans cleanh cleana + +cleans: + rm -f $(projnameS).aux $(projnameS).bbl $(projnameS).log $(projnameS).out $(projnameS).toc $(projnameS).lof $(projnameS).glo $(projnameS).glsdefs $(projnameS).idx $(projnameS).ilg $(projnameS).ind $(projnameS).loa $(projnameS).lot $(projnameS).loe $(projnameS).snm $(projnameS).nav + +cleanh: + rm -f $(projnameH).aux $(projnameH).bbl $(projnameH).log $(projnameH).out $(projnameH).toc $(projnameH).lof $(projnameH).glo $(projnameH).glsdefs $(projnameH).idx $(projnameH).ilg $(projnameH).ind $(projnameH).loa $(projnameH).lot $(projnameH).loe $(projnameH).snm $(projnameH).nav + +cleana: + rm -f $(projnameA).aux $(projnameA).bbl $(projnameA).log $(projnameA).out $(projnameA).toc $(projnameA).lof $(projnameA).glo $(projnameA).glsdefs $(projnameA).idx $(projnameA).ilg $(projnameA).ind $(projnameA).loa $(projnameA).lot $(projnameA).loe $(projnameA).snm $(projnameA).nav + diff --git a/notes/11_density-est/beamercolorthemetub.sty b/notes/11_density-est/beamercolorthemetub.sty new file mode 100644 index 0000000..c41d22a --- /dev/null +++ b/notes/11_density-est/beamercolorthemetub.sty @@ -0,0 +1,48 @@ +% Copyright 2004 by Madhusudan Singh +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Public License. +% +% See the file doc/licenses/LICENSE for more details. + +%\ProvidesPackageRCS $Header: beamercolorthemetub.sty, v a01 2011/11/18 09:11:41 tujl $ + +\mode + +\definecolor{darkred}{rgb}{0.8,0,0} + +\setbeamercolor{section in toc}{fg=black,bg=white} +\setbeamercolor{alerted text}{fg=darkred!80!gray} + +\setbeamercolor*{palette primary}{fg=darkred!60!black,bg=gray!30!white} +\setbeamercolor*{palette secondary}{fg=darkred!70!black,bg=gray!15!white} +\setbeamercolor*{palette tertiary}{bg=darkred!80!black,fg=gray!10!white} +\setbeamercolor*{palette quaternary}{fg=darkred,bg=gray!5!white} + +\setbeamercolor*{sidebar}{fg=darkred,bg=gray!15!white} + +\setbeamercolor*{palette sidebar primary}{fg=darkred!15!black} +\setbeamercolor*{palette sidebar secondary}{fg=white} +\setbeamercolor*{palette sidebar tertiary}{fg=darkred!50!black} +\setbeamercolor*{palette sidebar quaternary}{fg=gray!15!white} + +%\setbeamercolor*{titlelike}{parent=palette primary} +\setbeamercolor{titlelike}{parent=palette primary,fg=darkred} +\setbeamercolor{frametitle}{bg=gray!15!white} +\setbeamercolor{frametitle right}{bg=gray!60!white} + +%\setbeamercolor{Beispiel title}{bg=white,fg=black} + +\setbeamercolor*{separation line}{} +\setbeamercolor*{fine separation line}{} + +%\setbeamercolor{itemize item}{fg=darkred,bg=white} +%\setbeamercolor{itemize subitem}{fg=darkred!60!white,bg=white} +%\setbeamercolor{local structure}{fg=darkred,bg=white} +\setbeamercolor{local structure}{fg=gray,bg=white} +\setbeamercolor{structure}{fg=darkred!80!black,bg=white} +\setbeamercolor{block title}{bg=gray!10!white} +\mode + diff --git a/notes/11_density-est/beamerthemeTUBerlin.sty b/notes/11_density-est/beamerthemeTUBerlin.sty new file mode 100644 index 0000000..1ce3fd7 --- /dev/null +++ b/notes/11_density-est/beamerthemeTUBerlin.sty @@ -0,0 +1,22 @@ +% Copyright 2004 by Madhusudan Singh +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Public License. +% +% See the file doc/licenses/LICENSE for more details. + +%\ProvidesPackageRCS $Header: beamerthemeTUBerlin.sty, v a01 2011/11/18 09:11:41 tujl $ +\mode + +\useinnertheme[shadow=true]{rounded} +\useoutertheme{infolines} +\usecolortheme{tub} + +\setbeamerfont{frametitle}{size=\normalsize} +\setbeamerfont{block title}{size={}} +%\setbeamerfont{structure}{series=\bfseries} +\setbeamercolor{titlelike}{parent=structure,bg=white} +\mode + diff --git a/notes/11_density-est/bibliography.bib b/notes/11_density-est/bibliography.bib new file mode 100644 index 0000000..948691f --- /dev/null +++ b/notes/11_density-est/bibliography.bib @@ -0,0 +1,29 @@ +@book{sutton1998introduction, + title={Introduction to reinforcement learning}, + author={Sutton, Richard S and Barto, Andrew G and others}, + volume={135}, + year={1998}, + publisher={MIT press Cambridge} +} +@Book{Bertsekas07, + author = {D. P. Bertsekas}, + title = {Dynamic Programming and Optimal Control}, + publisher ={Athena Scientific}, + year = {2007}, + volume = {2}, + edition = {3rd}, + url = {http://www.control.ece.ntua.gr/UndergraduateCourses/ProxTexnSAE/Bertsekas.pdf} +} +@Article{Watkins92, + author = {C. Watkins and P. Dayan}, + title = {Q-learning}, + journal = {Machine Learning}, + year = {1992}, + OPTkey = {}, + volume = {8}, + OPTnumber = {}, + pages = {279--292}, + OPTmonth = {}, + OPTnote = {}, + OPTannote = {} +} diff --git a/notes/11_density-est/img/clustering.pdf b/notes/11_density-est/img/clustering.pdf new file mode 100644 index 0000000..4e3bd7d Binary files /dev/null and b/notes/11_density-est/img/clustering.pdf differ diff --git a/notes/11_density-est/img/clustering_soft.pdf b/notes/11_density-est/img/clustering_soft.pdf new file mode 100644 index 0000000..54e4498 Binary files /dev/null and b/notes/11_density-est/img/clustering_soft.pdf differ diff --git a/notes/11_density-est/img/fig3_lle_intro_cropped.png b/notes/11_density-est/img/fig3_lle_intro_cropped.png new file mode 100644 index 0000000..6d53a50 Binary files /dev/null and b/notes/11_density-est/img/fig3_lle_intro_cropped.png differ diff --git a/notes/11_density-est/img/fig3_lle_intro_cropped_pca.png b/notes/11_density-est/img/fig3_lle_intro_cropped_pca.png new file mode 100644 index 0000000..19ddace Binary files /dev/null and b/notes/11_density-est/img/fig3_lle_intro_cropped_pca.png differ diff --git a/notes/11_density-est/img/s_data_pca.png b/notes/11_density-est/img/s_data_pca.png new file mode 100644 index 0000000..29ecfdc Binary files /dev/null and b/notes/11_density-est/img/s_data_pca.png differ diff --git a/notes/11_density-est/img/s_data_proj.png b/notes/11_density-est/img/s_data_proj.png new file mode 100644 index 0000000..a3b695e Binary files /dev/null and b/notes/11_density-est/img/s_data_proj.png differ diff --git a/notes/11_density-est/img/section4_fig11.pdf b/notes/11_density-est/img/section4_fig11.pdf new file mode 100644 index 0000000..b4e8746 Binary files /dev/null and b/notes/11_density-est/img/section4_fig11.pdf differ diff --git a/notes/11_density-est/img/section4_fig11_K2.pdf b/notes/11_density-est/img/section4_fig11_K2.pdf new file mode 100644 index 0000000..8173416 Binary files /dev/null and b/notes/11_density-est/img/section4_fig11_K2.pdf differ diff --git a/notes/11_density-est/img/section4_fig11_fgh.pdf b/notes/11_density-est/img/section4_fig11_fgh.pdf new file mode 100644 index 0000000..7e75b30 Binary files /dev/null and b/notes/11_density-est/img/section4_fig11_fgh.pdf differ diff --git a/notes/11_density-est/img/section4_fig11_fghi.pdf b/notes/11_density-est/img/section4_fig11_fghi.pdf new file mode 100644 index 0000000..272b568 Binary files /dev/null and b/notes/11_density-est/img/section4_fig11_fghi.pdf differ diff --git a/notes/11_density-est/img/section4_fig11_ghi.pdf b/notes/11_density-est/img/section4_fig11_ghi.pdf new file mode 100644 index 0000000..8f73262 Binary files /dev/null and b/notes/11_density-est/img/section4_fig11_ghi.pdf differ diff --git a/notes/11_density-est/img/section4_fig2_nocaption.pdf b/notes/11_density-est/img/section4_fig2_nocaption.pdf new file mode 100644 index 0000000..5e852b7 Binary files /dev/null and b/notes/11_density-est/img/section4_fig2_nocaption.pdf differ diff --git a/notes/11_density-est/img/section4_fig2_withincluster.pdf b/notes/11_density-est/img/section4_fig2_withincluster.pdf new file mode 100644 index 0000000..a05aada Binary files /dev/null and b/notes/11_density-est/img/section4_fig2_withincluster.pdf differ diff --git a/notes/11_density-est/img/section4_fig4.pdf b/notes/11_density-est/img/section4_fig4.pdf new file mode 100644 index 0000000..ef9bc6d Binary files /dev/null and b/notes/11_density-est/img/section4_fig4.pdf differ diff --git a/notes/11_density-est/img/spiral_data.png b/notes/11_density-est/img/spiral_data.png new file mode 100644 index 0000000..f1d774b Binary files /dev/null and b/notes/11_density-est/img/spiral_data.png differ diff --git a/notes/11_density-est/img/spiral_pca.png b/notes/11_density-est/img/spiral_pca.png new file mode 100644 index 0000000..bbb6946 Binary files /dev/null and b/notes/11_density-est/img/spiral_pca.png differ diff --git a/notes/11_density-est/tutorial.handout.tex b/notes/11_density-est/tutorial.handout.tex new file mode 100644 index 0000000..c016f5c --- /dev/null +++ b/notes/11_density-est/tutorial.handout.tex @@ -0,0 +1,14 @@ +\documentclass[handout,ignorenonframetext]{beamer} +\newcounter{baslide} +\setcounter{baslide}{1} + +\let\oldframe +\frame +\let\oldendframe +\endframe + +\def\frame{\oldframe \label{baslide\roman{baslide}}% +\addtocounter{baslide}{1}} +\def\endframe{\oldendframe} + +\input{tutorial} diff --git a/notes/11_density-est/tutorial.notes.tex b/notes/11_density-est/tutorial.notes.tex new file mode 100644 index 0000000..c5da1a8 --- /dev/null +++ b/notes/11_density-est/tutorial.notes.tex @@ -0,0 +1,17 @@ +\documentclass{../../latex/minotes} +\input{../../latex/customcommands} + +\numberwithin{equation}{section} +\numberwithin{figure}{section} + +\let\oldframe\frame +\let\oldendframe\endframe + +\newcommand{\notesonly}[1]{#1} + +\newcommand{\mystackrel}[2]{\stackrel{\mathmakebox[\widthof{#1}]{#2}}{=}} + +% frame titles only effective in presentation mode +\renewcommand{\frametitle}[1]{} + +\input{tutorial} diff --git a/notes/11_density-est/tutorial.slides.tex b/notes/11_density-est/tutorial.slides.tex new file mode 100644 index 0000000..5a3735c --- /dev/null +++ b/notes/11_density-est/tutorial.slides.tex @@ -0,0 +1,11 @@ +\input{../../latex/headerMIslides} +\input{../../latex/customcommands} + +\subtitle{1.1 Intro \& 1.2 Connectionist Neuron} +\mathtoolsset{showonlyrefs} + +\newcommand{\slidesonly}[1]{#1} + +\newcommand{\mystackrel}[2]{\stackrel{\mathmakebox[\widthof{#1}]{#2}}{=}} + +\input{tutorial} diff --git a/notes/11_density-est/tutorial.tex b/notes/11_density-est/tutorial.tex new file mode 100644 index 0000000..0fa04db --- /dev/null +++ b/notes/11_density-est/tutorial.tex @@ -0,0 +1,80 @@ +\usepackage[authoryear,round]{natbib} +\usepackage{multirow} + +\newcommand{\sheetnum}{% + 11 +} +%\setcounter{section}{\sheetnum-3} +\newcommand{\tutorialtitle}{% + Density Estimation and Estimation bias +} +\newcommand{\tutorialtitleshort}{% + Density Estimation +} +% for slides +\subtitle{\sheetnum \tutorialtitle} + +%\maxdeadcycles=1000 % Workaround for ! Output loop---100 consecutive dead cycles because of too many figures + +% The following use of algroithms does not work well with the notes: +% +% +% +% +% instead use the following for your algorithms: +% +%\begin{figure}[!t] +%\removelatexerror +%\begin{algorithm}[H] + % your algo here + %\label{alg:algolabel} + %\caption{algocaption} +%\end{algorithm} +%\end{figure} +%\begin{algorithm} +% Below is the definition for the command \removelatexerror: +\makeatletter +\newcommand{\removelatexerror}{\let\@latex@error\@gobble} +\makeatother + +\begin{document} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\sheet{\sheetnum}{\tutorialtitleshort} + +\ttopic{\tutorialtitle} + +\columnratio{0.2,0.8}\textbf{} +\begin{paracol}{2} +%\setlength{\columnseprule}{0.1pt} +%\setlength{\columnsep}{5em} + +\begin{rightcolumn} + +% notes version will ignore it +\begin{frame} +\titlepage +\end{frame} + +\begin{frame} +\tableofcontents +\end{frame} + +\newpage + +\mode +\input{./1_kde} +\mode* + +\clearpage + +%\section{References} +%\begin{frame}[allowframebreaks] \frametitle{References} + %\scriptsize + %\bibliographystyle{plainnat} + %\bibliography{bibliography} +%\end{frame} + +\end{rightcolumn} +\end{paracol} + +\end{document}