Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lifted First-Order Probabilistic Inference Rodrigo de Salvo Braz SRI International joint work with Eyal Amir and Dan Roth.

Similar presentations


Presentation on theme: "Lifted First-Order Probabilistic Inference Rodrigo de Salvo Braz SRI International joint work with Eyal Amir and Dan Roth."— Presentation transcript:

1 Lifted First-Order Probabilistic Inference Rodrigo de Salvo Braz SRI International joint work with Eyal Amir and Dan Roth

2 Outline Motivation  Brief background  Lifted Inference example First-order representations Lifted First-Order Probabilistic Inference  Inversion Elimination  Counting Elimination  Partial Inversion Lifted MPE Comparison to grounding Future Directions and Conclusion

3 Bayesian Networks (directed) epidemic P(sick_john, sick_mary, sick_bob, epidemic) = P(sick_john | epidemic) * P(sick_mary | epidemic) * P(sick_bob | epidemic) * P(epidemic) sick_john sick_marysick_bob P(sick_bob | epidemic) P(epidemic) P(sick_john | epidemic) P(sick_mary | epidemic)

4 Factor Networks (undirected) epidemic_france P(epi_france, epi_belgium, epi_uk, epi_germany) prop   (epi_france, epi_belgium) *   (epi_france, epi_uk) *   (epi_france, epi_germany) *   (epi_belgium, epi_germany) epidemic_belgiumepidemic_germany epidemic_uk     factor, or potential function

5 Bayesian Nets as Factor Networks epidemic P(sick_john, sick_mary, sick_bob, epidemic) prop P(sick_john | epidemic) * P(sick_mary | epidemic) * P(sick_bob | epidemic) * P(epidemic) sick_john sick_marysick_bob P(sick_bob | epidemic) P(epidemic) P(sick_john | epidemic) P(sick_mary | epidemic)

6 Inference: Marginalization epidemic P(sick_john) prop  epidemic  sick_mary  sick_bob P(sick_john | epidemic) * P(sick_mary | epidemic) * P(sick_bob | epidemic) * P(epidemic) sick_john sick_marysick_bob P(sick_bob | epidemic) P(epidemic) P(sick_john | epidemic) P(sick_mary | epidemic)

7 Inference: Variable Elimination (VE) epidemic sick_john sick_marysick_bob P(sick_bob | epidemic) P(epidemic) P(sick_john | epidemic) P(sick_mary | epidemic) P(sick_john) prop  epidemic P(sick_john | epidemic) * P(epidemic) *  sick_mary P(sick_mary | epidemic) *  sick_bob P(sick_bob | epidemic)

8 Inference: Variable Elimination (VE) epidemic sick_john sick_mary   (epidemic) P(epidemic) P(sick_john | epidemic) P(sick_mary | epidemic) P(sick_john) prop  epidemic P(sick_john | epidemic) * P(epidemic) *  sick_mary P(sick_mary | epidemic) *   (epidemic)

9 Inference: Variable Elimination (VE) epidemic sick_john sick_mary   (epidemic) P(epidemic) P(sick_john | epidemic) P(sick_mary | epidemic) P(sick_john) prop  epidemic P(sick_john | epidemic) * P(epidemic) *   (epidemic) *  sick_mary P(sick_mary | epidemic)

10 Inference: Variable Elimination (VE) epidemic sick_john   (epidemic) P(epidemic) P(sick_john | epidemic) P(sick_john) prop  epidemic P(sick_john | epidemic) * P(epidemic) *   (epidemic) *   (epidemic)   (epidemic)

11 Inference: Variable Elimination (VE) sick_john   (sick_john) P(sick_john) prop   (sick_john)

12 Outline Motivation  Brief background  Lifted Inference example First-order representations Lifted First-Order Probabilistic Inference  Inversion Elimination  Counting Elimination  Partial Inversion Lifted MPE Comparison to grounding Future Directions and Conclusion

13 A Lifted inference example Dependencies between  epidemic(Disease) and sick(Person, Disease)  sick(Person, Disease) and hospital(Person) Applied to many people and many diseases.

