40
CS839: Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1

Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

CS839:ProbabilisticGraphicalModels

Lecture3:UndirectedGraphicalModels

TheoRekatsinas

1

Page 2: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

RepresentingMultivariateDistributions

2

Section1

•Undirected:Markovrandomfields•Undirectededgessimplygivecorrelationsbetweenvariables

P (X1, X2, X3, X4, X5, X6, X7, X8)

=

1

Zexp(E(X1) + E(X2) + E(X1, X3) + E(X2, X4) + E(X2, X5))

exp(E(X6, X3, X4) + E(X7, X6) + E(X8, X5, X6))

Page 3: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

ReviewofBayesNets

3

Section1

• LetI(G)bethesetoflocalindependencepropertiesencodedbyDAGG:

• WesaythatKisanI-mapforasetofindependenciesIif• AfullyconnectedDAGGisanI-mapforanydistribution• ADAGGisaminimal-mapforPifitisanI-mapforP,andiftheremovalofevenasingleedgefromGrendersitnotanI-map• AdistributionmayhaveseveralminimalI-maps• Eachcorrespondtoaspecificnode-ordering

I(K) ✓ I

Page 4: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

PerfectMaps(P-Maps)

4

Section1

• ADAGGisaperfectmap(P-map)foradistributionPifI(P)=I(G)

Page 5: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

PerfectMaps(P-Maps)

5

Section1

• ADAGGisaperfectmap(P-map)foradistributionPifI(P)=I(G)

• Thm:NoteverydistributionhasaperfectmapasDAG.

Page 6: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

PerfectMaps(P-Maps)

6

Section1

• ADAGGisaperfectmap(P-map)foradistributionPifI(P)=I(G)

• Thm:NoteverydistributionhasaperfectmapasDAG.• Proof:Supposewehaveamodelwhereand

CanwerepresentthiswithaBN?A?C|{B,D} B?D|{A,C}

Page 7: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

PerfectMaps(P-Maps)

7

Section1

• ADAGGisaperfectmap(P-map)foradistributionPifI(P)=I(G)

• Thm:NoteverydistributionhasaperfectmapasDAG.• Proof:SupposewehaveamodelwhereandCanwerepresentthiswithaBN?CannotberepresentedbyanyBN

A?C|{B,D} B?D|{A,C}

Page 8: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

PerfectMaps(P-Maps)

8

Section1

• ADAGGisaperfectmap(P-map)foradistributionPifI(P)=I(G)

• Thm:NoteverydistributionhasaperfectmapasDAG.• Proof:SupposewehaveamodelwhereandCanwerepresentthiswithaBN?CannotberepresentedbyanyBN

A?C|{B,D} B?D|{A,C}

Page 9: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

PerfectMaps(P-Maps)

9

Section1

• ADAGGisaperfectmap(P-map)foradistributionPifI(P)=I(G)

• TheP-mapofadistributionis uniqueuptoI-equivalencebetweennetworks.Thatis,adistributionPcanhavemanyP-maps,butallofthemareI-equivalent.

Page 10: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

UndirectedGraphicalModels

10

Section1

• Pairwise(non-causal)relationships• Wecanwritedownthemodel,scorespecificconfigurationsoftheRVsbutnotgeneratesamples• Contingencyconstraintsonnodeconfigurations

Page 11: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

Example

11

Section1

Page 12: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

TheGridModel

12

Section1

• Imageprocessing,latticephysics,etc.• Eachnodemayrepresentapixel,anatom,etc.• Thestatesofadjacentornearbynodesarecoupledduetopatterncontinuityorelectro-magneticforce,etc.• Mostlikelyjoint-configurationsusuallycorrespondtoa“low-energy”state

Page 13: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

Representation

13

Section1

• Def:anundirectedgraphicalmodelrepresentsadistributiondefinedbyanundirectedgraphH,andasetofpositivepotentialfunctionsψ associatedwiththecliquesofH,s.t.

whereZ isknownasthepartitionfunction:

• A.K.A.MarkovRandomFields,Markovnetworks• Thepotentialfunctioncanbeunderstoodasa“score”ofthejointconfiguration

P (X1, . . . , Xn)

P (X1, . . . , Xn) =1

Z

Y

c2C

c(Xc)

Z =X

X1,...,Xn

Y

c2C

c(Xc)

Page 14: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

GlobalMarkovIndependencies

14

Section1

• LetH beanundirectedgraph:

• B separatesAandCifeverypathfromanodeinAtoanodeinCpassesthroughanodeinB:• AprobabilitydistributionsatisfiestheglobalMarkovpropertyifforanydisjointA,B,C,suchthatBseparatesAandC,AisindependentofCgivenB:

sepH(A;C|B)

I(H) = {A?C|B : sepH(A;C|B)}

Page 15: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

LocalMarkovIndependencies

15

Section1

• ForeachnodethereisauniqueMarkovblanketofdenotedwhichisthesetofneighborsofinthegraph(thosethatshareanedgewith)

• Def:ThelocalMarkovindependenciesassociatedwithHis:

Inotherwords,isindependentoftherestofthenotesinthegraphgivenitsdirectneighbors

Xi 2 V XiMBXi Xi

Xi

I(H) : {Xi?V � {Xi}�MBXi |MBXi : 8i}

Xi

Page 16: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

SummaryofQualitativeSpecification:SemanticsinanMRF

16

Section1

• Structure:anundirectedgraph• AnodeisconditionallyindependentofeveryothernodeinthenetworkgivenitsDirectedneighbors

• Potentialandthecliquesinthegraphcompletelydeterminethejointdistribution

• Modelscorrelationsbetweenvariablesbutwehavenoexplicitwaytogeneratesamples

Page 17: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

QuantitativeSpecification:Cliques

17

Section1

• ForG={V,E},acliqueisasubgraphG’suchthatnodesinG’arefullyinterconnected.• A(maximal)cliqueisacompletesubgraphs.t. anysupersetV’’isnotcomplete.• Asub-cliqueisnotnecessarilymaximalclique

• Example:• Max-cliques={A,B,D},{B,C,D}• Sub-cliques={A,B},{C,D},…

Page 18: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

GibbsDistributionandCliquePotential

18

Section1

• Def:anundirectedgraphicalmodelrepresentsadistributiondefinedbyanundirectedgraphH,andasetofpositivepotentialfunctionsψ associatedwiththecliquesofH,s.t.

whereZ isknownasthepartitionfunction:

• A.K.A.MarkovRandomFields,Markovnetworks• Thepotentialfunctioncanbeunderstoodasa“score”ofthejointconfiguration

P (X1, . . . , Xn)

P (X1, . . . , Xn) =1

Z

Y

c2C

c(Xc)

Z =X

X1,...,Xn

Y

c2C

c(Xc)

Gibbsdistribution

Page 19: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

InterpretationofCliquePotentials

19

Section1

• Themodelimplies.Thisindependencestatementimplies(bydefinition)thatthejointmustfactorizeas:P(X,Y,Z)=P(Y)P(X|Y)P(Z|Y)

• Wecanwrite:P(X,Y,Z)=P(X,Y)P(Z|Y)orP(X,Y,Z)=P(X|Y)P(Z,Y)• cannot haveall potentialsbemarginals• cannot haveall potentialsbeconditionals

• Thepositivecliquepotentialscanonlybethoughtofasgeneral"compatibility"functionsovertheirvariables,butnotasprobabilitydistributions.

X?Z|Y

Page 20: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

ExampleMRF- maxcliques

20

Section1

Page 21: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

ExampleMRF- maxcliques

21

Section1

• Fordiscretenodes,wecanrepresentP(X1,X2,X3,X4)astwo3Dtablesinsteadofone4Dtable.

Page 22: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

ExampleMRF- maxcliques

22

Section1

• Fordiscretenodes,wecanrepresentP(X1,X2,X3,X4)astwo3Dtablesinsteadofone4Dtable.

Page 23: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

ExampleMRF– subcliques

23

Section1

• WecanrepresentP(X1,X2,X3,X4)as52Dtablesinsteadofone4Dtable.• PairMRFs,apopularsimplespecialcase• I(P’)vsI(P’’)? D(P’)vs.D(P’’)?

Page 24: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

ExampleMRF– subcliques

24

Section1

• WecanrepresentP(X1,X2,X3,X4)as52Dtablesinsteadofone4Dtable.• PairMRFs,apopularsimplespecialcase• I(P’)= I(P’’)? D(P’) D(P’’)?◆

Page 25: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

ExampleMRF– canonicalrepresentation

25

Section1

• Mostgeneral,subsumeP’andP’’asspecialcases

Page 26: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

Hammersley-CliffordTheorem

26

Section1

Ifarbitrarypotentialsareutilizedinthefollowingproductformulaforprobabilities

thenthefamilyofprobabilitydistributionsobtainedisexactlythatsetwhichrespects thequalitativespecification(theconditionalindependencerelations)describedearlier

Thm:LetPbeapositive distributionoverVandHaMarkovnetworkgraphoverV.IfHisanI-mapforP,thenPisaGibbsdistributionoverH.

P (X1, . . . , Xn) =1

Z

Y

c2C

c(Xc)

Z =X

X1,...,Xn

Y

c2C

c(Xc)

Page 27: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

Independenceproperties:globalindependencies

27

Section1

• Whatkindofdistributionscanberepresentedbyundirectedgraphs?• Def:theglobalMarkovpropertiesofaUGHare

I(H) = {A?C|B : sepH(A;C|B)}

Page 28: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

LocalandGlobalMarkovProperties

28

Section1

• Fordirectedgraphs,wedefinedI-mapsintermsoflocalMarkovproperties,andderivedglobalindependence.• Forundirectedgraphs,wedefinedI-mapsintermsofglobalMarkovproperties,andwillnowderivelocalindependence.• Def:ThepairwiseMarkovindependenciesassociatedwithundirectedgraphH=(V,E)are

