Reasoning Under Uncertainty: Bnet Inference

Slides:



Advertisements
Similar presentations
Decision Theory: Sequential Decisions Computer Science cpsc322, Lecture 34 (Textbook Chpt 9.3) Nov, 28, 2012.
Advertisements

CPSC 422, Lecture 11Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 11 Jan, 29, 2014.
Reasoning under Uncertainty: Marginalization, Conditional Prob., and Bayes Computer Science cpsc322, Lecture 25 (Textbook Chpt ) Nov, 6, 2013.
Reasoning Under Uncertainty: Bayesian networks intro Jim Little Uncertainty 4 November 7, 2014 Textbook §6.3, 6.3.1, 6.5, 6.5.1,
Slide 1 Reasoning Under Uncertainty: More on BNets structure and construction Jim Little Nov (Textbook 6.3)
CPSC 322, Lecture 26Slide 1 Reasoning Under Uncertainty: Belief Networks Computer Science cpsc322, Lecture 27 (Textbook Chpt 6.3) March, 16, 2009.
Decision Theory: Single Stage Decisions Computer Science cpsc322, Lecture 33 (Textbook Chpt 9.2) March, 30, 2009.
Decision Theory: Sequential Decisions Computer Science cpsc322, Lecture 34 (Textbook Chpt 9.3) April, 1, 2009.
Reasoning under Uncertainty: Conditional Prob., Bayes and Independence Computer Science cpsc322, Lecture 25 (Textbook Chpt ) March, 17, 2010.
Marginal Independence and Conditional Independence Computer Science cpsc322, Lecture 26 (Textbook Chpt 6.1-2) March, 19, 2010.
CPSC 322, Lecture 30Slide 1 Reasoning Under Uncertainty: Variable elimination Computer Science cpsc322, Lecture 30 (Textbook Chpt 6.4) March, 23, 2009.
Decision Theory: Sequential Decisions Computer Science cpsc322, Lecture 34 (Textbook Chpt 9.3) April, 12, 2010.
CPSC 322, Lecture 28Slide 1 Reasoning Under Uncertainty: More on BNets structure and construction Computer Science cpsc322, Lecture 28 (Textbook Chpt 6.3)
CPSC 322, Lecture 31Slide 1 Probability and Time: Markov Models Computer Science cpsc322, Lecture 31 (Textbook Chpt 6.5) March, 25, 2009.
CPSC 322, Lecture 32Slide 1 Probability and Time: Hidden Markov Models (HMMs) Computer Science cpsc322, Lecture 32 (Textbook Chpt 6.5) March, 27, 2009.
CPSC 422, Lecture 18Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 18 Feb, 25, 2015 Slide Sources Raymond J. Mooney University of.
CPSC 422, Lecture 14Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 14 Feb, 4, 2015 Slide credit: some slides adapted from Stuart.
CPSC 322, Lecture 29Slide 1 Reasoning Under Uncertainty: Bnet Inference (Variable elimination) Computer Science cpsc322, Lecture 29 (Textbook Chpt 6.4)
CPSC 322, Lecture 24Slide 1 Reasoning under Uncertainty: Intro to Probability Computer Science cpsc322, Lecture 24 (Textbook Chpt 6.1, 6.1.1) March, 15,
Quiz 4: Mean: 7.0/8.0 (= 88%) Median: 7.5/8.0 (= 94%)
Reasoning Under Uncertainty: Bayesian networks intro CPSC 322 – Uncertainty 4 Textbook §6.3 – March 23, 2011.
Reasoning Under Uncertainty: Independence and Inference Jim Little Uncertainty 5 Nov 10, 2014 Textbook §6.3.1, 6.5, 6.5.1,
Department of Computer Science Undergraduate Events More
Bayesian networks. Motivation We saw that the full joint probability can be used to answer any question about the domain, but can become intractable as.
Reasoning Under Uncertainty: Conditioning, Bayes Rule & the Chain Rule Jim Little Uncertainty 2 Nov 3, 2014 Textbook §6.1.3.
Made by: Maor Levy, Temple University  Inference in Bayes Nets ◦ What is the probability of getting a strong letter? ◦ We want to compute the.
Reasoning under Uncertainty: Conditional Prob., Bayes and Independence Computer Science cpsc322, Lecture 25 (Textbook Chpt ) Nov, 5, 2012.
Lecture 33, Bayesian Networks Wrap Up Intro to Decision Theory Slide 1.
Computer Science CPSC 322 Lecture 27 Conditioning Ch Slide 1.
CPSC 422, Lecture 11Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 11 Oct, 2, 2015.
CPSC 422, Lecture 17Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 17 Oct, 19, 2015 Slide Sources D. Koller, Stanford CS - Probabilistic.
Reasoning Under Uncertainty: Independence and Inference CPSC 322 – Uncertainty 5 Textbook §6.3.1 (and for HMMs) March 25, 2011.
Belief Networks Kostas Kontogiannis E&CE 457. Belief Networks A belief network is a graph in which the following holds: –A set of random variables makes.
CPSC 322, Lecture 26Slide 1 Reasoning Under Uncertainty: Belief Networks Computer Science cpsc322, Lecture 27 (Textbook Chpt 6.3) Nov, 13, 2013.
Reasoning Under Uncertainty: Variable Elimination for Bayes Nets Jim Little Uncertainty 6 Nov Textbook §6.4,
Reasoning Under Uncertainty: Variable Elimination CPSC 322 – Uncertainty 6 Textbook §6.4.1 March 28, 2011.
Computer Science CPSC 322 Lecture 19 Bayesian Networks: Construction 1.
Computer Science cpsc322, Lecture 25
Reasoning Under Uncertainty: Belief Networks
Marginal Independence and Conditional Independence
Reasoning Under Uncertainty: More on BNets structure and construction
Today.
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 7
Reasoning Under Uncertainty: More on BNets structure and construction
Reasoning Under Uncertainty: Conditioning, Bayes Rule & Chain Rule
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 14
& Decision Theory: Intro
Decision Theory: Single Stage Decisions
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 11
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 18
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 11
Probability and Time: Markov Models
Reasoning Under Uncertainty: Bnet Inference
Probability and Time: Markov Models
Decision Theory: Sequential Decisions
Reasoning Under Uncertainty: Bnet Inference
CAP 5636 – Advanced Artificial Intelligence
Decision Theory: Single Stage Decisions
Probability and Time: Markov Models
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 11
CS 188: Artificial Intelligence
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 14
Logic: Domain Modeling /Proofs + Computer Science cpsc322, Lecture 22
Class #16 – Tuesday, October 26
Probability and Time: Markov Models
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 18
Reasoning Under Uncertainty: Variable elimination
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 7
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 7
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 14
Presentation transcript:

Reasoning Under Uncertainty: Bnet Inference (Variable elimination) Computer Science cpsc322, Lecture 29 (Textbook Chpt 6.4) June, 15, 2017 CPSC 322, Lecture 29

Recap Learning Goals previous lecture Bnets Inference Lecture Overview Recap Learning Goals previous lecture Bnets Inference Intro Factors Variable elimination Intro CPSC 322, Lecture 29

Learning Goals for previous class You can: In a Belief Net, determine whether one variable is independent of another variable, given a set of observations. Define and use Noisy-OR distributions. Explain assumptions and benefit. Implement and use a naïve Bayesian classifier. Explain assumptions and benefit. CPSC 322, Lecture 4

3 Configuration blocking dependency (belief propagation) Z X Y E 1 2 3 FALSE, because evidence from A reaches E via C. CPSC 322, Lecture 28

Bnets: Compact Representations n Boolean variables, k max. number of parents Model of internal medicine: 448 nodes,906 links 133,931,430 values required! Only one parent with h possible values CPSC 322, Lecture 29

Recap Learning Goals previous lecture Bnets Inference Lecture Overview Recap Learning Goals previous lecture Bnets Inference Intro Factors Variable elimination Algo CPSC 322, Lecture 29

Bnet Inference Our goal: compute probabilities of variables in a belief network What is the posterior distribution over one or more variables, conditioned on one or more observed variables? P(Alarm| Smoke ) P(Fire | Smoke ,Leaving ) e.g., P(A) P(A|Smoke=T) CPSC 322, Lecture 29

Bnet Inference: General Suppose the variables of the belief network are X1,…,Xn. Z is the query variable Y1=v1, …, Yj=vj are the observed variables (with their values) Z1, …,Zk are the remaining variables What we want to compute: Example: P(A|Smoke=T,Tampering=F) P(L | S = t , R = f) CPSC 322, Lecture 29

What do we need to compute? Remember conditioning and marginalization… P(L | S = t , R = f) L S R P(L, S=t, R=f ) t f Do they have to sum up to one? A. yes B. no The posterior distribution over one or more variables, conditioned on one or more observed variables can be computed as: L S R P(L | S=t, R=f ) t f CPSC 322, Lecture 29

In general….. We only need to compute the and then normalize This can be framed in terms of operations between factors (that satisfy the semantics of probability) The posterior distribution over one or more variables, conditioned on one or more observed variables can be computed as: CPSC 322, Lecture 29

Recap Bnets Bnets Inference Lecture Overview Intro Factors Variable elimination Algo CPSC 322, Lecture 29

Factors A factor is a representation of a function from a tuple of random variables into a number. We will write factor f on variables X1,… ,Xj as A factor can denote: One distribution One partial distribution Several distributions Several partial distributions over the given tuple of variables in some (unspecified) context

Factor: Examples Distribution Partial distribution P(X1, X2) is a factor f(X1, X2) Distribution X1 X2 f(X1 , X2) T .12 F .08 .72 P(X1, X2 = v2) is a factor f(X1) X2= v2 Partial distribution X1 X2 f(X1) X2= F T F .08 .72 CPSC 322, Lecture 29

Factors: More Examples A factor denotes one or more (possibly partial) distributions over the given tuple of variables e.g., P(X1, X2) is a factor f(X1, X2) e.g., P(X1, X2, X3 = v3) is a factor f(X1, X2) X3 = v3 e.g., P(X | Z,Y) is a factor f(X,Z,Y) e.g., P(X1, X3 = v3 | X2) is a factor f(X1, X2 ) X3 = v3 Distribution Partial distribution Set of Distributions X Y Z val t 0.1 f 0.9 0.2 f(X,Y,Z) ?? 0.8 0.4 0.6 0.3 0.7 Set of partial Distributions in some (unspecified) context C. P(Z|X,Y) A. P(X,Y,Z) B. P(Y|Z,X) D. None of the above CPSC 322, Lecture 10

Set of partial Distributions Factors A factor is a representation of a function from a tuple of random variables into a number. We will write factor f on variables X1,… ,Xj as A factor denotes one or more (possibly partial) distributions over the given tuple of variables P(Z|X,Y) e.g., P(X1, X2) is a factor f(X1, X2) e.g., P(X1, X2, X3 = v3) is a factor f(X1, X2) X3 = v3 e.g., P(X | Z,Y) is a factor f(X,Z,Y) e.g., P(X1, X3 = v3 | X2) is a factor f(X1, X2 ) X3 = v3 Distribution X Y Z val t 0.1 f 0.9 0.2 f(X,Y,Z) 0.8 0.4 0.6 0.3 0.7 Partial distribution in some (unspecified) context Set of Distributions Set of partial Distributions CPSC 322, Lecture 10

Manipulating Factors: We can make new factors out of an existing factor Our first operation: we can assign some or all of the variables of a factor. X Y Z val t 0.1 f 0.9 0.2 f(X,Y,Z): 0.8 0.4 0.6 0.3 0.7 What is the result of assigning X= t ? f(X=t,Y,Z) f(X, Y, Z)X = t CPSC 322, Lecture 29