14 Combinatorial Explosion sick(mary,measles) hospital(mary) epidemic(measles)epidemic(flu) sick(mary,flu) … … sick(bob,measles) hospital(bob) sick(bob,flu) …… … …… …… Many random variables and factors

15 Much redundancy sick(mary,measles) hospital(mary) epidemic(measles)epidemic(flu) sick(mary,flu) … … sick(bob,measles) hospital(bob) sick(bob,flu) …… … …… ……

16 Representing structure sick(mary,measles) hospital(mary) epidemic(measles)epidemic(flu) sick(mary,flu) … … sick(bob,measles) hospital(bob) sick(bob,flu) …… … …… …… sick(P,D) hospital(P) epidemic(D) Parfactors, for parameterized factors Can be represented with formulas: 0.55: epidemic(D) => sick(P,D)

17 Lifted Inference Example P(hospital(john)) = ? sick(P,D) hospital(P) epidemic(D)

18 Lifted Inference Example epidemic(D) sick(john,D) P(hospital(john)) = ? sick(P,D) hospital(P)hospital(john) P  john

19 Lifted Inference Example epidemic(D) sick(john,D) P(hospital(john)) = ? sick(P,D) hospital(P)hospital(john) P  john... sick(mary,flu) hospital(mary) epidemic(flu)... sick(bob,measles) hospital(bob) epidemic(measles)

20 Lifted Inference Example P(hospital(john)) = ? hospital(P) epidemic(D) sick(john,D) hospital(john) P  john  ‘(e(D),h(P)) =  s(P,D):P  john   (s(P,D),e(D),)   (,s(P,D),h(P)) abbreviations Inversion Elimination

21 Lifted Inference Example P(hospital(john)) = ? hospital(P) epidemic(D) sick(john,D) hospital(john) P  john

22 Lifted Inference Example P(hospital(john)) = ? hospital(P) epidemic(D) hospital(john) P  john

23 P(hospital(john)) = ? Lifted Inference Example hospital(P) epidemic(D) hospital(john) P  john hospital(mary) epidemic(flu)epidemic(measles)... hospital(bob)...

24 Lifted Inference Example P(hospital(john)) = ? hospital(P) epidemic(D) hospital(john) P  john

25 Lifted Inference Example P(hospital(john)) = ? hospital(john) Counting Elimination

26 Outline Motivation  Brief background  Lifted Inference example First-order representations Lifted First-Order Probabilistic Inference  Inversion Elimination  Counting Elimination  Partial Inversion Lifted MPE Comparison to grounding Future Directions and Conclusion

27 Representing structure sick(P,D) hospital(P) epidemic(D) More intuitive More compact Represents structure explicitly Generalization of graphical models Atoms represent a set of random variables Logical Variables parameterize random variables Parfactors, for parameterized factors

28 Semantics sick(mary,measles) hospital(mary) epidemic(measles)epidemic(flu) sick(mary,flu) … … sick(bob,measles) hospital(bob) sick(bob,flu) …… … …… ……   sick(mary,measles), epidemic(measles))

29 Making use of structure in Inference Task: calculate marginals and posteriors: P(sick(bob, measles) | sick(mary,measles)) = ? Three approaches  plain propositionalization  dynamic construction (“smart” propositionalization)  lifted inference

30 Inference - Plain Propositionalization Instantiation of potential function for each instantiation Lots of redundant computation Lots of unnecessary random variables

31 Inference - Dynamic construction Instantiation of potential function for relevant parts P(hospital(mary) | no epidemics) = ? sick(mary,measles) hospital(mary) sick(mary, flu) … epidemic(measles)epidemic(flu) sick(mary, rubella) epidemic(rubella) …

32 Inference - Dynamic construction Instantiation of potential function for relevant parts P(hospital(mary) | no epidemics) = ? sick(mary,measles) hospital(mary) sick(mary, flu) … epidemic(measles)epidemic(flu) sick(mary, rubella) epidemic(rubella) … Much redundancy still

