1 / 57

Relational Models in One Slide: Putting Probability Distributions on Everything

Learn how to put probability distributions on various types of objects, such as trees, graphs, relational databases, and more. Explore two approaches and understand how Markov Logic Networks work. Discover how Markov logic allows for interdependent objects and how it relates to statistical and first-order logic models. Master inference techniques in Markov Logic Networks for probabilistic reasoning.

bhouse
Télécharger la présentation

Relational Models in One Slide: Putting Probability Distributions on Everything

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Relational Models

  2. CSE 515 in One Slide We will learn to: • Put probability distributions on everything • Learn them from data • Do inference with them

  3. Beyond Vectors We want to put distributions on: • Trees • Graphs • Objects of different types and their relations • Class hierarchies • Relational databases • Knowledge bases • Programs • Etc.

  4. Two Approaches • Piecemeal • Develop probabilistic models for each • All-in-one • All are easily expressed in first-order logic • Add probability to first-order logic

  5. First-Order Logic Symbols: Constants, variables, functions, predicatesE.g.: Anna, x, MotherOf(x), Friends(x, y) Logical connectives: Conjunction, disjunction, negation, implication, quantification, etc. Literal: Atom (predicate) or its negation Clause: Disjunction of literals All formulas can be converted to conjunctionof clauses Grounding: Replace all variables by constantsE.g.: Friends (Anna, Bob) World: Assignment of truth values to all ground atoms

  6. Example: Friends & Smokers

  7. Example: Friends & Smokers

  8. Example: Friends & Smokers

  9. Relational Models

  10. Markov Logic • Most developed approach to date • Many other approaches can be viewedas special cases • Main focus of this lecture

  11. Markov Logic: Intuition • A logical KB is a set of hard constraintson the set of possible worlds • Let’s make them soft constraints:When a world violates a formula,It becomes less probable, not impossible • Give each formula a weight(Higher weight  Stronger constraint)

  12. Markov Logic: Definition • A Markov Logic Network (MLN) is a set of pairs (F, w) where • F is a formula in first-order logic • w is a real number • Together with a set of constants,it defines a Markov network with • One node for each grounding of each predicate in the MLN • One feature for each grounding of each formula F in the MLN, with the corresponding weight w

  13. Example: Friends & Smokers

  14. Example: Friends & Smokers Two constants: Anna (A) and Bob (B)

  15. Example: Friends & Smokers Two constants: Anna (A) and Bob (B) Smokes(A) Smokes(B) Cancer(A) Cancer(B)

  16. Example: Friends & Smokers Two constants: Anna (A) and Bob (B) Friends(A,B) Friends(A,A) Smokes(A) Smokes(B) Friends(B,B) Cancer(A) Cancer(B) Friends(B,A)

  17. Example: Friends & Smokers Two constants: Anna (A) and Bob (B) Friends(A,B) Friends(A,A) Smokes(A) Smokes(B) Friends(B,B) Cancer(A) Cancer(B) Friends(B,A)

  18. Example: Friends & Smokers Two constants: Anna (A) and Bob (B) Friends(A,B) Friends(A,A) Smokes(A) Smokes(B) Friends(B,B) Cancer(A) Cancer(B) Friends(B,A)

  19. Markov Logic Networks • MLN is template for ground Markov nets • Probability of a world x: • Typed variables and constants greatly reduce size of ground Markov net • Functions, existential quantifiers, etc. • Infinite and continuous domains Weight of formula i No. of true groundings of formula i in x

  20. Relation to Statistical Models • Markov logic has all the models we’ve seen in this class as special cases • Markov logic allows objects to be interdependent (non-i.i.d.) • Markov logic makes it easy to compose models

  21. Relation to First-Order Logic • Infinite weights  First-order logic • Satisfiable KB, positive weights Satisfying assignments = Modes of distribution • Markov logic allows contradictions between formulas

  22. Inference in Markov Logic • P(Formula|MLN,C) = ? • MCMC: Sample worlds, check formula holds • P(Formula1|Formula2,MLN,C) = ? • If Formula2 = Conjunction of ground atoms • First construct min subset of network necessary to answer query (generalization of KBMC) • Then apply MCMC, belief propagation, etc.

  23. Ground Network Construction network←Ø queue← query nodes repeat node← front(queue) remove node from queue add node to network if node not in evidence then add neighbors(node) to queue until queue = Ø

  24. Example Grounding Friends(A,B) Friends(A,A) Smokes(A) Smokes(B) Friends(B,B) Cancer(A) Cancer(B) Friends(B,A) P( Cancer(B) | Smokes(A), Friends(A,B), Friends(B,A))

  25. Example Grounding Friends(A,B) Friends(A,A) Smokes(A) Smokes(B) Friends(B,B) Cancer(A) Cancer(B) Friends(B,A) P( Cancer(B) | Smokes(A), Friends(A,B), Friends(B,A))

  26. Example Grounding Friends(A,B) Friends(A,A) Smokes(A) Smokes(B) Friends(B,B) Cancer(A) Cancer(B) Friends(B,A) P( Cancer(B) | Smokes(A), Friends(A,B), Friends(B,A))

  27. Example Grounding Friends(A,B) Friends(A,A) Smokes(A) Smokes(B) Friends(B,B) Cancer(A) Cancer(B) Friends(B,A) P( Cancer(B) | Smokes(A), Friends(A,B), Friends(B,A))

  28. Example Grounding Friends(A,B) Friends(A,A) Smokes(A) Smokes(B) Friends(B,B) Cancer(A) Cancer(B) Friends(B,A) P( Cancer(B) | Smokes(A), Friends(A,B), Friends(B,A))

  29. Example Grounding Friends(A,B) Friends(A,A) Smokes(A) Smokes(B) Friends(B,B) Cancer(A) Cancer(B) Friends(B,A) P( Cancer(B) | Smokes(A), Friends(A,B), Friends(B,A))

  30. Example Grounding Friends(A,B) Friends(A,A) Smokes(A) Smokes(B) Friends(B,B) Cancer(A) Cancer(B) Friends(B,A) P( Cancer(B) | Smokes(A), Friends(A,B), Friends(B,A))

  31. Example Grounding Friends(A,B) Friends(A,A) Smokes(A) Smokes(B) Friends(B,B) Cancer(A) Cancer(B) Friends(B,A) P( Cancer(B) | Smokes(A), Friends(A,B), Friends(B,A))

  32. Example Grounding Friends(A,B) Friends(A,A) Smokes(A) Smokes(B) Friends(B,B) Cancer(A) Cancer(B) Friends(B,A) P( Cancer(B) | Smokes(A), Friends(A,B), Friends(B,A))

  33. Other Options • Lazy inference • Lifted inference

  34. Learning • Data is a relational database • Closed world assumption → Complete data • Learning parameters (weights) • Learning structure (formulas)

  35. Weight Learning • Parameter tying: Groundings of same clause • Generative learning: Pseudo-likelihood • Discriminative learning: Cond. likelihood,use MC-SAT or MaxWalkSAT for inference No. of times clause i is true in data Expected no. times clause i is true according to MLN

  36. Structure Learning • Generalizes feature induction in Markov nets • Any inductive logic programming approachcan be used, but . . . • Goal is to induce any clauses, not just Horn • Evaluation function should be likelihood • Requires learning weights for each candidate • Turns out not to be bottleneck • Bottleneck is counting clause groundings • Solution: Subsampling

  37. Structure Learning • Initial state: Unit clauses or hand-coded KB • Operators: Add/remove literal, flip sign • Evaluation function:Pseudo-likelihood + Structure prior • Search: Beam, shortest-first, bottom-up, etc.

  38. Alchemy Open-source software including: • Full first-order logic syntax • Inference: MCMC, belief propagation, etc. • Generative & discriminative weight learning • Structure learning • Programming language features alchemy.cs.washington.edu

  39. Example:Information Extraction Parag Singla and Pedro Domingos, “Memory-Efficient Inference in Relational Domains”(AAAI-06). Singla, P., & Domingos, P. (2006). Memory-efficent inference in relatonal domains. In Proceedings of the Twenty-First National Conference on Artificial Intelligence (pp. 500-505). Boston, MA: AAAI Press. H. Poon & P. Domingos, Sound and Efficient Inference with Probabilistic and Deterministic Dependencies”, in Proc. AAAI-06, Boston, MA, 2006. P. Hoifung (2006). Efficent inference. In Proceedings of the Twenty-First National Conference on Artificial Intelligence.

  40. Segmentation Author Title Venue Parag Singla and Pedro Domingos, “Memory-Efficient Inference in Relational Domains”(AAAI-06). Singla, P., & Domingos, P. (2006). Memory-efficent inference in relatonal domains. In Proceedings of the Twenty-First National Conference on Artificial Intelligence (pp. 500-505). Boston, MA: AAAI Press. H. Poon & P. Domingos, Sound and Efficient Inference with Probabilistic and Deterministic Dependencies”, in Proc. AAAI-06, Boston, MA, 2006. P. Hoifung (2006). Efficent inference. In Proceedings of the Twenty-First National Conference on Artificial Intelligence.

  41. Entity Resolution Parag Singla and Pedro Domingos, “Memory-Efficient Inference in Relational Domains”(AAAI-06). Singla, P., & Domingos, P. (2006). Memory-efficent inference in relatonal domains. In Proceedings of the Twenty-First National Conference on Artificial Intelligence (pp. 500-505). Boston, MA: AAAI Press. H. Poon & P. Domingos, Sound and Efficient Inference with Probabilistic and Deterministic Dependencies”, in Proc. AAAI-06, Boston, MA, 2006. P. Hoifung (2006). Efficent inference. In Proceedings of the Twenty-First National Conference on Artificial Intelligence.

  42. Entity Resolution Parag Singla and Pedro Domingos, “Memory-Efficient Inference in Relational Domains”(AAAI-06). Singla, P., & Domingos, P. (2006). Memory-efficent inference in relatonal domains. In Proceedings of the Twenty-First National Conference on Artificial Intelligence (pp. 500-505). Boston, MA: AAAI Press. H. Poon & P. Domingos, Sound and Efficient Inference with Probabilistic and Deterministic Dependencies”, in Proc. AAAI-06, Boston, MA, 2006. P. Hoifung (2006). Efficent inference. In Proceedings of the Twenty-First National Conference on Artificial Intelligence.

  43. State of the Art • Segmentation • HMM (or CRF) to assign each token to a field • Entity resolution • Logistic regression to predict same field/citation • Transitive closure • Alchemy implementation: Seven formulas

  44. Types and Predicates token = {Parag, Singla, and, Pedro, ...} field = {Author, Title, Venue} citation = {C1, C2, ...} position = {0, 1, 2, ...} Token(token, position, citation) InField(position, field, citation) SameField(field, citation, citation) SameCit(citation, citation)

  45. Types and Predicates token = {Parag, Singla, and, Pedro, ...} field = {Author, Title, Venue, ...} citation = {C1, C2, ...} position = {0, 1, 2, ...} Token(token, position, citation) InField(position, field, citation) SameField(field, citation, citation) SameCit(citation, citation) Optional

  46. Types and Predicates token = {Parag, Singla, and, Pedro, ...} field = {Author, Title, Venue} citation = {C1, C2, ...} position = {0, 1, 2, ...} Token(token, position, citation) InField(position, field, citation) SameField(field, citation, citation) SameCit(citation, citation) Evidence

  47. Types and Predicates token = {Parag, Singla, and, Pedro, ...} field = {Author, Title, Venue} citation = {C1, C2, ...} position = {0, 1, 2, ...} Token(token, position, citation) InField(position, field, citation) SameField(field, citation, citation) SameCit(citation, citation) Query

  48. Formulas Token(+t,i,c) => InField(i,+f,c) InField(i,+f,c) <=> InField(i+1,+f,c) f != f’ => (!InField(i,+f,c) v !InField(i,+f’,c)) Token(+t,i,c) ^ InField(i,+f,c) ^ Token(+t,i’,c’) ^ InField(i’,+f,c’) => SameField(+f,c,c’) SameField(+f,c,c’) <=> SameCit(c,c’) SameField(f,c,c’) ^ SameField(f,c’,c”) => SameField(f,c,c”) SameCit(c,c’) ^ SameCit(c’,c”) => SameCit(c,c”)

  49. Formulas Token(+t,i,c) => InField(i,+f,c) InField(i,+f,c) <=> InField(i+1,+f,c) f != f’ => (!InField(i,+f,c) v !InField(i,+f’,c)) Token(+t,i,c) ^ InField(i,+f,c) ^ Token(+t,i’,c’) ^ InField(i’,+f,c’) => SameField(+f,c,c’) SameField(+f,c,c’) <=> SameCit(c,c’) SameField(f,c,c’) ^ SameField(f,c’,c”) => SameField(f,c,c”) SameCit(c,c’) ^ SameCit(c’,c”) => SameCit(c,c”)

  50. Formulas Token(+t,i,c) => InField(i,+f,c) InField(i,+f,c) <=> InField(i+1,+f,c) f != f’ => (!InField(i,+f,c) v !InField(i,+f’,c)) Token(+t,i,c) ^ InField(i,+f,c) ^ Token(+t,i’,c’) ^ InField(i’,+f,c’) => SameField(+f,c,c’) SameField(+f,c,c’) <=> SameCit(c,c’) SameField(f,c,c’) ^ SameField(f,c’,c”) => SameField(f,c,c”) SameCit(c,c’) ^ SameCit(c’,c”) => SameCit(c,c”)

More Related