More examples of assignment Y Z val t 0.1 f 0.9 0.2 r(X,Y,Z): 0.8 0.4 0.6 0.3 0.7 Y Z val t 0.1 r(X=t,Y,Z): f 0.9 0.2 0.8 0.9 0.8 Y val r(X=t,Y,Z=f): t f r(X=t,Y=f,Z=f): val CPSC 322, Lecture 29

Summing out a variable example Our second operation: we can sum out a variable, say X1 with domain {v1, …,vk} , from factor f(X1, …,Xj), resulting in a factor on X2, …,Xj defined by: B A C val t 0.03 f 0.07 0.54 0.36 f3(A,B,C): 0.06 0.14 0.48 0.32 A C val t Bf3(A,B,C): f 0.57 0.43 0.54 0.46 CPSC 322, Lecture 29

Multiplying factors Our third operation: factors can be multiplied together. A B Val t 0.1 f1(A,B): f 0.9 0.2 0.8 A B C val t f f1(A,B)× f2(B,C): B C Val t 0.3 f2(B,C): f 0.7 0.6 0.4 0.03 0.07 0.54 0.36 0.06 0.14 0.48 0.32 CPSC 322, Lecture 29

Multiplying factors Our third operation: factors can be multiplied together. A B Val t 0.1 f1(A,B): f 0.9 0.2 0.8 A B C val t f ?? f1(A,B)× f2(B,C): B C Val t 0.3 f2(B,C): f 0.7 0.6 0.4 0.03 0.07 0.54 0.36 0.06 0.14 0.48 0.32 C. 0.24 A. 0.32 B. 0.54 D. 0.06 CPSC 322, Lecture 29

Multiplying factors: Formal The product of factor f1(A, B) and f2(B, C), where B is the variable in common, is the factor (f1 × f2)(A, B, C) defined by: Note1: it's defined on all A, B, C triples, obtained by multiplying together the appropriate pair of entries from f1 and f2 . Note2: A, B, C can be sets of variables CPSC 322, Lecture 29

Factors Summary A factor is a representation of a function from a tuple of random variables into a number. f(X1,… ,Xj). We have defined three operations on factors: Assigning one or more variables f(X1=v1, X2, …,Xj) is a factor on X2, …,Xj , also written as f(X1, …, Xj)X1=v1 Summing out variables is a factor on X2, …,Xj X1 f(X1,X2, .. ,Xj) = f(X1=v1, X2, ,Xj) + … + f(X1=vk, X2, ,Xj) Multiplying factors f1(A, B) f2 (B, C) = (f1 × f2)(A, B, C) CPSC 322, Lecture 29

Recap Bnets Bnets Inference Lecture Overview Intro Factors Intro Variable elimination Algo CPSC 322, Lecture 29

Variable Elimination Intro Suppose the variables of the belief network are X1,…,Xn. Z is the query variable Y1=v1, …, Yj=vj are the observed variables (with their values) Z1, …,Zk are the remaining variables What we want to compute: We showed before that what we actually need to compute is P(A|Smoke=T,Tampering=F) This can be computed in terms of operations between factors (that satisfy the semantics of probability) CPSC 322, Lecture 29

Variable Elimination Intro If we express the joint as a factor, f (Z, Y1…,Yj , Z1…,Zj ) We can compute P(Z,Y1=v1, …,Yj=vj) by ?? assigning Y1=v1, …, Yj=vj and summing out the variables Z1, …,Zk But the whole point of having belief networks was to get rid of the joint We sum out these variables one at a time the order in which we do this is called our elimination ordering. Are we done? CPSC 322, Lecture 29

Learning Goals for today’s class You can: Define factors. Derive new factors from existing factors. Apply operations to factors, including assigning, summing out and multiplying factors. (Minimally) Carry out variable elimination by using factor representation and using the factor operations. Use techniques to simplify variable elimination. CPSC 322, Lecture 4

Next Class Course Elements Variable Elimination The algorithm An example Temporal models Course Elements Work on Practice Exercises 6A and 6B Assignment 3 is due on Tue the 20th ! Assignment 4 will be available on Tue. CPSC 322, Lecture 29