33 Inference - Dynamic construction Most common approach for exact First-order Probabilistic inference:  Knowledge-based construction (Breese, 1992)  Probabilistic Logic Programming (Ng & Subrahmanian, 1992)  Probabilistic Logic Programming (Ngo and Haddawy, 1995)  Probabilistic Relational Models (Friedman et al., 1999)  Relational Dependency Networks (Neville & Jensen, 2004)  Relational Bayesian networks (Jaeger, 1997)  Bayesian Logic Programs (Kersting & DeRaedt, 2001)  MEBN (Laskey, 2004)  Markov Logic Networks (Richardson & Domingos, 2004)

34 Inference - Lifted inference Inference on parameterized, or first-order, level; Performs certain inference steps once for a class of random variables; Poole (2003) describes a generalized Variable Elimination algorithm which we call Inversion Elimination. We formalized Inversion Elimination, showed its limitations and introduced Counting Elimination (IJCAI’05) and Partial Inversion (AAAI’06)

35 Outline Motivation  Brief background  Lifted Inference example First-order representations Lifted First-Order Probabilistic Inference  Inversion Elimination  Counting Elimination  Partial Inversion Lifted MPE Comparison to grounding Future Directions and Conclusion

36 Inversion Elimination (IE) sick(P, D) epidemic(D) D  measles Eliminate

37 Inversion Elimination (IE) … sick(john, flu) epidemic(flu) sick(mary, rubella) epidemic(rubella) … sick(P, D) epidemic(D) D  measles sick(mary, flu) epidemic(flu)

38 Inversion Elimination (IE) epidemic(flu)epidemic(rubella) … epidemic(D) D  measles epidemic(flu) Time complexity is irrelevant of domain size  sick(P,D)  (epidemic(D),sick(P,D))

39 Inversion Elimination (IE) sick(P, D) epidemic(D) D  measles IE … sick(john, flu) epidemic(flu) sick(mary, rubella) epidemic(rubella) … Grounding … sick(john, flu) epidemic(flu) sick(mary, rubella) epidemic(rubella) … VE Abstraction epidemic(D) D  measles sick(P, D)  sick(P,D)  (epidemic(D),sick(P,D))

40 Formalization of IE Joint distribution  D   (e(D))  P,D   (e(D),s(P,D)) Marginalization by eliminating class s(P,D):  s(.,. )  D   (e(D))  P,D   (e(D),s(P,D))  D   (e(D))  s(.,. )  P,D   (e(D),s(P,D))

41 Formalization of IE  s(.,. )  P,D   (e(D),s(P,D)) =  P,D  s(P,D)   (e(D),s(P,D)) =  P,D   (e(D)) =  D   |P| (e(D)) =  D   (e(D))

42 Formalization of IE  s(.,. )  P,D   (e(D),s(P,D)) =  s(p1,d1)  s(p1,d2)...  s(pn,dm)   (e(d 1 ),s(p 1,d 1 ))   (e(d 1 ),s(p 1,d 2 ))...   (e(d n ),s(p n,d m )) = (  s(p1,d1)   (e(d 1 ),s(p 1,d 1 )) )... (  s(p1,d2)   (e(d 1 ),s(p 1,d 2 )) )... (  s(pn,dm)   (e(d n ),s(p n,d m )) ) =  P,D  s(P,D)   (e(D ),s(P,D))

43 Formalization of IE By formalizing the problem of Inversion Elimination, we determined conditions for its application:  Eliminated atom must contain all logical variables in parfactors involved;  Eliminated atom instances must not occur together in the same instance of parfactor. These are both conditions for parallelism.

44 Inversion Elimination - Limitations - I Eliminated atom must contain all logical variables in parfactors involved. sick(P,D) epidemic(D)

45 Inversion Elimination - Limitations - I Eliminated atom must contain all logical variables in parfactors involved. sick(P,D) epidemic(D) Ok, contains both P and D

46 Inversion Elimination - Limitations - I Eliminated atom must contain all logical variables in parfactors involved. sick(P,D) epidemic(D) Not Ok, missing P sick(P,D)

47 Inversion Elimination - Limitations - I Eliminated atom must contain all logical variables in parfactors involved. q(Y,Z) p(X,Y) No atom can be eliminated

