problems with high dim distribu ons
play

Problems with high-dim. distribu)ons Suppose we have n - PowerPoint PPT Presentation

Introduc)on to Ar)ficial Intelligence Lecture 12 Bayesian Network Inference CS/CNS/EE 154 Andreas Krause TexPoint fonts used in EMF. Problems with


  1. Introduc)on ¡to ¡ ¡ Ar)ficial ¡Intelligence ¡ Lecture ¡12 ¡– ¡Bayesian ¡Network ¡Inference ¡ CS/CNS/EE ¡154 ¡ Andreas ¡Krause ¡ TexPoint ¡fonts ¡used ¡in ¡EMF. ¡ ¡

  2. Problems ¡with ¡high-­‑dim. ¡distribu)ons ¡ � Suppose ¡we ¡have ¡ n ¡proposi)onal ¡symbols ¡ � How ¡many ¡parameters ¡do ¡we ¡need ¡to ¡specify ¡ ¡ P(X 1 =x 1 ,…,X n =x n ) ? ¡ X 1 ¡ X 2 ¡ … ¡ X n-­‑1 ¡ X n ¡ P(X) ¡ 0 ¡ 0 ¡ … ¡ 0 ¡ 0 ¡ .01 ¡ 0 ¡ 0 ¡ … ¡ 1 ¡ 0 ¡ .001 ¡ 0 ¡ 0 ¡ … ¡ 1 ¡ 1 ¡ .213 ¡ … ¡ … ¡ … ¡ … ¡ … ¡ 1 ¡ 1 ¡ … ¡ 1 ¡ 1 ¡ .0003 ¡ ¡ ¡2 n -­‑1 ¡parameters! ¡  ¡ 2 ¡

  3. Marginal ¡distribu)ons ¡ � Suppose ¡we ¡have ¡joint ¡distribu)on ¡P(X 1 ,…,X n ) ¡ � Then ¡ � If ¡all ¡X i ¡binary: ¡ ¡How ¡many ¡terms? ¡ 3 ¡ 3 ¡

  4. Independent ¡RVs ¡ � What ¡if ¡RVs ¡are ¡independent? ¡ ¡ P(X 1 =x 1 ,…,X n =x n ) ¡= ¡P(x 1 ) ¡P(x 2 ) ¡… ¡P(x n ) ¡ � How ¡many ¡parameters ¡are ¡needed ¡in ¡this ¡case? ¡ � How ¡about ¡compu)ng ¡ P(x i )? ¡ � Independence ¡too ¡strong ¡assump)on… ¡Is ¡there ¡ something ¡weaker? ¡

  5. Key ¡concept: ¡Condi)onal ¡independence ¡ � Random ¡variables ¡X ¡and ¡Y ¡cond. ¡indep. ¡given ¡Z ¡if ¡ for ¡all ¡x, ¡y, ¡z: ¡ ¡ ¡P(X ¡= ¡x, ¡Y ¡= ¡y ¡| ¡Z ¡= ¡z) ¡= ¡P(X ¡=x ¡| ¡Z ¡= ¡z) ¡P(Y ¡= ¡y| ¡Z= ¡z) ¡ � If ¡P(Y=y ¡|Z=z)>0, ¡that’s ¡equivalent ¡to ¡ ¡ ¡P(X ¡= ¡x ¡| ¡Z ¡= ¡z, ¡Y ¡= ¡y) ¡= ¡P(X ¡= ¡x ¡| ¡Z ¡= ¡z) ¡ ¡Similarly ¡for ¡sets ¡of ¡random ¡variables ¡ X , ¡ Y , ¡ Z ¡ ¡We ¡write: ¡ 5 ¡ 5 ¡

  6. Bayesian ¡networks ¡ � Compact ¡representa)on ¡of ¡distribu)ons ¡over ¡large ¡ number ¡of ¡variables ¡ � (Oien) ¡allows ¡efficient ¡exact ¡inference ¡(compu)ng ¡ marginals, ¡etc.) ¡ HailFinder ¡ 56 ¡vars ¡ ~ ¡3 ¡states ¡each ¡  ~10 26 ¡terms ¡ > ¡ 10.000 ¡years ¡ on ¡Top ¡ ¡ supercomputers ¡ JavaBayes ¡applet ¡ 6 ¡

  7. Bayesian ¡networks ¡ � A ¡ Bayesian ¡network ¡structure ¡ is ¡a ¡ ¡ directed, ¡acyclic ¡graph ¡G, ¡where ¡each ¡vertex ¡s ¡of ¡G ¡is ¡ interpreted ¡as ¡a ¡random ¡variable ¡X s ¡ (with ¡unspecified ¡ distribu)on) ¡ ¡ � A ¡ Bayesian ¡network ¡ (G,P) ¡consists ¡of ¡ ¡ � A ¡BN ¡structure ¡G ¡and ¡.. ¡ � ..a ¡set ¡of ¡condi)onal ¡probability ¡distribu)ons ¡(CPTs) ¡ P(X s ¡| ¡ Pa Xs ), ¡where ¡ Pa Xs ¡are ¡the ¡parents ¡of ¡node ¡X s ¡such ¡that ¡ � (G,P) ¡defines ¡joint ¡distribu)on ¡ 7 ¡

  8. Represen)ng ¡the ¡world ¡using ¡BNs ¡ s 4 s 1 s 1 s 2 s 3 s 3 s 5 s 7 s 8 s 6 represent ¡ s 9 s 10 s 9 s 11 s 12 s 12 True ¡distribu)on ¡P’ ¡ Bayes ¡net ¡(G,P) ¡ with ¡cond. ¡ind. ¡I(P’) ¡ with ¡ ¡I(P) ¡ � Want ¡to ¡make ¡sure ¡that ¡ ¡I(P) ¡is ¡a ¡subset ¡of ¡I(P’) ¡ � Need ¡to ¡understand ¡condi)onal ¡independence ¡ proper)es ¡of ¡BN ¡(G,P) ¡ ¡ 8 ¡

  9. BNs ¡with ¡3 ¡nodes ¡ X ¡ Y ¡ Z ¡ X ¡ Y ¡ Z ¡ X ¡ Z ¡ Y ¡ Y ¡ X ¡ Z ¡ 9 ¡

  10. Ac)ve ¡trails ¡ � When ¡are ¡A ¡and ¡I ¡independent? ¡ B ¡ I ¡ C ¡ G ¡ A ¡ H ¡ D ¡ E ¡ F ¡ 10 ¡

  11. Ac)ve ¡trails ¡ � An ¡undirected ¡path ¡in ¡BN ¡structure ¡G ¡is ¡called ¡ ¡ ac)ve ¡trail ¡for ¡observed ¡variables ¡ O ¡ µ ¡{X 1 ,…,X n }, ¡if ¡for ¡ every ¡consecu)ve ¡triple ¡of ¡vars ¡X,Y,Z ¡on ¡the ¡path ¡ � X ¡  ¡Y ¡  ¡Z ¡and ¡Y ¡is ¡unobserved ¡(Y ¡ ∉ ¡ O ) ¡ � X ¡  ¡Y ¡  ¡Z ¡and ¡Y ¡is ¡unobserved ¡(Y ¡ ∉ ¡ O ) ¡ � X ¡  ¡Y ¡  ¡Z ¡and ¡Y ¡is ¡unobserved ¡(Y ¡ ∉ ¡ O ) ¡ � X ¡  ¡Y ¡  ¡Z ¡and ¡Y ¡ or ¡any ¡of ¡Y’s ¡descendants ¡ is ¡observed ¡ � Any ¡variables ¡X i ¡and ¡X j ¡for ¡which ¡there ¡is ¡no ac)ve ¡trail ¡ for ¡observa)ons ¡ O ¡are ¡called ¡d-­‑separated ¡by ¡ O ¡ We ¡write ¡d-­‑sep(X i ; X j ¡ | ¡O ) ¡ � Sets ¡ A ¡and ¡ B ¡are ¡d-­‑separated ¡given ¡ O ¡if ¡d-­‑sep(X,Y ¡| O ) ¡ for ¡all ¡X ¡in A , ¡Y ¡in ¡ B . ¡ ¡Write ¡d-­‑sep( A; ¡B ¡| ¡O ) ¡ 11 ¡

  12. d-­‑separa)on ¡and ¡independence ¡ Theorem : ¡ A ¡ G ¡ D ¡ I ¡ B ¡ i.e., ¡X ¡cond. ¡indep. ¡Y ¡given ¡Z ¡ E ¡ H ¡ if ¡there ¡does ¡not ¡exist ¡any ¡ ¡ C ¡ ac)ve ¡trail ¡between ¡X ¡and ¡Y ¡ F ¡ I ¡ for ¡observa)ons ¡ Z ¡ � Converse ¡does ¡not ¡hold ¡in ¡general! ¡ � But ¡for ¡“almost” ¡all ¡distribu)ons ¡ ¡ (except ¡set ¡of ¡measure ¡0) ¡ 12 ¡

  13. Examples ¡ A ¡ G ¡ D ¡ I ¡ B ¡ E ¡ H ¡ C ¡ F ¡ J ¡ 13 ¡

  14. More ¡examples ¡ A ¡ G ¡ D ¡ I ¡ B ¡ E ¡ H ¡ C ¡ F ¡ J ¡ 14 ¡

  15. Algorithm ¡for ¡d-­‑separa)on ¡ � How ¡can ¡we ¡check ¡if ¡d-­‑sep(X; ¡Y ¡| ¡ Z )? ¡ � Idea : ¡ ¡Check ¡every ¡possible ¡path ¡connec)ng ¡X ¡and ¡Y ¡and ¡ verify ¡condi)ons ¡ A ¡ G ¡ � Exponen)ally ¡many ¡paths!!! ¡  ¡ D ¡ I ¡ B ¡ � Linear ¡)me ¡algorithm: ¡ E ¡ H ¡ Find ¡all ¡nodes ¡reachable ¡from ¡X ¡ C ¡ � 1. ¡Mark ¡ Z ¡and ¡its ¡ancestors ¡ F ¡ I ¡ � 2. ¡Do ¡breadth-­‑first ¡search ¡star)ng ¡ from ¡X; ¡stop ¡if ¡path ¡is ¡blocked ¡ � Have ¡to ¡be ¡careful ¡with ¡implementa)on ¡details ¡ ¡ (see ¡reading) ¡ 15 ¡

  16. Typical ¡queries: ¡Condi)onal ¡distribu)on ¡ � Compute ¡distribu)on ¡of ¡some ¡ E ¡ B ¡ variables ¡given ¡values ¡for ¡others ¡ A ¡ J ¡ M ¡ 16 ¡

  17. Typical ¡queries: ¡Maximiza)on ¡ � MPE ¡(Most ¡probable ¡explana)on): ¡ E ¡ B ¡ ¡Given ¡values ¡for ¡some ¡vars, ¡ compute ¡most ¡likely ¡assignment ¡to ¡ all ¡remaining ¡vars ¡ A ¡ J ¡ M ¡ � MAP ¡(Maximum ¡a ¡posteriori): ¡ ¡Compute ¡most ¡likely ¡assignment ¡to ¡ some ¡variables ¡ 17 ¡

  18. Hardness ¡of ¡inference ¡for ¡general ¡BNs ¡ � Compu)ng ¡condi)onal ¡distribu)ons: ¡ � Exact ¡solu)on: ¡#P-­‑complete ¡ � NP-­‑hard ¡to ¡obtain ¡any ¡nontrivial ¡approxima)on ¡ � Maximiza)on: ¡ � MPE: ¡NP-­‑complete ¡ � MAP: ¡NP PP -­‑complete ¡ � Inference ¡in ¡general ¡BNs ¡is ¡really ¡hard ¡  ¡ ¡ � Is ¡all ¡hope ¡lost? ¡ 18 ¡

  19. Inference ¡ � Can ¡exploit ¡structure ¡(condi)onal ¡independence) ¡to ¡ efficiently ¡perform ¡ exact ¡inference ¡ in ¡many ¡prac)cal ¡ situa)ons ¡ � For ¡BNs ¡where ¡exact ¡inference ¡is ¡not ¡possible, ¡can ¡use ¡ algorithms ¡for ¡ approximate ¡inference ¡ (later) ¡ 19 ¡

  20. Poten)al ¡for ¡savings: ¡Variable ¡elimina)on! ¡ X 1 ¡ X 2 ¡ X 3 ¡ X 4 ¡ X 5 ¡ Intermediate ¡solu)ons ¡are ¡distribu)ons ¡on ¡fewer ¡variables! ¡ 20 ¡

  21. Variable ¡elimina)on ¡in ¡general ¡graphs ¡ � Push ¡sums ¡through ¡product ¡as ¡far ¡as ¡possible ¡ � Create ¡new ¡factor ¡by ¡summing ¡out ¡variables ¡ E ¡ B ¡ A ¡ J ¡ M ¡ 21 ¡

  22. Variable ¡elimina)on ¡algorithm ¡ � Given ¡BN ¡and ¡Query ¡P(X ¡| ¡ E = e ) ¡ � Choose ¡an ¡ordering ¡of ¡X 1 ,…,X n ¡ � Set ¡up ¡ini)al ¡factors: ¡f i ¡= ¡P(X i ¡| ¡ Pa i ) ¡ � For ¡i ¡=1:n, ¡X i ¡ ∉ ¡{X, E } ¡ � Collect ¡all ¡factors ¡f ¡that ¡include ¡X i ¡ � Generate ¡new ¡factor ¡by ¡marginalizing ¡out ¡X i ¡ � Add ¡g ¡to ¡set ¡of ¡factors ¡ � Renormalize ¡P(x, e ) ¡to ¡get ¡P(x ¡| ¡ e ) ¡ 22 ¡

  23. Mul)plying ¡factors ¡ A ¡ B ¡ f 1 (A,B) ¡ B ¡ C ¡ f 2 (B,C) ¡ 0 ¡ 0 ¡ .1 ¡ 0 ¡ 0 ¡ .4 ¡ 0 ¡ 1 ¡ .3 ¡ 0 ¡ 1 ¡ .2 ¡ 1 ¡ 0 ¡ .7 ¡ 1 ¡ 0 ¡ .5 ¡ 1 ¡ 1 ¡ .01 ¡ 1 ¡ 1 ¡ 0 ¡ 23 ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend