CS 6355: Structured Prediction
General Formulations for Structures: Markov Logic
1
General Formulations for Structures: Markov Logic CS 6355: - - PowerPoint PPT Presentation
General Formulations for Structures: Markov Logic CS 6355: Structured Prediction 1 This lecture Graphical models Bayesian Networks Markov Random Fields (MRFs) Formulations of structured output Joint models Markov Logic
1
2
3
4
5
6
7
8
9
10
11
12
13
[Example from Domingos and Lowd 2009]
14
[Example from Domingos and Lowd 2009]
15
[Example from Domingos and Lowd 2009]
From rules to graphical models
∀𝑦, Smokes 𝑦 ⇒ Cancer(𝑦) ∀𝑦, 𝑧 Friends 𝑦, 𝑧 ∧ Smokes 𝑦 ⇒ Smokes(𝑧)
16
[Example from Domingos and Lowd 2009]
From rules to graphical models
∀𝑦, Smokes 𝑦 ⇒ Cancer(𝑦) ∀𝑦, 𝑧 Friends 𝑦, 𝑧 ∧ Smokes 𝑦 ⇒ Smokes(𝑧)
17
[Example from Domingos and Lowd 2009]
From rules to graphical models
∀𝑦, Smokes 𝑦 ⇒ Cancer(𝑦) ∀𝑦, 𝑧 Friends 𝑦, 𝑧 ∧ Smokes 𝑦 ⇒ Smokes(𝑧) ∀𝑦, ¬Smokes 𝑦 ∨ Cancer 𝑦 ∀𝑦, 𝑧, ¬Friends 𝑦, 𝑧 ∨ ¬Smokes 𝑧 ∨ Cancer(𝑧)
18
[Example from Domingos and Lowd 2009]
From rules to graphical models
∀𝑦, Smokes 𝑦 ⇒ Cancer(𝑦) ∀𝑦, 𝑧 Friends 𝑦, 𝑧 ∧ Smokes 𝑦 ⇒ Smokes(𝑧) ∀𝑦, ¬Smokes 𝑦 ∨ Cancer 𝑦 ∀𝑦, 𝑧, ¬Friends 𝑦, 𝑧 ∨ ¬Smokes 𝑧 ∨ Cancer(𝑧)
19
[Example from Domingos and Lowd 2009]
From rules to graphical models
∀𝑦, Smokes 𝑦 ⇒ Cancer(𝑦) ∀𝑦, 𝑧 Friends 𝑦, 𝑧 ∧ Smokes 𝑦 ⇒ Smokes(𝑧) ∀𝑦, ¬Smokes 𝑦 ∨ Cancer 𝑦 ∀𝑦, 𝑧, ¬Friends 𝑦, 𝑧 ∨ ¬Smokes 𝑧 ∨ Cancer(𝑧)
20
[Example from Domingos and Lowd 2009]
∀𝑦, Smokes 𝑦 ⇒ Cancer(𝑦) ∀𝑦, 𝑧 Friends 𝑦, 𝑧 ∧ Smokes 𝑦 ⇒ Smokes(𝑧) ∀𝑦, ¬Smokes 𝑦 ∨ Cancer 𝑦 ∀𝑦, 𝑧, ¬Friends 𝑦, 𝑧 ∨ ¬Smokes 𝑧 ∨ Cancer(𝑧)
1.5 1.0
21
[Example from Domingos and Lowd 2009]
∀𝑦, Smokes 𝑦 ⇒ Cancer(𝑦) ∀𝑦, 𝑧 Friends 𝑦, 𝑧 ∧ Smokes 𝑦 ⇒ Smokes(𝑧) ∀𝑦, ¬Smokes 𝑦 ∨ Cancer 𝑦 ∀𝑦, 𝑧, ¬Friends 𝑦, 𝑧 ∨ ¬Smokes 𝑧 ∨ Cancer(𝑧)
22
Suppose there are two people in the world: Anna (A), Bob (B)
[Example from Domingos and Lowd 2009]
∀𝑦, Smokes 𝑦 ⇒ Cancer(𝑦) ∀𝑦, 𝑧 Friends 𝑦, 𝑧 ∧ Smokes 𝑦 ⇒ Smokes(𝑧) ∀𝑦, ¬Smokes 𝑦 ∨ Cancer 𝑦 ∀𝑦, 𝑧, ¬Friends 𝑦, 𝑧 ∨ ¬Smokes 𝑧 ∨ Cancer(𝑧)
1.5 1.0
23
Suppose there are two people in the world: Anna (A), Bob (B)
[Example from Domingos and Lowd 2009]
Each predicate gets grounded a random variable, one for each object in the world. So we will have predicates such as Smokes(A), Cancer(A), Smokes(B), Friends(A, B)…
∀𝑦, Smokes 𝑦 ⇒ Cancer(𝑦) ∀𝑦, 𝑧 Friends 𝑦, 𝑧 ∧ Smokes 𝑦 ⇒ Smokes(𝑧) ∀𝑦, ¬Smokes 𝑦 ∨ Cancer 𝑦 ∀𝑦, 𝑧, ¬Friends 𝑦, 𝑧 ∨ ¬Smokes 𝑧 ∨ Cancer(𝑧)
1.5 1.0
24
Suppose there are two people in the world: Anna (A), Bob (B)
[Example from Domingos and Lowd 2009]
Smokes(A) Smokes(B)
∀𝑦, Smokes 𝑦 ⇒ Cancer(𝑦) ∀𝑦, 𝑧 Friends 𝑦, 𝑧 ∧ Smokes 𝑦 ⇒ Smokes(𝑧) ∀𝑦, ¬Smokes 𝑦 ∨ Cancer 𝑦 ∀𝑦, 𝑧, ¬Friends 𝑦, 𝑧 ∨ ¬Smokes 𝑧 ∨ Cancer(𝑧)
1.5 1.0
25
Suppose there are two people in the world: Anna (A), Bob (B)
[Example from Domingos and Lowd 2009]
Cancer(A) Cancer(B) Smokes(A) Smokes(B)
∀𝑦, Smokes 𝑦 ⇒ Cancer(𝑦) ∀𝑦, 𝑧 Friends 𝑦, 𝑧 ∧ Smokes 𝑦 ⇒ Smokes(𝑧) ∀𝑦, ¬Smokes 𝑦 ∨ Cancer 𝑦 ∀𝑦, 𝑧, ¬Friends 𝑦, 𝑧 ∨ ¬Smokes 𝑧 ∨ Cancer(𝑧)
1.5 1.0
26
Suppose there are two people in the world: Anna (A), Bob (B)
[Example from Domingos and Lowd 2009]
Cancer(A) Cancer(B) Smokes(A) Smokes(B) Each clause becomes a factor that connects the associated random variables
∀𝑦, Smokes 𝑦 ⇒ Cancer(𝑦) ∀𝑦, 𝑧 Friends 𝑦, 𝑧 ∧ Smokes 𝑦 ⇒ Smokes(𝑧) ∀𝑦, ¬Smokes 𝑦 ∨ Cancer 𝑦 ∀𝑦, 𝑧, ¬Friends 𝑦, 𝑧 ∨ ¬Smokes 𝑧 ∨ Cancer(𝑧)
1.5 1.0
∀𝑦, Smokes 𝑦 ⇒ Cancer(𝑦) ∀𝑦, 𝑧 Friends 𝑦, 𝑧 ∧ Smokes 𝑦 ⇒ Smokes(𝑧) ∀𝑦, ¬Smokes 𝑦 ∨ Cancer 𝑦 ∀𝑦, 𝑧, ¬Friends 𝑦, 𝑧 ∨ ¬Smokes 𝑧 ∨ Cancer(𝑧)
1.5 1.0
27
Suppose there are two people in the world: Anna (A), Bob (B)
[Example from Domingos and Lowd 2009]
Cancer(A) Cancer(B) Smokes(A) Smokes(B)
28
Suppose there are two people in the world: Anna (A), Bob (B)
[Example from Domingos and Lowd 2009]
Friends(B,A) Cancer(A) Cancer(B) Friends(A,B) Smokes(A) Smokes(B)
∀𝑦, Smokes 𝑦 ⇒ Cancer(𝑦) ∀𝑦, 𝑧 Friends 𝑦, 𝑧 ∧ Smokes 𝑦 ⇒ Smokes(𝑧) ∀𝑦, ¬Smokes 𝑦 ∨ Cancer 𝑦 ∀𝑦, 𝑧, ¬Friends 𝑦, 𝑧 ∨ ¬Smokes 𝑧 ∨ Cancer(𝑧)
1.5 1.0
∀𝑦, Smokes 𝑦 ⇒ Cancer(𝑦) ∀𝑦, 𝑧 Friends 𝑦, 𝑧 ∧ Smokes 𝑦 ⇒ Smokes(𝑧) ∀𝑦, ¬Smokes 𝑦 ∨ Cancer 𝑦 ∀𝑦, 𝑧, ¬Friends 𝑦, 𝑧 ∨ ¬Smokes 𝑧 ∨ Cancer(𝑧)
1.5 1.0
29
Suppose there are two people in the world: Anna (A), Bob (B)
[Example from Domingos and Lowd 2009]
Friends(B,A) Cancer(A) Cancer(B) Friends(A,B) Smokes(A) Smokes(B)
30
Suppose there are two people in the world: Anna (A), Bob (B)
[Example from Domingos and Lowd 2009]
Friends(B,A) Cancer(A) Cancer(B) Friends(A,B) Smokes(A) Smokes(B) Friends(A,A) Friends(B,B)
∀𝑦, Smokes 𝑦 ⇒ Cancer(𝑦) ∀𝑦, 𝑧 Friends 𝑦, 𝑧 ∧ Smokes 𝑦 ⇒ Smokes(𝑧) ∀𝑦, ¬Smokes 𝑦 ∨ Cancer 𝑦 ∀𝑦, 𝑧, ¬Friends 𝑦, 𝑧 ∨ ¬Smokes 𝑧 ∨ Cancer(𝑧)
1.5 1.0
∀𝑦, Smokes 𝑦 ⇒ Cancer(𝑦) ∀𝑦, 𝑧 Friends 𝑦, 𝑧 ∧ Smokes 𝑦 ⇒ Smokes(𝑧) ∀𝑦, ¬Smokes 𝑦 ∨ Cancer 𝑦 ∀𝑦, 𝑧, ¬Friends 𝑦, 𝑧 ∨ ¬Smokes 𝑧 ∨ Cancer(𝑧)
1.5 1.0
31
Suppose there are two people in the world: Anna (A), Bob (B)
[Example from Domingos and Lowd 2009]
Friends(B,A) Cancer(A) Cancer(B) Friends(A,B) Smokes(A) Smokes(B) Friends(A,A) Friends(B,B)
32
[Example from Domingos and Lowd 2009]
World = {Anna (A), Bob (B)}
∀𝑦, Smokes 𝑦 ⇒ Cancer(𝑦) ∀𝑦, 𝑧 Friends 𝑦, 𝑧 ∧ Smokes 𝑦 ⇒ Smokes(𝑧)
1.5 1.0
33
[Example from Domingos and Lowd 2009]
Friends(B,A) Cancer(A) Cancer(B) Friends(A,B) Smokes(A) Smokes(B) Friends(A,A) Friends(B,B) World = {Anna (A), Bob (B)}
∀𝑦, Smokes 𝑦 ⇒ Cancer(𝑦) ∀𝑦, 𝑧 Friends 𝑦, 𝑧 ∧ Smokes 𝑦 ⇒ Smokes(𝑧)
Short hand notation for a large factor graph
1.5 1.0
34
[Example from Domingos and Lowd 2009]
World = {Anna (A), Bob (B)}
∀𝑦, Smokes 𝑦 ⇒ Cancer(𝑦) ∀𝑦, 𝑧 Friends 𝑦, 𝑧 ∧ Smokes 𝑦 ⇒ Smokes(𝑧)
Short hand notation for a large factor graph
1.5 1.0
35
[Example from Domingos and Lowd 2009]
World = {Anna (A), Bob (B)}
∀𝑦, Smokes 𝑦 ⇒ Cancer(𝑦) ∀𝑦, 𝑧 Friends 𝑦, 𝑧 ∧ Smokes 𝑦 ⇒ Smokes(𝑧)
Short hand notation for a large factor graph
1.5 1.0
Weight for the 𝑗LM formula
36
[Example from Domingos and Lowd 2009]
World = {Anna (A), Bob (B)}
∀𝑦, Smokes 𝑦 ⇒ Cancer(𝑦) ∀𝑦, 𝑧 Friends 𝑦, 𝑧 ∧ Smokes 𝑦 ⇒ Smokes(𝑧)
Short hand notation for a large factor graph
1.5 1.0
Weight for the 𝑗LM formula Number of factors where the 𝑗LM formula holds (i.e. number of true groundings for the formula)
37
[Example from Domingos and Lowd 2009]
From rules to graphical models
38
39
∀𝑦, Smokes 𝑦 ⇒ Cancer(𝑦) ∀𝑦, 𝑧 Friends 𝑦, 𝑧 ∧ Smokes 𝑦 ⇒ Smokes(𝑧)
In a world where Smokes(Bob) and Friends(Anna, Bob) holds, Cancer(Anna) is forced to be true
40
41
42
43