diff --git a/Glossary.tex b/Glossary.tex index efc49e4..142ef49 100644 --- a/Glossary.tex +++ b/Glossary.tex @@ -6,6 +6,7 @@ \shorthandon{"} % {{{ Main glossary% + \newglossaryentry{overfitting}{ name=Overfitting, description={ @@ -56,11 +57,57 @@ beeinflussen sich dabei aber nicht.} (\url{https://de.wikipedia.org/wiki/Unabh\%C3\%A4ngig_und_identisch_verteilte_Zufallsvariablen}) } } + +\newglossaryentry{closed_form_solution}{ + name=Closed Form Solution, + description={ + \say{In mathematics, + a closed-form expression is a mathematical expression + that uses a finite number of standard operations. + It may contain constants, variables, certain well-known operations (e.g. $+$ $-$ $\cdot$ $\div$), + and functions (e.g. n-th root, exponent, logarithm, trigonometric functions, and inverse hyperbolic functions), + but usually no limit, differentiation, or integration. + The set of operations and functions may vary with author and context.} + (\url{https://en.wikipedia.org/wiki/Closed-form_expression})\\ + \say{An equation is said to be a closed-form solution if it solves a given problem in terms of functions and mathematical operations from a given generally-accepted set. + For example, an infinite sum would generally not be considered closed-form. + However, the choice of what to call closed-form and what not is rather arbitrary since a new "closed-form" function could simply be defined in terms of the infinite sum. } + (\url{https://mathworld.wolfram.com/Closed-FormSolution.html}) + } +} + +\newglossaryentry{latent_variable_model}{ + name= Latent Variable Model, + description={ + \say{Ein latentes Variablenmodell beschreibt den Zusammenhang zwischen beobachtbaren (oder manifesten) Variablen und dahinter liegenden latenten Variablen. + Ein Beispiel für eine latente Variable ist die Intelligenz. + Sie kann nicht direkt gemessen werden, + aber aus einer Vielzahl von Testergebnissen (den beobachtbaren Variablen) + können eine oder mehrere hinter den Testergebnissen liegende latente Variablen (Intelligenz) extrahiert werden.} + (\url{https://de.wikipedia.org/wiki/Latentes_Variablenmodell}) + } +} % }}} % % {{{ acronyms% +% {{{ acronym makros % +\newcommand{\glstopfull}[1]{\texorpdfstring{\glsxtrfull{#1}}{\glsfmtfull{#1}}} +\newcommand{\Glstopfull}[1]{\texorpdfstring{\Glsxtrfull{#1}}{\Glsfmtfull{#1}}} +\newcommand{\glstopfullpl}[1]{\texorpdfstring{\glsxtrfullpl{#1}}{\glsfmtfullpl{#1}}} +\newcommand{\Glstopfullpl}[1]{\texorpdfstring{\Glsxtrfullpl{#1}}{\Glsfmtfullpl{#1}}} +\newcommand{\glstopshort}[1]{\texorpdfstring{\glsxtrshort{#1}}{\glsfmtshort{#1}}} +\newcommand{\Glstopshort}[1]{\texorpdfstring{\Glsxtrshort{#1}}{\Glsfmtshort{#1}}} +\newcommand{\glstopshortpl}[1]{\texorpdfstring{\glsxtrshortpl{#1}}{\glsfmtshortpl{#1}}} +\newcommand{\Glstopshortpl}[1]{\texorpdfstring{\Glsxtrshortpl{#1}}{\Glsfmtshortpl{#1}}} +\newcommand{\glstoplong}[1]{\texorpdfstring{\glsxtrlong{#1}}{\glsfmtlong{#1}}} +\newcommand{\Glstoplong}[1]{\texorpdfstring{\Glsxtrlong{#1}}{\Glsfmtlong{#1}}} +\newcommand{\glstoplongpl}[1]{\texorpdfstring{\glsxtrlongpl{#1}}{\glsfmtlongpl{#1}}} +\newcommand{\Glstoplongpl}[1]{\texorpdfstring{\Glsxtrlongpl{#1}}{\Glsfmtlongpl{#1}}} +% }}} % \setabbreviationstyle[acronym]{long-short} +\newacronym{KL}{KL}{Kullback-Leibler} +\newacronym{EM}{EM}{Expectation Maximization} \newacronym{PCA}{PCA}{Principal Component Analysis} \newacronym{GRU}{GRU}{Gated Recurrent Units} \newacronym{LSTM}{LSTM}{Long-term Short-term Memory} @@ -121,10 +168,11 @@ \newcommand{\nomeq}[1]{\glslink{#1}{\glsentrysymbol{#1}}} % }}} Nomencalture Commands % -\newnom{summed_squared_error}{\gls{SSE}}{\text{\glsxtrshort{SSE}}}{\glsxtrfull{SSE}} -\newnom{sum_of_squared_distances}{\gls{SSD}}{\text{\glsxtrshort{SSD}}}{\glsxtrfull{SSD}} -\newnom{mean_squared_error}{\gls{MSE}}{\text{\glsxtrshort{MSE}}}{\glsxtrfull{MSE}} -\newnom{residual_sum_squares}{\gls{RSS}}{\text{\glsxtrshort{RSS}}}{\glsxtrfull{RSS}} +\newnom{kl_divergence}{\glsxtrshort{KL}-Divergenz}{\text{\glsxtrshort{KL}}}{\nameref{sec:KL-Divergenz}(\cref{sec:KL-Divergenz})} +\newnom{summed_squared_error}{\glsxtrshort{SSE}}{\text{\glsxtrshort{SSE}}}{\glsxtrlong{SSE}} +\newnom{sum_of_squared_distances}{\glsxtrshort{SSD}}{\text{\glsxtrshort{SSD}}}{\glsxtrlong{SSD}} +\newnom{mean_squared_error}{\glsxtrshort{MSE}}{\text{\glsxtrshort{MSE}}}{\glsxtrlong{MSE}} +\newnom{residual_sum_squares}{\glsxtrshort{RSS}}{\text{\glsxtrshort{RSS}}}{\glsxtrlong{RSS}} \newnom{gaussian_noise}{Gausches Rauschen}{\epsilon}{zufällige (normalverteilte) Abweichung} \newnom{vector_valued_function}{vektorwertige Funktion}{\bm\phi(\bm{x})}{vektorwertige Funktion der des Eingangsvektor $\bm{x}$} \newnom{regularization_factor}{Regularisierungsfaktor}{\lambda}{} @@ -146,7 +194,7 @@ \newnom{gaussian_process}{Gaußscher Prozess}{\mathcal{GP}}{} \newnom{hyper_parameters}{Hyper"~Parameter}{\bm{\beta}}{} \newnom{activation_function}{Aktivierungsfunktion}{\phi}{} -\newnom{dirac_delta}{Dirac Delta Function}{\delta}{$\delta_{ij} = \begin{cases} 1, &\text{ if }i = j\\ 0, &\text{ sonst } \end{cases}} +\newnom{dirac_delta}{Dirac Delta Function}{\delta}{$\delta_{ij} = \begin{cases} 1, &\text{ if }i = j\\ 0, &\text{ sonst } \end{cases}$} % }}} % \shorthandoff{"} diff --git a/ML_Zusammenfassung.tex b/ML_Zusammenfassung.tex index 0e785ff..0a6f935 100644 --- a/ML_Zusammenfassung.tex +++ b/ML_Zusammenfassung.tex @@ -42,6 +42,7 @@ chapters/Classical_Unsupervised_Learning/Dimensionality_Reduction, chapters/Classical_Unsupervised_Learning/Clustering, chapters/Classical_Unsupervised_Learning/Density_Estimation, + chapters/Classical_Unsupervised_Learning/Expectation_Maximization, chapters/Classical_Unsupervised_Learning/Variational_Auto-Encoders, % %Mathematische_Grundlagen %chapters/Mathematische_Grundlagen/Lineare_Algebra, @@ -100,6 +101,7 @@ \include{chapters/Classical_Unsupervised_Learning/Dimensionality_Reduction.tex} \include{chapters/Classical_Unsupervised_Learning/Clustering.tex} \include{chapters/Classical_Unsupervised_Learning/Density_Estimation.tex} + \include{chapters/Classical_Unsupervised_Learning/Expectation_Maximization.tex} \include{chapters/Classical_Unsupervised_Learning/Variational_Auto-Encoders.tex} \part{Mathematische Grundlagen} diff --git a/chapters/Classical_Supervised_Learning/Linear_Classification.tex b/chapters/Classical_Supervised_Learning/Linear_Classification.tex index f03ae04..c0e0fa6 100644 --- a/chapters/Classical_Supervised_Learning/Linear_Classification.tex +++ b/chapters/Classical_Supervised_Learning/Linear_Classification.tex @@ -138,7 +138,7 @@ obwohl es eigentlich eine Klasifizierung ist (alte Funktion; früher war man bei \end{equation} Für diese Funktion kann gezeigt werden, dass sie konvex ist (es existiert nur ein globales Maximum). -Allerdings handelt es sich anders als bei der linearen Regression (\cref{cha:Linear Regression}) nicht um eine \say{Closed Form Solution}, +Allerdings handelt es sich anders als bei der linearen Regression (\cref{cha:Linear Regression}) nicht um eine \say{\gls{closed_form_solution}}, was bedeutet, dass hier der \nameref{sec:Gradient Descent} für die Optimierung verwendet wird. diff --git a/chapters/Classical_Unsupervised_Learning/Clustering.tex b/chapters/Classical_Unsupervised_Learning/Clustering.tex index 7069e43..ddf51ce 100644 --- a/chapters/Classical_Unsupervised_Learning/Clustering.tex +++ b/chapters/Classical_Unsupervised_Learning/Clustering.tex @@ -6,8 +6,8 @@ dass die Auswahl der Ähnlichkeit sehr subjektiv sein kann. Das Ziel ist es ein Ähnlichkeitsmaß zu finden, dass die Datenpunkte in die vom Anwender gewünschten Gruppen clustert. -\section{K-Means Lagorithm}% -\label{sec:K-Means Lagorithm} +\section{K-Means Algorithm}% +\label{sec:K-Means Algorithm} Das Ziel des K-Means Algorithmus ist es eine vorgegebene Anzahl an Clustern zu finden. Das Ziel ist es die \gls{SSD} zu reduzieren. \begin{equation} \label{eq:SSD} @@ -70,7 +70,7 @@ Das Ziel ist es die \gls{SSD} zu reduzieren. \end{subfigure} \caption{K-Means Algorithmus in Aktion} - \label{fig:} + \label{fig:k-means_algorithm_in_action} \end{figure} \subsection{Konvergenz}% diff --git a/chapters/Classical_Unsupervised_Learning/Density_Estimation.tex b/chapters/Classical_Unsupervised_Learning/Density_Estimation.tex index 9c36775..ef7e5ba 100644 --- a/chapters/Classical_Unsupervised_Learning/Density_Estimation.tex +++ b/chapters/Classical_Unsupervised_Learning/Density_Estimation.tex @@ -131,4 +131,27 @@ Die Verteilung des Mixture Models berechnet sich hierbei als Summe der Teilverte \subsection{\texorpdfstring{\glsxtrfullpl{GMM}}{\glsfmtfullpl{GMM}}}% \label{sub:GMMs} -\includegraphics[scale = .6]{GMMs.png} +\includegraphics[scale = .6]{GMMs.png}\\ +Die \glslink{marginal}{marginal} Log-Likelihood (\cref{sec:Example: Gaussian Distribution}) für $N$ \gls{iid} Datenpunkte ist gegeben durch +\begin{equation} \label{eq:maximum_likelihood_for_GMM} + \mathcal L = \log L(\bm\theta) = \sum_{i=1}^N \log \underbrace{p_{\bm\theta}(\bm x_i)}_{\text{marginal}} + = \sum_{i=1}^N \log \underbrace{\left( \sum_{k=1}^K \pi_k \nomeq{gaussian_distribution}(\bm x_i|\bm\mu_k,\nomeq{covariance}_k) \right)}_{\text{non-exponential family}} +\end{equation} +Um einen \nameref{cha:Gradient Descent} (\cref{cha:Gradient Descent}) auf diesen Daten durchzuführen, +muss geprüft werden, +ob sich diese Funktion differenzieren lässt. +\begin{align} \label{eq:GMM_gradient_descent} + \frac{\partial\mathcal L}{\partial \bm\mu_j} + &= \sum_{i=1}^N \frac{\pi_j\nomeq{gaussian_distribution}(\bm x_i|\bm\mu_j,\nomeq{covariance}_j)} + {\sum_{k=1}^K \pi_k\nomeq{gaussian_distribution}(\bm x_i|\bm\mu_k,\nomeq{covariance}_k)}\nomeq{covariance}_j^{-1}(\bm x_i - \bm\mu_j)\\ + &= \dots \text{ \color{red} Herleitung Vorlesung 11 Folie 7 }\\ + &= \sum_{i=1}^N \nomeq{covariance}_j^{-1} (\bm x_i - \bm\mu_j)p(j|\bm x_i) +\end{align} +Dies zeigt, +dass der Einsatz des \nameref{cha:Gradient Descent} Verfahrens für \glspl{GMM} zwar möglich ist, +aber der Gradient von allen anderen Komponenten abhängig ist. +Zudem hat er keine \gls{closed_form_solution}, +weshalb kein anderes (in der Vorlesung behandeltes) Verfahren als der \nameref{cha:Gradient Descent} in Frage kommt. +Leider ist hierbei die Konvergenz meist sehr langsam. +Die goto-Lösung für dieses Problem ist das \nameref{cha:Expectation Maximization} Verfahren (\cref{sec:Expectation Maximization for GMMs}). + diff --git a/chapters/Classical_Unsupervised_Learning/Expectation_Maximization.tex b/chapters/Classical_Unsupervised_Learning/Expectation_Maximization.tex new file mode 100644 index 0000000..9fba7d3 --- /dev/null +++ b/chapters/Classical_Unsupervised_Learning/Expectation_Maximization.tex @@ -0,0 +1,208 @@ +\chapter{\glstopfull{EM}}% +\label{cha:Expectation Maximization} +\gls{EM} ist ein Verfahren zur Optimierung, +welches auf alle \glspl{latent_variable_model} angewandt werden kann, +wobei jedes \gls{latent_variable_model} bekannte Variablen $\bm x$ und unbekannte Variablen $\bm z$ enthält. +Hierdurch ergibt sich +\begin{itemize} + \item Parametric model:\tabto{4cm}$p_{\bm\theta}(\bm x,\bm z)$ + \item \glslink{marginal}{Marginal distribution}:\tabto{4cm}$\underbrace{p_{\bm\theta}(\bm x) = \sum_z p(\bm x,z)}_{\text{discrete latent variable}}, + \qquad \underbrace{p_{\bm\theta} = \int_{\bm z} p_{\bm\theta}(\bm x,\bm z) d\bm z}_{\text{continuous latent variable}} $ +\end{itemize} +Das Ziel ist es die (\glslink{marginal}{marginal}) Log-Likelihood +\begin{equation} \label{eq:latent_variable_model_marginal_log-likelihood} + L(\bm\theta) = \sum_{i=1}^N \log p_{\bm\theta}(\bm x_i) = \sum_{i=1}^N \log \left( \sum_z p_{\bm\theta}(\bm x_i,z) \right) +\end{equation} +zu optimieren. +Zwei Verfahren für die Durchführung der \gls{EM} sind bekannt, +wobei in der Vorlesung nur auf die \nameref{sec:Decomposition in lower-bound and KL-term} eingegangen wird. +Bei der \gls{EM} handelt es sich um ein Verfahren, +welches lediglich ein lokales Optimum findet, +weshalb die Initialisierung sehr wichtig ist. +Hierbei werden die Cluster-Mittelpunkte meist über den \nameref{sec:K-Means Algorithm}us approximiert und ein fester Wert für die Kovarianzen gewählt. + +\section{Decomposition in lower-bound and \glstopshort{KL}-term}% +\label{sec:Decomposition in lower-bound and KL-term} +Die \glslink{marginal}{Marginal} Log-Likelihood eines \gls{latent_variable_model}s lässt sich wie folgt zerlegen (Herleitung: {\color{red}Vorlesung 11 Folie 24}) +\begin{align} \label{eq:decomposition_in_lower-bound_and_KL-term} + \underbrace{\log p(\bm x|\bm\theta)}_{\text{\glslink{marginal}{marginal} log-like}} + &= \mathcal L(q|\bm\theta) + \nomeq{kl_divergence}(q(z)\|p(z|\bm x))\\ + &= \underbrace{\sum_z q(z)\log \frac{p(\bm x,z|\bm\theta)}{q(z)}}_{\text{Lower-Bound $\mathcal L(q,\bm\theta)$}} + + \underbrace{\sum_z q(z)\log \frac{q(z)}{p(z|\bm x)}}_{\text{\noms{kl_divergence}: $\nomeq{kl_divergence}(q(z)\|p(z|\bm x))$}} +\end{align} +Nach dieser Zerlegung wird die \gls{EM} zu einem iterativen Verfahren mit 2 Schritten (\nameref{sub:Expectation-Step} und \nameref{sub:Maximization-Step}). +Dieses Verfahren funktioniert auch, +wenn nicht nur ein einzelner Datenpunkt $\bm x$ betrachtet wird. +Für einen Datensatz mit mehreren Datenpunkten definiert sich die Lower-Bound Funktion durch +\begin{equation} \label{eq:lower-bound_for_dataset} + \mathcal L(q,\bm\theta) = \sum_i \left( \int_z q_i(z)\log p(\bm x_i,z|\bm\theta)dz - \int_z q_i(z)\log q_i(z)dz \right) +\end{equation} +\begin{itemize} + \item eine latente Variable $z_i$ für jeden Datenpunkt $\bm x_i$ + \item wenn $z$ diskret mit $K$ verschiedenen Werten ist, gilt $q_i(z=k) = p(z=k|\bm x_i,\bm\theta_{\text{old}})$. + Dies kann als eine $N\times K$ Matrix dargestellt werden. +\end{itemize} + +\subsection{Expectation-Step}% +\label{sub:Expectation-Step} +Der Expectation-Step ist der erste der 2 Schritte der \gls{EM} mit \nameref{sec:Decomposition in lower-bound and KL-term}. +Hierbei ist es das Ziel, +das $q(z)$ zu finden, +welches die \gls{KL} Divergenz (\cref{sec:KL-Divergenz}) minimiert. +\begin{equation} \label{eq:expectation_step} + q(z) = \argmin_q \nomeq{kl_divergence}(q(z)\|p(z|\bm x)) +\end{equation} +Für diskrete $z$ (z.B. bei \nameref{sec:Mixture Models}) hat dieses Problem eine \gls{closed_form_solution}. +\begin{equation} \label{eq:expectation_step_closed_form_solution} + q(z) = p(z|\bm x,\bm\theta_{\text{old}}) = \frac{p(\bm x,z|\bm\theta_{\text{old}})}{\sum_z p(\bm x,z|\bm\theta_{\text{old}})} +\end{equation} +Dies hat zur folge, +dass (für diskrete $z$) $\nomeq{kl_divergence}(q(z)\|p(z|\bm x)) = 0$ und daher wegfällt, +weshalb nach dem Expectation-Step $\log p(\bm x|\bm\theta) = \mathcal L(q,\bm\theta)$ gilt. + +\subsection{Maximization-Step}% +\label{sub:Maximization-Step} +Nachdem im Expectation-Step die \gls{KL} Divergenz minimiert wurde (0 für diskrete $z$), +kann nun die Lower-Bound maximiert werden um im Gegenzug die gesamte Log-Likelihood zu erhöhen (maximieren (für diskrete $z$)). +\begin{equation} \label{eq:maximization-step} + \bm\theta = \argmax_{\bm\theta}\mathcal L(q,\bm\theta) + = \argmax_{\bm\theta}\sum_z q(z)\log p(\bm x,z|\bm\theta) + \text{const} +\end{equation} +\begin{itemize} + \item $q(z) = p(z|\bm x,\bm\theta_{\text{old}})$ +\end{itemize} + + +\section{\glstoplong{EM} for \glstopshortpl{GMM}}% +\label{sec:Expectation Maximization for GMMs} +\begin{mybox} + \textbf{\Large \glsxtrshort{EM} for \glsxtrshortpl{GMM}}\\ + \begin{enumerate} + \item \textbf{Initialisierung:} Komponenten und Koeffizienten des \gls{GMM} (z.B. auf Basis von k-means) erstellen + \item \textbf{Expectation"~Step:} Responsibilities errechnen + \begin{equation*} + q_{ik} = \frac{\pi_k\nomeq{gaussian_distribution}(\bm x_i|\bm\mu_k,\nomeq{covariance}_k)}{\sum_{j=1}^K \pi_j\nomeq{gaussian_distribution}(\bm x_i|\bm\mu_j,\nomeq{covariance}_j)} + \end{equation*} + \item \textbf{Maximization"~Step:} Koeffizienten, Komponenten"~Durchschnitte und Kom\-po\-nen\-ten"~Va\-ri\-an\-zen updaten + (Herleitung: {\color{red} Vorlesung 11 Folie 16}) + \begin{equation*} + \pi_k = \dfrac{\sum_i q_{ik}}{N}\qquad + \bm\mu_k = \dfrac{\sum_i q_{ik}\bm x_i}{\sum_i q_{ik}} + \qquad\nomeq{covariance}_k = \dfrac{\sum_i q_{ik}(\bm x_i - \bm\mu_k)(\bm x_i - \bm\mu_k)^T}{\sum_i q_{ik}} + \end{equation*} + \item Falls noch kein ausreichende Konvergenz erreicht ist, ab Schritt 2 wiederholen + \end{enumerate} +\end{mybox} +Aus \cref{sub:GMMs} ist bekannt, +dass die \glslink{marginal}{marginal} Log-Likelihood nicht gut für den \nameref{cha:Gradient Descent} (\cref{cha:Gradient Descent}) geeignet ist. +Das Problem ist vor allem deshalb schwer zu lösen, +da nicht bekannt ist, +zu welcher Teil-Komponente des \gls{GMM} ein einzelner Datenpunkt gehört. +Hierbei stellen die Datenpunkte $\bm x$ die bekannten Variablen (observed variables) dar +und die Zugehörigkeit der Datenpunkte zu den jeweiligen Teilkomponenten die latenten Variablen (latent variables) dar. +Daher ist jedes Mixture Model auch ein \gls{latent_variable_model}, +auf welches das Verfahren des \glsxtrlong{EM} angewandt werden kann. +Wäre $p(\bm x_i,k|\bm\theta)$ bekannt wäre es sehr einfach eine Maximum Likelihood Abschätzung (\cref{sec:MLE}) durchzuführen: +\begin{itemize} + \item $q_{ik} = \mathbb{I}(k,k_i) = \begin{cases} 1, &\text{ wenn der $i$-te Datenpunkt zur $k$-ten Komponente gehört }\\ 0, &\text{ sonst } \end{cases}$ + \item Koeffizienten:\tabto{3cm}$\pi_k = \dfrac{\sum_i q_{ik}}{N}$ + \item Durchschnitte:\tabto{3cm}$\bm\mu_k = \dfrac{\sum_i q_{ik}\bm x_i}{\sum_i q_{ik}}$ + \item Kovarianzen:\tabto{3cm}$\nomeq{covariance}_k = \dfrac{\sum_i q_{ik}(\bm x_i - \bm\mu_k)(\bm x_i - \bm\mu_k)^T}{\sum_i q_{ik}}$ +\end{itemize} +Die Zugehörigkeit (cluster probability\slash\,responsibilites) $q_{ik}$ kann wiederum mithilfe des \gls{GMM} errechnet werden. +\begin{equation} \label{eq:responsibilites_GMM} + q_{ik} = p(k_i=k|\bm x_i) = \frac{p(\bm x_i|k)p(k)}{\sum_j p(\bm x_i|j)p(j)} + = \frac{\pi_k\nomeq{gaussian_distribution}(\bm x_i|\bm\mu_k,\nomeq{covariance}_k)}{\sum_{j=1}^K \pi_j\nomeq{gaussian_distribution}(\bm x_i|\bm\mu_j,\nomeq{covariance}_j)} +\end{equation} +Hierdurch ergibt sich allerdings ein Henne"~Ei"~Problem. +Für die Ermittlung des \gls{GMM} brauchen wir die Responsibility $q_{ik}$ und umgekehrt. +Um dieses Problem zu umgehen wird das \gls{GMM} zunächst auf Basis einer Approximation (z.B. mittels k-means-Algorithmus) initialisiert +und anschließend der Expectation-Step und Maximization-Step solange wiederholt, +bis das \gls{GMM} konvergiert. +\begin{figure}[H] + \centering + \includegraphics[width=0.8\textwidth]{EM_for_GMM.png} + \caption{Beispielhafte Anwendung von \texorpdfstring{\glsxtrlong{EM}}{\glsfmtlong{EM}} an einem \texorpdfstring{\glsxtrshort{GMM}}{\glsfmtshort{GMM}}} + \label{fig:EM_for_GMM} +\end{figure} + +\section{\glstopshort{EM} for Dimensionality Reduction}% +\begin{mybox} + \textbf{\Large \glsxtrshort{EM} for \nameref{cha:Dimensionality Reduction}} \\ + \begin{enumerate} + \item \textbf{Initialisierung:} \noms{mean} von $\bm x$ für $\bm\mu$ verwenden, zufällige Matrix $\bm W$ generieren + \item \textbf{Expectation-Step:} Posterior, \noms{mean} und \noms{covariance} errechnen + \begin{equation} \label{eq:EM_for_dimensionality_reduction_expectation-step} + \bm\mu_{\bm z|\bm x_i} = (\bm W^T\bm W + \nomeq{variance}\nomeq{identity_matrix})^{-1}\bm W^T(\bm x_i-\bm\mu),\qquad + \nomeq{covariance}_{\bm z|\bm x_i} = \nomeq{variance}(\bm W^T\bm W + \nomeq{variance}\nomeq{identity_matrix})^{-1} + \end{equation} + \begin{itemize} + \item $\bm z_i\sim\nomeq{gaussian_distribution}(\bm\mu_{\bm_z|\bm x_i},\nomeq{covariance}_{\bm q,\bm x_i})$ + \end{itemize} + \item \textbf{Maximization-Step:} $\bm W$, $\bm\mu$ und \nomsym{variance} updaten + \begin{align} + \begin{bmatrix} \bm\mu\\\bm W \end{bmatrix} &= (\bm Z^T\bm Z)^{-1}\bm Z^T\bm X,\quad + \text{ mit } \bm Z = \begin{bmatrix} 1 & \bm z_1^T \\ \vdots&\vdots \\ 1 & \bm z_n^T \end{bmatrix} + \text{ und } \bm X = \begin{bmatrix} \bm x_1^T \\\vdots\\ \bm x_n^T \end{bmatrix} + \label{eq:EM_for_dimensionality_reduction_maximization-step_1} \\ + \nomeq{variance} &= \frac{1}{nd}\sum_{i=1}^n\sum_{k=1}^d(y_{ik} - x_{ik})^2,\quad\text{ mit } \bm y_i = \bm W\bm z_i + \bm\mu + \label{eq:EM_for_dimensionality_reduction_maximization-step_2} + \end{align} + \end{enumerate} +\end{mybox} +\label{sec:EM for Dimensionality Reduction} +Das \gls{EM} Verfahren kann auch zur \nameref{cha:Dimensionality Reduction} (\cref{cha:Dimensionality Reduction}) verwendet werden. +Allerdings wird dieses Verfahren seit der Entdeckung der \nameref{sub:PCA} (\cref{sub:PCA}) kaum noch verwendet. + +Die \nameref{cha:Dimensionality Reduction} lässt sich als \gls{latent_variable_model} formulieren: +\begin{equation} \label{eq:dimensionality_reduction_latend_variable_model} + \bm x = \bm W \bm z + \bm\mu + \bm\epsilon +\end{equation} +\begin{itemize} + \item $\bm z$ ist die latente Variable (die Repräsentation in einer kleineren Dimension) + \item $\bm W$ ist eine $D\times M$ Matrix, die eine Verbindung zwischen $\bm z\in\mathbb{R}^M$ und $\bm x\in\mathbb{R}^D$ herstellt ($M