48 Inversion Elimination - Limitations - I Marginalization by eliminating class e(D):  e(.)  D,P   (e(D),s(P,D)) =  e(d1)...  e(dn)  P   (e(d 1 ),s(P,d 1 ))...  P   (e(d n ),s(P,d n )) = (  e(d1)  P   (e(d 1 ),s(P,d 1 )) )... (  e(dn)  P   (e(d n ),s(P,d n )) ) =  D  e(D)  P   (e(D),s(P,D))

49 Inversion Elimination - Limitations - II Requires eliminated RVs to occur in separate instances of parfactor … sick(mary, flu) epidemic(flu) sick(mary, rubella) epidemic(rubella) … sick(mary, D) epidemic(D) D  measles Inversion Elimination Ok

50 Inversion Elimination - Limitations - II epidemic(measles) epidemic(flu) epidemic(D2) epidemic(D1) epidemic(rubella) … Inversion Elimination Not Ok D1  D2 Requires eliminated RVs to occur in separate instances of parfactor

51 Inversion Elimination - Limitations - II  e(. )  D1  D2  (e(D 1 ),e(D 2 )) =  e(d1)...  e(dn)  (e(d 1 ), e(d 2 ))...  (e(d n-1 ),e(d n )) =  e(d1)  (e(d 1 ), e(d 2 ))...  e(dn)  (e(d n-1 ),e(d n ))

52 Outline Motivation  Brief background  Lifted Inference example First-order representations Lifted First-Order Probabilistic Inference  Inversion Elimination  Counting Elimination  Partial Inversion Lifted MPE Comparison to grounding Future Directions and Conclusion

53  e(. )  D1  D2  (e(D 1 ),e(D 2 )) =  e(. )  (0,0) #(0,0) in e(.),D1  D2  (0,1) #(0,1) in e(.),D1  D2  (1,0) #(1,0) in e(.),D1  D2  (1,1) #(1,1) in e(.),D1  D2 =  e(.)  v  (v) #v in e(.),D1  D2 =  ( )  v  (v) #v in e(.),D1  D2 (from i) |e(.)| i i=0 Counting Elimination e( ¢ ) 100 random variables i = 30 1’s #(0,1) = 70 * 30 #(1,1) = 30 * (30 – 1) Does depend on domain size, but not exponentially

54 No shared logical variables between atoms, so counting can be done independently  (epidemic(D 1, Region), epidemic(D 2, Region)) is not suitable for Counting elimination. Counting Elimination Conditions

55 Outline Motivation  Brief background  Lifted Inference example First-order representations Lifted First-Order Probabilistic Inference  Inversion Elimination  Counting Elimination  Partial Inversion Lifted MPE Comparison to grounding Future Directions and Conclusion

56 Some things not covered by both Inversion and Counting Eliminating epidemic from   epidemic(Disease1,Region), epidemic(Disease2,Region), other_RVs) No atom with all logical variables => no Inversion Elimination. Shared logical variables => no Counting Elimination.

57 Partial Inversion, graphically epidemic(D2,r 1 ) epidemic(D1,r 1 ) D1  D2 other_RVs epidemic(D2,R) epidemic(D1,R) D1  D2 other_RVs epidemic(D2,r 10 ) epidemic(D1,r 10 ) D1  D2 … … Each instance a counting elimination problem

58 Partial Inversion  e(.,.)  D1  D2,R   e(D 1,R), e(D 2,R), o )  R  e(.,R)  D1  D2   e(D 1,R), e(D 2,R), o )  R  ’  o ) =  ’  o ) |R| =  ’’  o ) Generalizes both Inversion and Counting Elimination R is bound => no shared logical variables => Counting Elimination

59   friends(X,Y), friends(Y,X), sick(X,D), sick(Y,D) ) Cannot partially invert on X,Y because friends(bob,mary) appears in more than one instance of parfactor. But with Partial Inversion we do not need all logical variables in order to invert. Partial Inversion Conditions

60 Outline Motivation  Brief background  Lifted Inference example First-order representations Lifted First-Order Probabilistic Inference  Inversion Elimination  Counting Elimination  Partial Inversion Lifted MPE Comparison to grounding Future Directions and Conclusion

