![Page 1: cs6140 lec9 - College of Computer and Information … · 3/23/17 2 Formally Viterbi Backtrace s 1 s 2 s N • • • •• s 0 s • F t 1 t 2 t 3 t T-1 t T Most likely Sequence:](https://reader036.vdocuments.us/reader036/viewer/2022070613/5b90b3e709d3f2e6728c8f3d/html5/thumbnails/1.jpg)
3/23/17
1
CS6140:MachineLearningSpring2017
Instructor:LuWangCollegeofComputerandInformaBonScience
NortheasternUniversityWebpage:www.ccs.neu.edu/home/luwang
Email:[email protected]
LogisBcs
• Assignment3isdueon3/30.
• 4/13:courseprojectpresentaBon.
• 4/20:finalexam.
WhatwelearnedlastBme
• SequenBallabelingmodels– HiddenMarkovModels– Maximum-entropyMarkovmodel– CondiBonalRandomFields
Sample Markov Model for POS
0.95 0.9
0.05 stop
0.5
0.1
0.8
0.1
0.1
0.25
0.25
start 0.1
0.5 0.4
Det Noun
PropNoun
Verb
TheMarkovAssumpBon HiddenMarkovModels(HMMs)
Words Part-of-Speechtags
![Page 2: cs6140 lec9 - College of Computer and Information … · 3/23/17 2 Formally Viterbi Backtrace s 1 s 2 s N • • • •• s 0 s • F t 1 t 2 t 3 t T-1 t T Most likely Sequence:](https://reader036.vdocuments.us/reader036/viewer/2022070613/5b90b3e709d3f2e6728c8f3d/html5/thumbnails/2.jpg)
3/23/17
2
Formally Viterbi Backtrace
s1 s2
sN
• • •
• • •
s0 sF • • •
• • •
• • •
• • • • • •
• • •
• • •
t1 t2 t3 tT-1 tT
Most likely Sequence: s0 sN s1 s2 …s2 sF
Log-LinearModels
UsingLog-LinearModels CondiBonalRandomFields(CRFs)
![Page 3: cs6140 lec9 - College of Computer and Information … · 3/23/17 2 Formally Viterbi Backtrace s 1 s 2 s N • • • •• s 0 s • F t 1 t 2 t 3 t T-1 t T Most likely Sequence:](https://reader036.vdocuments.us/reader036/viewer/2022070613/5b90b3e709d3f2e6728c8f3d/html5/thumbnails/3.jpg)
3/23/17
3
Today’sOutline
• BayesianNetworks• MixtureModels• ExpectaBonMaximizaBon• LatentDirichletAllocaBon
[SomeslidesareborrowedfromChristopherBishopandDavidSontag]
![Page 4: cs6140 lec9 - College of Computer and Information … · 3/23/17 2 Formally Viterbi Backtrace s 1 s 2 s N • • • •• s 0 s • F t 1 t 2 t 3 t T-1 t T Most likely Sequence:](https://reader036.vdocuments.us/reader036/viewer/2022070613/5b90b3e709d3f2e6728c8f3d/html5/thumbnails/4.jpg)
3/23/17
4
Today’sOutline
• BayesianNetworks• MixtureModels• ExpectaBonMaximizaBon• LatentDirichletAllocaBon
K-meansAlgorithm• Goal:representadatasetintermsofKclusterseachofwhichissummarizedbyaprototype(mean)
• IniBalizeprototypes,theniteratebetweentwophases:– Step1:assigneachdatapointtonearestprototype
– Step2:updateprototypestobetheclustermeans• SimplestversionisbasedonEuclideandistance
BCSSummerSchool,Exeter,2003 ChristopherM.Bishop
![Page 5: cs6140 lec9 - College of Computer and Information … · 3/23/17 2 Formally Viterbi Backtrace s 1 s 2 s N • • • •• s 0 s • F t 1 t 2 t 3 t T-1 t T Most likely Sequence:](https://reader036.vdocuments.us/reader036/viewer/2022070613/5b90b3e709d3f2e6728c8f3d/html5/thumbnails/5.jpg)
3/23/17
5
BCSSummerSchool,Exeter,2003 ChristopherM.Bishop BCSSummerSchool,Exeter,
2003 ChristopherM.Bishop
BCSSummerSchool,Exeter,2003 ChristopherM.Bishop BCSSummerSchool,Exeter,
2003 ChristopherM.Bishop
BCSSummerSchool,Exeter,2003 ChristopherM.Bishop BCSSummerSchool,Exeter,
2003 ChristopherM.Bishop
![Page 6: cs6140 lec9 - College of Computer and Information … · 3/23/17 2 Formally Viterbi Backtrace s 1 s 2 s N • • • •• s 0 s • F t 1 t 2 t 3 t T-1 t T Most likely Sequence:](https://reader036.vdocuments.us/reader036/viewer/2022070613/5b90b3e709d3f2e6728c8f3d/html5/thumbnails/6.jpg)
3/23/17
6
BCSSummerSchool,Exeter,2003 ChristopherM.Bishop BCSSummerSchool,Exeter,
2003 ChristopherM.Bishop
![Page 7: cs6140 lec9 - College of Computer and Information … · 3/23/17 2 Formally Viterbi Backtrace s 1 s 2 s N • • • •• s 0 s • F t 1 t 2 t 3 t T-1 t T Most likely Sequence:](https://reader036.vdocuments.us/reader036/viewer/2022070613/5b90b3e709d3f2e6728c8f3d/html5/thumbnails/7.jpg)
3/23/17
7
TheGaussianDistribuBon• MulBvariateGaussian
mean covariance
GaussianMixtures• Linearsuper-posiBonofGaussians
• NormalizaBonandposiBvityrequire
• CaninterpretthemixingcoefficientsaspriorprobabiliBes
Example:Mixtureof3Gaussians
![Page 8: cs6140 lec9 - College of Computer and Information … · 3/23/17 2 Formally Viterbi Backtrace s 1 s 2 s N • • • •• s 0 s • F t 1 t 2 t 3 t T-1 t T Most likely Sequence:](https://reader036.vdocuments.us/reader036/viewer/2022070613/5b90b3e709d3f2e6728c8f3d/html5/thumbnails/8.jpg)
3/23/17
8
ContoursofProbabilityDistribuBon SamplingfromtheGaussian
• Togenerateadatapoint:– firstpickoneofthecomponentswithprobability– thendrawasamplefromthatcomponent
• Repeatthesetwostepsforeachnewdatapoint
SyntheBcDataSet SyntheBcDataSetWithoutLabels
FigngtheGaussianMixture
• Wewishtoinvertthisprocess–giventhedataset,findthecorrespondingparameters:– mixingcoefficients– means– Covariances
FigngtheGaussianMixture
• Wewishtoinvertthisprocess–giventhedataset,findthecorrespondingparameters:– mixingcoefficients– means– covariances
• Ifweknewwhichcomponentgeneratedeachdatapoint,themaximumlikelihoodsoluBonwouldinvolvefigngeachcomponenttothecorrespondingcluster
• Problem:thedatasetisunlabelled• Weshallrefertothelabelsaslatent(=hidden)variables
![Page 9: cs6140 lec9 - College of Computer and Information … · 3/23/17 2 Formally Viterbi Backtrace s 1 s 2 s N • • • •• s 0 s • F t 1 t 2 t 3 t T-1 t T Most likely Sequence:](https://reader036.vdocuments.us/reader036/viewer/2022070613/5b90b3e709d3f2e6728c8f3d/html5/thumbnails/9.jpg)
3/23/17
9
SyntheBcDataSetWithoutLabels PosteriorProbabiliBes
• WecanthinkofthemixingcoefficientsaspriorprobabiliBesforthecomponents
• ForagivenvalueofwecanevaluatethecorrespondingposteriorprobabiliBes,calledresponsibili,es
• ThesearegivenfromBayes’theoremby
PosteriorProbabiliBes(colourcoded)
![Page 10: cs6140 lec9 - College of Computer and Information … · 3/23/17 2 Formally Viterbi Backtrace s 1 s 2 s N • • • •• s 0 s • F t 1 t 2 t 3 t T-1 t T Most likely Sequence:](https://reader036.vdocuments.us/reader036/viewer/2022070613/5b90b3e709d3f2e6728c8f3d/html5/thumbnails/10.jpg)
3/23/17
10
Today’sOutline
• BayesianNetworks• MixtureModels• ExpectaBonMaximizaBon• LatentDirichletAllocaBon
![Page 11: cs6140 lec9 - College of Computer and Information … · 3/23/17 2 Formally Viterbi Backtrace s 1 s 2 s N • • • •• s 0 s • F t 1 t 2 t 3 t T-1 t T Most likely Sequence:](https://reader036.vdocuments.us/reader036/viewer/2022070613/5b90b3e709d3f2e6728c8f3d/html5/thumbnails/11.jpg)
3/23/17
11
![Page 12: cs6140 lec9 - College of Computer and Information … · 3/23/17 2 Formally Viterbi Backtrace s 1 s 2 s N • • • •• s 0 s • F t 1 t 2 t 3 t T-1 t T Most likely Sequence:](https://reader036.vdocuments.us/reader036/viewer/2022070613/5b90b3e709d3f2e6728c8f3d/html5/thumbnails/12.jpg)
3/23/17
12
BCSSummerSchool,Exeter,2003 ChristopherM.Bishop
![Page 13: cs6140 lec9 - College of Computer and Information … · 3/23/17 2 Formally Viterbi Backtrace s 1 s 2 s N • • • •• s 0 s • F t 1 t 2 t 3 t T-1 t T Most likely Sequence:](https://reader036.vdocuments.us/reader036/viewer/2022070613/5b90b3e709d3f2e6728c8f3d/html5/thumbnails/13.jpg)
3/23/17
13
BCSSummerSchool,Exeter,2003 ChristopherM.Bishop BCSSummerSchool,Exeter,
2003 ChristopherM.Bishop
BCSSummerSchool,Exeter,2003 ChristopherM.Bishop BCSSummerSchool,Exeter,
2003 ChristopherM.Bishop
BCSSummerSchool,Exeter,2003 ChristopherM.Bishop
EMinGeneral• ConsiderarbitrarydistribuBonoverthelatentvariables(pisthetruedistribuBon)
• ThefollowingdecomposiBonalwaysholdswhere
![Page 14: cs6140 lec9 - College of Computer and Information … · 3/23/17 2 Formally Viterbi Backtrace s 1 s 2 s N • • • •• s 0 s • F t 1 t 2 t 3 t T-1 t T Most likely Sequence:](https://reader036.vdocuments.us/reader036/viewer/2022070613/5b90b3e709d3f2e6728c8f3d/html5/thumbnails/14.jpg)
3/23/17
14
DecomposiBon OpBmizingtheBound
• E-step:maximizewithrespectto– equivalenttominimizingKLdivergence– setsequaltotheposteriordistribuBon
• M-step:maximizeboundwithrespectto– equivalenttomaximizingexpectedcomplete-dataloglikelihood
• EachEMcyclemustincreaseincomplete-datalikelihoodunlessalreadyata(local)maximum
E-step M-step
Today’sOutline
• BayesianNetworks• MixtureModels• ExpectaBonMaximizaBon• LatentDirichletAllocaBon
[SlidesarebasedonDavidBlei’sICML2012tutorial]
![Page 15: cs6140 lec9 - College of Computer and Information … · 3/23/17 2 Formally Viterbi Backtrace s 1 s 2 s N • • • •• s 0 s • F t 1 t 2 t 3 t T-1 t T Most likely Sequence:](https://reader036.vdocuments.us/reader036/viewer/2022070613/5b90b3e709d3f2e6728c8f3d/html5/thumbnails/15.jpg)
3/23/17
15
![Page 16: cs6140 lec9 - College of Computer and Information … · 3/23/17 2 Formally Viterbi Backtrace s 1 s 2 s N • • • •• s 0 s • F t 1 t 2 t 3 t T-1 t T Most likely Sequence:](https://reader036.vdocuments.us/reader036/viewer/2022070613/5b90b3e709d3f2e6728c8f3d/html5/thumbnails/16.jpg)
3/23/17
16
GeneraBvemodelforadocumentinLDA
![Page 17: cs6140 lec9 - College of Computer and Information … · 3/23/17 2 Formally Viterbi Backtrace s 1 s 2 s N • • • •• s 0 s • F t 1 t 2 t 3 t T-1 t T Most likely Sequence:](https://reader036.vdocuments.us/reader036/viewer/2022070613/5b90b3e709d3f2e6728c8f3d/html5/thumbnails/17.jpg)
3/23/17
17
![Page 18: cs6140 lec9 - College of Computer and Information … · 3/23/17 2 Formally Viterbi Backtrace s 1 s 2 s N • • • •• s 0 s • F t 1 t 2 t 3 t T-1 t T Most likely Sequence:](https://reader036.vdocuments.us/reader036/viewer/2022070613/5b90b3e709d3f2e6728c8f3d/html5/thumbnails/18.jpg)
3/23/17
18
![Page 19: cs6140 lec9 - College of Computer and Information … · 3/23/17 2 Formally Viterbi Backtrace s 1 s 2 s N • • • •• s 0 s • F t 1 t 2 t 3 t T-1 t T Most likely Sequence:](https://reader036.vdocuments.us/reader036/viewer/2022070613/5b90b3e709d3f2e6728c8f3d/html5/thumbnails/19.jpg)
3/23/17
19
GeneraBvemodelforadocumentinLDA
Comparisonofmixtureandadmixturemodels
UsageofLDA EMformixturemodels
![Page 20: cs6140 lec9 - College of Computer and Information … · 3/23/17 2 Formally Viterbi Backtrace s 1 s 2 s N • • • •• s 0 s • F t 1 t 2 t 3 t T-1 t T Most likely Sequence:](https://reader036.vdocuments.us/reader036/viewer/2022070613/5b90b3e709d3f2e6728c8f3d/html5/thumbnails/20.jpg)
3/23/17
20
EMformixturemodels
WhatWeLearnedToday
• BayesianNetworks• MixtureModels• ExpectaBonMaximizaBon• LatentDirichletAllocaBon
Homework
• ReadingMurphy11.1-11.2,11.4.1-11.4.4,27.1-27.3
• MoreaboutEM– hkp://cs229.stanford.edu/notes/cs229-notes7b.pdf– hkp://cs229.stanford.edu/notes/cs229-notes8.pdf
• MoreaboutLDA– hkp://menome.com/wp/wp-content/uploads/2014/12/Blei2011.pdf
– hkp://obphio.us/pdfs/lda_tutorial.pdf