Ip(H) = {X?Y |V \ {X,Y } : {X,Y } /2 E}

X1?X5|{X2, X3, X4}

Page 29: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

LocalMarkovProperties

29

Section1

• AdistributionhasthelocalMarkovpropertyw.r.t.agraphH=(V,E)iftheconditionaldistributionofavariablegivenitsneighborsisindependentoftheremainingnodes

• istheMarkovblanketofX

Ip(H) = {X?Y |V \ (X [NH(X))|NH(X) : X 2 V }

NH(X)

Page 30: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

Perfectmaps

30

Section1

• Def:AMarkovnetworkHisaperfectmapforPifforanyX,Y,Zwehavethat:

• Thm:NoteverydistributionhasaperfectmapasanMRF• Noundirectednetworkcancapturetheindependencesencodedinav-structure

sepH(X,Z|Y ) , P |= (X?Z|Y )

Page 31: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

ExponentialFamilies

31

Section1

• Constrainingcliquepotentialstobepositivecouldbeinconvenient(e.g.,theinteractionsbetweenapairofatomscanbeeitherattractiveorrepulsive).Werepresentacliquepotentialψinanunconstrainted formusingareal-value“energy”functionφandhave:

• Thisgives:

• Inphysics,thisistheBoltzmanndistribution.• Instatistics,thisislog-linearmodel.

x

(Xc

) = exp(��c

(Xc

)

P (X) =

1

Zexp

�X

c2C

�c(Xc)

!=

1

Zexp(�H(X))

Freeenergy

Page 32: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

Boltzmannmachines

32

Section1

• Afullyconnectedgraphwithpairwisepotentialsonbinary-valuesnodesiscalledaBoltzmannmachine

P (X1, X2, X3, X4) =1

Xexp

0

@X

ij

�ij(Xi, Xj)

1

A

=

1

Xexp

0

@X

ij

✓ijXiXj +

X

I

↵iXi + C

1

A

Page 33: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

RestrictedBoltzmannMachines(RBMs)

33

Section1

Page 34: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

PropertiesofRBMs

34

Section1

• Factorsaremarginallydependent

• Factorsareconditionallyindependentgivenobservationsonvisiblenodes.

• IterativeGibbssampling• Learningwithcontrastivedivergence

P (l|w) =Y

I

P (li|w)

Page 35: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

ConditionalRandomFields

35

Section1

• Discriminative

• Doesn’tassumethatfeaturesareindependent

• Whenlabelingfeatureobservationsaretakenintoaccount

P✓(Y |X) =

1

Z(✓, X)

exp

X

c

✓cfc(X,Yc)

!

Xi

Page 36: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

ConditionalModels

36

Section1

•ModelconditionalprobabilityP(labelsequenceY|observationsequenceX)ratherthanjointprobabilityP(X,Y)• Specifytheprobabilityofpossiblelabelsequencesgivenanobservationsequence

• Allowarbitrary,non-independentfeaturesontheobservationsequenceX• Theprobabilityofatransitionbetweenlabelsmaydependonpastandfutureobservations• Relaxstrongindependentassumptioningenerativemodels

Page 37: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

ConditionalDistribution

37

Section1

• IfthegraphH=(V,E)ofYisatree,theconditionaldistributionoverthelabelsequenceY= y,givenX=xbytheHammersleyCliffordtheoremofrandomfieldsis:

• xisadatasequence,yisalabelsequence,visavertexfromV=setoflabelrandomvariables,eisanedgefromEoverV,fandgaregivenandfixed,gisaBooleanvertexfeature,fisaBooleanedgefeature,kisthenumberoffeatures,λ,andμareparameters,isthesetofcomponentsy

P✓(y|x) / exp

0

@X

e2E,k

�kfk(e, y|e, x) +X

v2V,k

µkgk(v, y|v, x)

1

A

y|e

Page 38: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

ConditionalDistribution

38

Section1

• CRFsusetheobservation-dependentnormalizationZ(x)fortheconditionaldistributions

P✓(y|x) =1

Z(x)

exp

0

@X

e2E,k

�kfk(e, y|e, x) +X

v2V,k

µkgk(v, y|v, x)

1

A

Page 39: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

ConditionalDistribution

39

Section1

• Allowarbitrarydependenciesoninput

• Cliquedependenciesonlabels

• Useapproximateinferenceforgeneralgraphs

Page 40: Lecture 3: Undirected Graphical Models - GitHub Pages · 2018-12-04 · Probabilistic Graphical Models Lecture 3: Undirected Graphical Models Theo Rekatsinas 1. Representing Multivariate

Summary

40

Section1

• Undirectedgraphicalmodelscapture“relatedness”,”coupled”,“co-occurrence”betweenentities• Localandglobalindependencepropertiesidentifiableviagraphseparationcriteria• Definedoncliquepotentials• Generallyintractabletocomputelikelihoodduetopresenceofpartitionfunction• Likelihood-basedlearning

• Canbeusedtodefineeitherjointorconditionaldistributions• Importantspecialcases:Ising models,RBMs,CRFs