exact inference inference
play

Exact Inference Inference Basic task for inference: - PowerPoint PPT Presentation

Exact Inference Inference Basic task for inference: Compute a posterior distribu8on for some query variables given some observed evidence Sum out


  1. Exact ¡Inference ¡

  2. Inference ¡ • Basic ¡task ¡for ¡inference: ¡ – Compute ¡a ¡posterior ¡distribu8on ¡for ¡some ¡query ¡ variables ¡given ¡some ¡observed ¡evidence ¡ – Sum ¡out ¡nuisance ¡variables ¡ • In ¡general ¡inference ¡in ¡GMs ¡is ¡intractable… ¡ – Tractable ¡in ¡certain ¡cases, ¡e.g. ¡HMMs, ¡trees ¡ – Approximate ¡inference ¡techniques ¡ • Ac8ve ¡research ¡area… ¡ – More ¡later ¡

  3. Inference by enumeration Slightly intelligent way to sum out variables from the joint without actually constructing its explicit representation Simple query on the burglary network: B E P ( B | j, m ) = P ( B, j, m ) /P ( j, m ) A = α P ( B, j, m ) = α Σ e Σ a P ( B, e, a, j, m ) J M Rewrite full joint entries using product of CPT entries: P ( B | j, m ) = α Σ e Σ a P ( B ) P ( e ) P ( a | B, e ) P ( j | a ) P ( m | a ) = α P ( B ) Σ e P ( e ) Σ a P ( a | B, e ) P ( j | a ) P ( m | a ) Recursive depth-first enumeration: O ( n ) space, O ( d n ) time 4

  4. Evaluation tree P(b) .001 P(e) P( e) .002 .998 P( a|b, e) P(a|b,e) P( a|b,e) P(a|b, e) .95 .05 .94 .06 P(j|a) P(j| a) P(j|a) P(j| a) .90 .05 .90 .05 P(m|a) P(m| a) P(m|a) P(m| a) .70 .01 .70 .01 Enumeration is ine ffi cient: repeated computation e.g., computes P ( j | a ) P ( m | a ) for each value of e 6

  5. Inference by variable elimination Variable elimination: carry out summations right-to-left, storing intermediate results (factors) to avoid recomputation P ( B | j, m ) Σ e P ( e ) Σ a P ( a | B, e ) = α P ( B ) P ( j | a ) P ( m | a ) � �� � � �� � � �� � � �� � � �� � B E A J M = α P ( B ) Σ e P ( e ) Σ a P ( a | B, e ) P ( j | a ) f M ( a ) = α P ( B ) Σ e P ( e ) Σ a P ( a | B, e ) f J ( a ) f M ( a ) = α P ( B ) Σ e P ( e ) Σ a f A ( a, b, e ) f J ( a ) f M ( a ) = α P ( B ) Σ e P ( e ) f ¯ AJM ( b, e ) (sum out A ) = α P ( B ) f ¯ AJM ( b ) (sum out E ) E ¯ = α f B ( b ) × f ¯ AJM ( b ) E ¯ 7

  6. Variable elimination: Basic operations Summing out a variable from a product of factors: move any constant factors outside the summation add up submatrices in pointwise product of remaining factors Σ x f 1 × · · · × f k = f 1 × · · · × f i Σ x f i +1 × · · · × f k = f 1 × · · · × f i × f ¯ X assuming f 1 , . . . , f i do not depend on X Pointwise product of factors f 1 and f 2 : f 1 ( x 1 , . . . , x j , y 1 , . . . , y k ) × f 2 ( y 1 , . . . , y k , z 1 , . . . , z l ) = f ( x 1 , . . . , x j , y 1 , . . . , y k , z 1 , . . . , z l ) E.g., f 1 ( a, b ) × f 2 ( b, c ) = f ( a, b, c ) 8

  7. Summing ¡Out ¡A ¡Variable ¡From ¡a ¡Factor ¡ a 1 b 1 c 1 0.25 a 1 b 1 c 2 0.35 a 1 b 2 c 1 0.08 a 1 c 1 a 1 b 2 c 2 0.16 0.33 a 1 c 2 a 2 b 1 c 1 0.05 0.51 a 2 c 1 a 2 b 1 c 2 0.07 0.05 a 2 c 2 a 2 b 2 c 1 0.07 0 a 3 c 1 a 2 b 2 c 2 0.24 0 a 3 c 2 a 3 b 1 c 1 0.39 0.15 a 3 b 1 c 2 0.21 a 3 b 2 c 1 0.09 a 3 b 2 c 2 0.18

  8. Factor ¡Product ¡ a 1 b 1 c 1 0.5 ⋅ 0.5 = 0.25 a 1 b 1 c 2 0.5 ⋅ 0.7 = 0.35 a 1 b 2 c 1 0.8 ⋅ 0.1 = 0.08 a 1 b 1 a 1 b 2 c 2 0.5 0.8 ⋅ 0.2 = 0.16 a 1 b 2 b 1 c 1 a 2 b 1 c 1 0.8 0.5 0.1 ⋅ 0.5 = 0.05 b 1 c 2 a 2 b 1 a 2 b 1 c 2 0.1 0.7 0.1 ⋅ 0.7 = 0.07 a 2 b 2 b 2 c 1 a 2 b 2 c 1 0 0.1 0 ⋅ 0.1 = 0 a 3 b 1 b 2 c 2 a 2 b 2 c 2 0.3 0 ⋅ 0.2 = 0 0.2 a 3 b 2 a 3 b 1 c 1 0.9 0.3 ⋅ 0.5 = 0.15 a 3 b 1 c 2 0.3 ⋅ 0.7 = 0.21 a 3 b 2 c 1 0.9 ⋅ 0.1 = 0.09 a 3 b 2 c 2 0.9 ⋅ 0.2 = 0.18

  9. Variable elimination algorithm function Elimination-Ask ( X , e , bn ) returns a distribution over X inputs : X , the query variable e , evidence specified as an event bn , a belief network specifying joint distribution P ( X 1 , . . . , X n ) factors ← [ ] ; vars ← Reverse ( Vars [ bn ]) for each var in vars do factors ← [ Make-Factor ( var , e ) | factors ] if var is a hidden variable then factors ← Sum-Out ( var , factors ) return Normalize ( Pointwise-Product ( factors )) 9

  10. Belief ¡Propaga8on: ¡Mo8va8on ¡ • What ¡if ¡we ¡want ¡to ¡compute ¡all ¡marginals, ¡not ¡ just ¡one? ¡ • Doing ¡variable ¡elimina8on ¡for ¡each ¡one ¡ in ¡turn ¡is ¡inefficient ¡ • Solu8on: ¡Belief ¡Propaga8on ¡ – Same ¡idea ¡as ¡Forward-­‑backward ¡for ¡HMMs ¡

  11. Belief ¡Propaga8on ¡ • Previously: ¡Forward-­‑backward ¡algorithm ¡ – Exactly ¡computes ¡posterior ¡marginals ¡P(h_i|V) ¡for ¡ chain-­‑structured ¡graphical ¡models ¡(e.g. ¡HMMs) ¡ • Where ¡V ¡are ¡visible ¡variables ¡ • h_i ¡is ¡the ¡hidden ¡variable ¡at ¡posi8on ¡I ¡ • Now ¡we ¡will ¡generalize ¡this ¡to ¡arbitrary ¡graphs ¡ – Bayesian ¡and ¡Markov ¡Networks ¡ – Arbitrary ¡graph ¡structures ¡(not ¡just ¡chains) ¡ • We’ll ¡just ¡describe ¡the ¡algorithms ¡and ¡omit ¡ deriva8ons ¡(K+F ¡book ¡has ¡good ¡coverage) ¡

  12. BP: ¡Ini8al ¡Assump8ons ¡ • Pairwise ¡MRF: ¡ 1 Y Y P ( x | v ) = ψ s ( x s ) ψ s ( x s , x t ) Z ( v ) s ∈ V ( s,t ) ∈ E • One ¡factor ¡for ¡each ¡variable ¡ • One ¡factor ¡for ¡each ¡edge ¡ • Tree-­‑structure ¡ • models ¡with ¡higher-­‑order ¡cliques ¡later… ¡

  13. Belief ¡Propaga8on ¡ • Pick ¡an ¡arbitrary ¡node: ¡call ¡it ¡the ¡root ¡ • Orient ¡edges ¡away ¡from ¡root ¡(dangle ¡down) ¡ • Well-­‑defined ¡no8on ¡of ¡parent ¡and ¡child ¡ • 2 ¡phases ¡to ¡BP ¡algorithm: ¡ 1. Send ¡messages ¡up ¡to ¡root ¡(collect ¡evidence) ¡ 2. Send ¡messages ¡back ¡down ¡from ¡the ¡root ¡ (distribute ¡evidence) ¡ • Generalize ¡forward-­‑backward ¡from ¡chains ¡to ¡ trees ¡

  14. Collect ¡to ¡root ¡phase ¡ root t v − st s u s 1 s 2 u 1 u 2

  15. Collect ¡to ¡root: ¡Details ¡ • Bo`om-­‑up ¡belief ¡state: ¡ bel − t ( x t ) ≡ p ( x t | v − t ) – Probability ¡of ¡x_t ¡given ¡all ¡the ¡evidence ¡at ¡or ¡ below ¡node ¡t ¡in ¡the ¡tree ¡ • How ¡to ¡compute ¡the ¡bo`om ¡up ¡belief ¡state? ¡ • “messages” ¡ from ¡t’s ¡children ¡ ¡ – Recursively ¡defined ¡based ¡on ¡belief ¡states ¡of ¡ children ¡ – Summarize ¡what ¡they ¡think ¡t ¡should ¡know ¡about ¡ the ¡evidence ¡in ¡their ¡subtrees ¡ m − s → t ( x t ) ≡ p ( x t | v − st )

  16. Compu8ng ¡the ¡upward ¡belief ¡state ¡ t ) = 1 Y bel − t ( x t ) ≡ p ( x t | v − m − ψ t ( x t ) c → t ( x t ) Z t c ∈ ch ( t ) • Belief ¡state ¡at ¡node ¡t ¡is ¡the ¡normalized ¡ product ¡of: ¡ – Incoming ¡messages ¡from ¡children ¡ – Local ¡evidence ¡

  17. Q: ¡how ¡to ¡compute ¡upward ¡messages? ¡ • Assume ¡we ¡have ¡computed ¡belief ¡states ¡of ¡ children, ¡then ¡message ¡is: ¡ X ψ st ( x s , x t )bel − m − s → t ( x t ) = s ( x s ) x s • Convert ¡beliefs ¡about ¡child ¡(s) ¡into ¡belifs ¡ about ¡parent ¡(t) ¡by ¡using ¡the ¡edge ¡poten8al ¡

  18. Comple8ng ¡the ¡Upward ¡Pass ¡ • Con8nue ¡in ¡this ¡way ¡un8l ¡we ¡reach ¡the ¡root ¡ • Analogous ¡to ¡forward ¡pass ¡in ¡HMM ¡ • Can ¡compute ¡the ¡probability ¡of ¡evidence ¡as ¡a ¡ side ¡effect ¡ Can ¡now ¡pass ¡messages ¡ down ¡from ¡root ¡

  19. Compu8ng ¡the ¡belief ¡state ¡for ¡node ¡s ¡ bel s ( x s ) ≡ p ( x s | v ) • Combine ¡the ¡bo`om-­‑up ¡belief ¡for ¡node ¡s ¡with ¡ a ¡top-­‑down ¡message ¡for ¡t ¡ – Top-­‑down ¡message ¡summarizes ¡all ¡the ¡ informa8on ¡in ¡the ¡rest ¡of ¡the ¡graph: ¡ m + t → s ( x s ) ≡ p ( x t | v + st ) – v_st+ ¡is ¡all ¡the ¡evidence ¡on ¡the ¡upstream ¡(root) ¡ side ¡of ¡the ¡edge ¡s ¡-­‑ ¡t ¡

  20. Distribute ¡from ¡ Send ¡to ¡Root ¡ Root ¡ v + st root root t t v − st s u s u s 1 s 2 u 1 u 2 s 1 s 2 u 1 u 2

  21. Compu8ng ¡Beliefs: ¡ Y m + bel s ( x s ) ≡ p ( x s | v ) ∝ bel − s ( x s ) t → s ( x s ) t ∈ pa ( s ) • Combine ¡bo`om-­‑up ¡beliefs ¡with ¡top-­‑down ¡ messages ¡

  22. Q: ¡how ¡to ¡compute ¡top-­‑down ¡ messages? ¡ • Consider ¡the ¡message ¡from ¡ t ¡to ¡ s ¡ • Suppose ¡t’s ¡parent ¡is ¡r ¡ • t’s ¡children ¡are ¡s ¡and ¡u ¡ • (like ¡in ¡the ¡figure) ¡

  23. Q: ¡how ¡to ¡compute ¡top-­‑down ¡ messages? ¡ • We ¡want ¡the ¡message ¡to ¡include ¡all ¡the ¡ informa8on ¡t ¡has ¡received ¡except ¡informa8on ¡ that ¡s ¡sent ¡it ¡ ψ ( x s , x t ) bel t ( x t ) X m + t → s ( x s ) ≡ p ( x t | v + st ) = m − s → t ( x t ) x t

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