Download presentation
Presentation is loading. Please wait.
1
Probabilistic Models with Latent Variables
Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya
2
Density Estimation Problem
Learning from unlabeled data π₯ 1 , π₯ 2 ,β¦, π₯ π Unsupervised learning, density estimation Empirical distribution typically has multiple modes Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya
3
Density Estimation Problem
From From Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya
4
Density Estimation Problem
Conv. composition of unimodal pdfβs: multimodal pdf π π₯ = π π€ π π π (π₯) where π π€ π =1 Physical interpretation Sub populations Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya
5
Latent Variables Introduce new variable π π for each π π
Latent / hidden: not observed in the data Probabilistic interpretation Mixing weights: π€ π β‘π( π§ π =π) Mixture densities: π π (π₯)β‘π(π₯| π§ π =π) Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya
6
Generative Mixture Model
For π=1,β¦,π π π ~πππ ππ’ππ‘ π π ~πππ π(π₯| π§ π ) π( π₯ π , π§ π )=π π§ π π( π₯ π | π§ π ) π π₯ π = π π( π₯ π , π§ π ) recovers mixture distribution π π π π π Plate Notation Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya
7
Tasks in a Mixture Model
Inference π π§ π₯ = π π( π§ π | π₯ π ) Parameter Estimation Find parameters that e.g. maximize likelihood Does not decouple according to classes Non convex, many local minima Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya
8
Example: Gaussian Mixture Model
For π=1,β¦,π π π ~πππ ππ’ππ‘(π) π π | π π =π~πππ π(π₯| π π ,Ξ£) Inference π( π§ π =π| π₯ π ;π,Ξ£) Soft-max function Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya
9
Example: Gaussian Mixture Model
Loglikelihood Which training instance comes from which component? π π = π log π π₯ π = π log π π π§ π =π π( π₯ π | π§ π =π) No closed form solution for maximizing π π Possibility 1: Gradient descent etc Possibility 2: Expectation Maximization Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya
10
Expectation Maximization Algorithm
Observation: Know values of π π β easy to maximize Key idea: iterative updates Given parameter estimates, βinferβ all π π variables Given inferred π π variables, maximize wrt parameters Questions Does this converge? What does this maximize? Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya
11
Expectation Maximization Algorithm
Complete loglikelihood π π π = π log π π₯ π , π§ π = π log π π§ π π( π₯ π | π§ π ) Problem: π§ π not known Possible solution: Replace w/ conditional expectation Expected complete loglikelihood π π, π πππ =πΈ[ π log π π₯ π , π§ π ] Wrt π(π§|π₯, π πππ ) where π πππ are the current parameters Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya
12
Expectation Maximization Algorithm
π π, π πππ =πΈ[ π log π π₯ π , π§ π ] = π π πΈ πΌ π§ π =π log [ π π π( π₯ π | π π )] = π π π( π§ π =π| π₯ π , π πππ ) log [ π π π( π₯ π | π π )] = π π πΎ ππ log π π + π π πΎ ππ log π( π₯ π | π π ) Where πΎ ππ =π( π§ π =π| π₯ π , π πππ ) Compare with likelihood for generative classifier Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya
13
Expectation Maximization Algorithm
Expectation Step Update πΎ ππ based on current parameters πΎ ππ = π π π π₯ π π πππ, π π π π π π₯ π π πππ, π Maximization Step Maximize π π, π πππ wrt parameters Overall algorithm Initialize all latent variables Iterate until convergence M Step E Step Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya
14
Example: EM for GMM E Step remains the step for all mixture models
M Step π π = π πΎ ππ π = πΎ π π π π = π πΎ ππ π₯ π πΎ π Ξ£=? Compare with generative classifier Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya
15
Analysis of EM Algorithm
Expected complete LL is a lower bound on LL EM iteratively maximizes this lower bound Converges to a local maximum of the loglikelihood Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya
16
Bayesian / MAP Estimation
EM overfits Possible to perform MAP instead of MLE in M-step EM is partially Bayesian Posterior distribution over latent variables Point estimate over parameters Fully Bayesian approach is called Variational Bayes Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya
17
(Lloydβs) K Means Algorithm
Hard EM for Gaussian Mixture Model Point estimate of parameters (as usual) Point estimate of latent variables Spherical Gaussian mixture components π§ π β = arg max k π( π§ π =π| π₯ π ,π) = arg min π π₯ π β π π Where π π = π: π§ π =π π₯ π π Most popular βhardβ clustering algorithm Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya
18
K Means Problem Given { π₯ π }, find k βmeansβ ( π 1 β ,β¦, π π β ) and data assignments ( π§ 1 β ,β¦, π§ π β ) such that π β , π§ β = arg min π,π§ π π₯ π βπ π§ π Note: π§ π is k-dimensional binary vector Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya
19
Model selection: Choosing K for GMM
Cross validation Plot likelihood on training set and validation set for increasing values of k Likelihood on training set keeps improving Likelihood on validation set drops after βoptimalβ k Does not work for k-means! Why? Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya
20
Principal Component Analysis: Motivation
Dimensionality reduction Reduces #parameters to estimate Data often resides in much lower dimension, e.g., on a line in a 3D space Provides βunderstandingβ Mixture models very restricted Latent variables restricted to small discrete set Can we βrelaxβ the latent variable? Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya
21
Classical PCA: Motivation
Revisit K-means min π,π π½ π,π = πβπ π π 2 πΉ W: matrix containing means Z: matrix containing cluster membership vectors How can we relax Z and W? Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya
22
Classical PCA: Problem
min π,π π½ π,π = |πβπ π π | 2 πΉ X : π·Γπ Arbitrary Z of size πΓπΏ, Orthonormal W of size π·ΓπΏ Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya
23
Classical PCA: Optimal Solution
Empirical covariance matrix Ξ£ = 1 π π π₯ π π₯ π π Scaled and centered data π = π πΏ where π πΏ contains L Eigen vectors for the L largest Eigen values of Ξ£ π§ π = π π π₯ π Alternative solution via Singular Value Decomposition (SVD) W contains the βprincipal componentsβ that capture the largest variance in the data Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya
24
π( π₯ π | π§ π ) = π( π₯ π |π π§ π +π, Ξ¨)
Probabilistic PCA Generative model π( π§ π ) = π( π§ π | π 0 , Ξ£ 0 ) π( π₯ π | π§ π ) = π( π₯ π |π π§ π +π, Ξ¨) Ξ¨ forced to be diagonal Latent linear models Factor Analysis Special Case: PCA with Ξ¨ = π 2 πΌ Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya
25
Visualization of Generative Process
From Bishop, PRML Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya
26
Relationship with Gaussian Density
πΆππ£[π₯] = π π π +Ξ¨ Why does Ξ¨ need to be restricted? Intermediate low rank parameterization of Gaussian covariance matrix between full rank and diagonal Compare #parameters Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya
27
EM for PCA: Rod and Springs
From Bishop, PRML Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya
28
Advantages of EM Simpler than gradient methods w/ constraints
Handles missing data Easy path for handling more complex models Not always the fastest method Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya
29
Summary of Latent Variable Models
Learning from unlabeled data Latent variables Discrete: Clustering / Mixture models ; GMM Continuous: Dimensionality reduction ; PCA Summary / βUnderstandingβ of data Expectation Maximization Algorithm Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.