61 Lifted MPE In propositional case, MPE done by factors containing MPE of eliminated variables. AB C D

62 MPE AB D BD  000.3C=1 010.2C=1 100.5C=0 110.9C=1 In propositional case, MPE done by factors containing MPE of eliminated variables.

63 MPE AB B  00.5C=1,D=0 11.4C=1,D=1 In propositional case, MPE done by factors containing MPE of eliminated variables.

64 MPE A A  MPE(B,C,D) 00.9B=0,C=1,D=0 10.7B=1,C=1,D=1 In propositional case, MPE done by factors containing MPE of eliminated variables.

65 MPE  0.9A=0,B=1,C=1,D=1 In propositional case, MPE done by factors containing MPE of eliminated variables.

66 MPE Same idea in First-order case But factors are quantified and so are assignments: p(X)q(X,Y)  MPE 000.3 r(X,Y) = 1 010.2 r(X,Y) = 1 100.5 r(X,Y) = 0 110.9 r(X,Y) = 1 for all X, Y  (p(X), q(X,Y))

67 MPE After Inversion Elimination of q(X,Y): p(X)q(X,Y)  MPE 000.3 r(X,Y) = 1 010.9 r(X,Y) = 1 100.5 r(X,Y) = 0 110.3 r(X,Y) = 1 for all X, Y  (p(X), q(X,Y)) p(X) ’’ MPE 00.05 for all Y q(X,Y) = 1, r(X,Y) = 1 10.02 for all Y q(X,Y) = 0, r(X,Y) = 1 for all X  ’ (p(X)) Lifted assignments

68 MPE After Inversion Elimination of p(X): for all X  ’ (p(X))  ’’ MPE 0.009 for all X, Y p(X) = 0, q(X,Y) = 1, r(X,Y) = 0  ’’ () p(X) ’’ MPE 00.05 for all Y q(X,Y) = 1, r(X,Y) = 1 10.02 for all Y q(X,Y) = 0, r(X,Y) = 1

69 MPE After Counting Elimination of e: e(D1)e(D2)  MPE 000.3 r(D1,D2) = 1 010.9 r(D1,D2) = 1 100.5 r(D1,D2) = 0 110.3 r(D1,D2) = 1 for all D1, D2  (e(D1), e(D2)) ’’ MPE 0.05 Exists 38 D1,D2 e(D1)=0, e(D2) = 0, r(D1,D2) = 1 Exists 12 D1,D2 e(D1)=0, e(D2) = 1, r(D1,D2) = 1 Exists 15 D1,D2 e(D1)=1, e(D2) = 0, r(D1,D2) = 0 Exists 25 D1,D2 e(D1)=1, e(D2) = 1, r(D1,D2) = 1  ’ ()

70 Outline Motivation  Brief background  Lifted Inference example First-order representations Lifted First-Order Probabilistic Inference  Inversion Elimination  Counting Elimination  Partial Inversion Lifted MPE Comparison to grounding Future Directions and Conclusion

71 Comparison to grounding

72 Outline Motivation  Brief background  Lifted Inference example First-order representations Lifted First-Order Probabilistic Inference  Inversion Elimination  Counting Elimination  Partial Inversion Lifted MPE Comparison to grounding Future Directions and Conclusion

73 Current work and future directions Parameterized queries: P(sick(X, measles)) ? Result: if X = john then 0.3 else 0.7 Aggregate factors (noisy or, for example) Uninterpreted functions:  (diabetes(X), diabetes(father(X))) Interpreted functions:  (p(I, J), p(I + 1, J + 1)) Anytime with bounds and other approximations

74 Conclusion Expressive probabilistic representations can and should be used in inference, too. Lifted inference equivalent to grounded inference; much faster, yet yielding the same exact answer. Groundwork for much more expressive and faster systems.

75


Download ppt "Lifted First-Order Probabilistic Inference Rodrigo de Salvo Braz SRI International joint work with Eyal Amir and Dan Roth."

Similar presentations


Ads by Google