Reasoning Under Uncertainty: Bayesian networks intro CPSC 322 – Uncertainty 4 Textbook §6.3 – 6.3.1 March 23, 2011.

Slides:



Advertisements
Similar presentations
CS188: Computational Models of Human Behavior
Advertisements

Probabilistic Reasoning Bayesian Belief Networks Constructing Bayesian Networks Representing Conditional Distributions Summary.
BAYESIAN NETWORKS. Bayesian Network Motivation  We want a representation and reasoning system that is based on conditional independence  Compact yet.
Department of Computer Science Undergraduate Events More
Reasoning under Uncertainty: Marginalization, Conditional Prob., and Bayes Computer Science cpsc322, Lecture 25 (Textbook Chpt ) Nov, 6, 2013.
Lirong Xia Hidden Markov Models Tue, March 28, 2014.
Reasoning Under Uncertainty: Bayesian networks intro Jim Little Uncertainty 4 November 7, 2014 Textbook §6.3, 6.3.1, 6.5, 6.5.1,
Lirong Xia Approximate inference: Particle filter Tue, April 1, 2014.
Hidden Markov Models Reading: Russell and Norvig, Chapter 15, Sections
CPSC 502, Lecture 11Slide 1 Introduction to Artificial Intelligence (AI) Computer Science cpsc502, Lecture 11 Oct, 18, 2011.
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.
Reasoning under Uncertainty: Conditional Prob., Bayes and Independence Computer Science cpsc322, Lecture 25 (Textbook Chpt ) March, 17, 2010.
Review: Bayesian learning and inference
CPSC 322, Lecture 30Slide 1 Reasoning Under Uncertainty: Variable elimination Computer Science cpsc322, Lecture 30 (Textbook Chpt 6.4) March, 23, 2009.
Bayesian networks Chapter 14 Section 1 – 2.
Bayesian Belief Networks
Decision Theory: Sequential Decisions Computer Science cpsc322, Lecture 34 (Textbook Chpt 9.3) April, 12, 2010.
Probabilistic Robotics Introduction Probabilities Bayes rule Bayes filters.
CPSC 322, Lecture 31Slide 1 Probability and Time: Markov Models Computer Science cpsc322, Lecture 31 (Textbook Chpt 6.5) March, 25, 2009.
CS 188: Artificial Intelligence Spring 2007 Lecture 14: Bayes Nets III 3/1/2007 Srini Narayanan – ICSI and UC Berkeley.
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)
CS 188: Artificial Intelligence Fall 2009 Lecture 19: Hidden Markov Models 11/3/2009 Dan Klein – UC Berkeley.
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,
Bayesian networks More commonly called graphical models A way to depict conditional independence relationships between random variables A compact specification.
Artificial Intelligence CS 165A Tuesday, November 27, 2007  Probabilistic Reasoning (Ch 14)
Read R&N Ch Next lecture: Read R&N
Uncertainty Probability and Bayesian Networks
Bayesian Belief Networks. What does it mean for two variables to be independent? Consider a multidimensional distribution p(x). If for two features we.
CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 13, 2012.
Recap: Reasoning Over Time  Stationary Markov models  Hidden Markov models X2X2 X1X1 X3X3 X4X4 rainsun X5X5 X2X2 E1E1 X1X1 X3X3 X4X4 E2E2 E3E3.
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.
UIUC CS 498: Section EA Lecture #21 Reasoning in Artificial Intelligence Professor: Eyal Amir Fall Semester 2011 (Some slides from Kevin Murphy (UBC))
Reasoning Under Uncertainty: Conditioning, Bayes Rule & the Chain Rule Jim Little Uncertainty 2 Nov 3, 2014 Textbook §6.1.3.
Instructor: Eyal Amir Grad TAs: Wen Pu, Yonatan Bisk Undergrad TAs: Sam Johnson, Nikhil Johri CS 440 / ECE 448 Introduction to Artificial Intelligence.
Probability Course web page: vision.cis.udel.edu/cv March 19, 2003  Lecture 15.
Reasoning under Uncertainty: Conditional Prob., Bayes and Independence Computer Science cpsc322, Lecture 25 (Textbook Chpt ) Nov, 5, 2012.
The famous “sprinkler” example (J. Pearl, Probabilistic Reasoning in Intelligent Systems, 1988)
Marginalization & Conditioning Marginalization (summing out): for any sets of variables Y and Z: Conditioning(variant of marginalization):
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.
Review: Bayesian inference  A general scenario:  Query variables: X  Evidence (observed) variables and their values: E = e  Unobserved variables: Y.
QUIZ!!  In HMMs...  T/F:... the emissions are hidden. FALSE  T/F:... observations are independent given no evidence. FALSE  T/F:... each variable X.
Reasoning Under Uncertainty: Independence Jim Little Uncertainty 3 Nov 5, 2014 Textbook §6.2.
Lecture 29 Conditional Independence, Bayesian networks intro Ch 6.3, 6.3.1, 6.5, 6.5.1,
Reasoning Under Uncertainty: Independence CPSC 322 – Uncertainty 3 Textbook §6.2 March 21, 2011.
Reasoning Under Uncertainty: Independence and Inference CPSC 322 – Uncertainty 5 Textbook §6.3.1 (and for HMMs) March 25, 2011.
Probabilistic Robotics Introduction Probabilities Bayes rule Bayes filters.
CPSC 322, Lecture 26Slide 1 Reasoning Under Uncertainty: Belief Networks Computer Science cpsc322, Lecture 27 (Textbook Chpt 6.3) Nov, 13, 2013.
PROBABILISTIC REASONING Heng Ji 04/05, 04/08, 2016.
Probabilistic Robotics Probability Theory Basics Error Propagation Slides from Autonomous Robots (Siegwart and Nourbaksh), Chapter 5 Probabilistic Robotics.
Instructor: Eyal Amir Grad TAs: Wen Pu, Yonatan Bisk Undergrad TAs: Sam Johnson, Nikhil Johri CS 440 / ECE 448 Introduction to Artificial Intelligence.
Reasoning Under Uncertainty: Variable Elimination CPSC 322 – Uncertainty 6 Textbook §6.4.1 March 28, 2011.
Chapter 12. Probability Reasoning Fall 2013 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University.
Computer Science CPSC 322 Lecture 19 Bayesian Networks: Construction 1.
Reasoning Under Uncertainty: Belief Networks
Today.
Reasoning Under Uncertainty: Conditioning, Bayes Rule & Chain Rule
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 14
Hidden Markov Models Part 2: Algorithms
CS 188: Artificial Intelligence Fall 2008
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 14
Probabilistic Reasoning
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 14
Presentation transcript:

Reasoning Under Uncertainty: Bayesian networks intro CPSC 322 – Uncertainty 4 Textbook §6.3 – March 23, 2011

Lecture Overview Recap: marginal and conditional independence Bayesian Networks Introduction Hidden Markov Models –Rainbow Robot Example 2

Marginal Independence Intuitively: if X ╨ Y, then –learning that Y=y does not change your belief in X –and this is true for all values y that Y could take For example, weather is marginally independent from the result of a coin toss 3

Marginal Independence 4

Conditional Independence 5 Intuitively: if X ╨ Y | Z, then –learning that Y=y does not change your belief in X when we already know Z=z –and this is true for all values y that Y could take and all values z that Z could take For example, ExamGrade ╨ AssignmentGrade | UnderstoodMaterial

Conditional Independence

Lecture Overview Recap: marginal and conditional independence Bayesian Networks Introduction Hidden Markov Models –Rainbow Robot Example 7

Bayesian Network Motivation We want a representation and reasoning system that is based on conditional (and marginal) independence –Compact yet expressive representation –Efficient reasoning procedures Bayesian Networks are such a representation –Named after Thomas Bayes (ca –1761) –Term coined in 1985 by Judea Pearl (1936 – ) –Their invention changed the focus on AI from logic to probability! Thomas Bayes Judea Pearl 8

Bayesian Networks: Intuition A graphical representation for a joint probability distribution –Nodes are random variables –Directed edges between nodes reflect dependence We already (informally) saw some examples: 9 Understood Material Assignment Grade Exam Grade Alarm Smoking At Sensor Fire Pos 0 Pos 1 Pos 2

Bayesian Networks: Definition 10

Bayesian Networks: Definition 11 Discrete Bayesian networks: –Domain of each variable is finite –Conditional probability distribution is a conditional probability table –We will assume this discrete case But everything we say about independence (marginal & conditional) carries over to the continuous case

Example for BN construction: Fire Diagnosis 12

Example for BN construction: Fire Diagnosis You want to diagnose whether there is a fire in a building You receive a noisy report about whether everyone is leaving the building If everyone is leaving, this may have been caused by a fire alarm If there is a fire alarm, it may have been caused by a fire or by tampering If there is a fire, there may be smoke 13

Example for BN construction: Fire Diagnosis First you choose the variables. In this case, all are Boolean: Tampering is true when the alarm has been tampered with Fire is true when there is a fire Alarm is true when there is an alarm Smoke is true when there is smoke Leaving is true if there are lots of people leaving the building Report is true if the sensor reports that lots of people are leaving the building Let’s construct the Bayesian network for this (whiteboard) –First, you choose a total ordering of the variables, let’s say: Fire; Tampering; Alarm; Smoke; Leaving; Report. 14

Example for BN construction: Fire Diagnosis Using the total ordering of variables: –Let’s say Fire; Tampering; Alarm; Smoke; Leaving; Report. Now choose the parents for each variable by evaluating conditional independencies –Fire is the first variable in the ordering. It does not have parents. –Tampering independent of fire (learning that one is true would not change your beliefs about the probability of the other) –Alarm depends on both Fire and Tampering: it could be caused by either or both –Smoke is caused by Fire, and so is independent of Tampering and Alarm given whether there is a Fire –Leaving is caused by Alarm, and thus is independent of the other variables given Alarm –Report is caused by Leaving, and thus is independent of the other variables given Leaving 15

Example for BN construction: Fire Diagnosis 16

Example for BN construction: Fire Diagnosis All variables are Boolean How many probabilities do we need to specify for this Bayesian network? –This time taking into account that probability tables have to sum to

Example for BN construction: Fire Diagnosis All variables are Boolean How many probabilities do we need to specify for this network? –This time taking into account that probability tables have to sum to 1 P(Tampering): 1 probability P(Alarm|Tampering, Fire): 4 1 probability for each of the 4 instantiations of the parents In total: = 12 18

P(Tampering=t)P(Tampering=f) Example for BN construction: Fire Diagnosis We don’t need to store P(Tampering=f) since probabilities sum to 1 19 P(Tampering=t) 0.02

Tampering TFire FP(Alarm=t|T,F)P(Alarm=f|T,F) tt0.5 tf ft ff Example for BN construction: Fire Diagnosis 20 P(Tampering=t) 0.02 P(Fire=t) 0.01 We don’t need to store P(Alarm=f|T,F) since probabilities sum to 1 Each row of this table is a conditional probability distribution Each column of this table is a conditional probability distribution

Example for BN construction: Fire Diagnosis 21 Tampering TFire FP(Alarm=t|T,F) tt0.5 tf0.85 ft0.99 ff P(Tampering=t) 0.02 P(Fire=t) 0.01 We don’t need to store P(Alarm=f|T,F) since probabilities sum to 1 Each row of this table is a conditional probability distribution

Example for BN construction: Fire Diagnosis P(Tampering=t, Fire=f, Alarm=t, Smoke=f, Leaving=t, Report=t) 22 Tampering TFire FP(Alarm=t|T,F) tt0.5 tf0.85 ft0.99 ff P(Tampering=t) 0.02 P(Fire=t) 0.01 Fire FP(Smoke=t |F) t0.9 f0.01 AlarmP(Leaving=t|A) t0.88 f0.001 LeavingP(Report=t|A) t0.75 f0.01

Example for BN construction: Fire Diagnosis 23 Tampering TFire FP(Alarm=t|T,F) tt0.5 tf0.85 ft0.99 ff P(Tampering=t) 0.02 P(Fire=t) 0.01 Fire FP(Smoke=t |F) t0.9 f0.01 AlarmP(Leaving=t|A) t0.88 f0.001 LeavingP(Report=t|A) t0.75 f0.01

What if we use a different ordering? 24 Leaving Report Tampering Smoke Alarm We end up with a completely different network structure! Which of the two structures is better (think computationally)? Fire The previous structure This structure Important for assignment 4, question 2: Say, we use the following order: –Leaving; Tampering; Report; Smoke; Alarm; Fire.

What if we use a different ordering? Important for assignment 4, question 2: Say, we use the following order: –Leaving; Tampering; Report; Smoke; Alarm; Fire. 25 Leaving Report Tampering Smoke Alarm We end up with a completely different network structure! Which of the two structures is better (think computationally)? –In the last network, we had to specify 12 probabilities –Here? = 23 –The causal structure typically leads to the most compact network Compactness typically enables more efficient reasoning Fire

Are there wrong network structures? Important for assignment 4, question 2 Some variable orderings yield more compact, some less compact structures –Compact ones are better –But all representations resulting from this process are correct –One extreme: the fully connected network is always correct but rarely the best choice How can a network structure be wrong? –If it misses directed edges that are required –E.g. an edge is missing below: Fire ╨ Alarm | {Tampering, Smoke} 26 Leaving Report Tampering Smoke Alarm Fire

Lecture Overview Recap: marginal and conditional independence Bayesian Networks Introduction Hidden Markov Models –Rainbow Robot Example 27

Markov Chains 28 X0X0 X1X1 X2X2 …

Stationary Markov Chains A stationary Markov chain is when –All state transition probability tables are the same –I.e., for all t > 0, t’ > 0: P(X t |X t-1 ) = P(X t’ |X t’-1 ) We only need to specify P(X 0 ) and P(X t |X t-1 ). –Simple model, easy to specify –Often the natural model –The network can extend indefinitely 29 X0X0 X1X1 X2X2 …

Hidden Markov Models (HMMs) A Hidden Markov Model (HMM) is a Markov chain plus a noisy observation about the state at each time step: 30 O1O1 X0X0 X1X1 O2O2 X2X2 …

Example HMM: Robot Tracking Robot tracking as an HMM: 31 Sens 1 Pos 0 Pos 1 Sens 2 Pos 2 Robot is moving at random: P(Pos t |Pos t-1 ) Sensor observations of the current state P(Sens t |Pos t ) …

Filtering in Hidden Markov Models (HMMs) 32 O1O1 X0X0 X1X1 O2O2 X2X2 Filtering problem in HMMs: at time step t, we would like to know P(X t |O 1, …, O t ) We will derive simple update equations: –Compute P(X t |O 1, …, O t ) if we already know P(X t-1 |O 1, …, O t-1 ) …

HMM Filtering: first time step O1O1 X0X0 X1X1 Direct application of Bayes rule O 1 ╨ X 0 | X 1 and product rule By applying marginalization over X 0 “backwards”: Normalize to make the probability to sum to 1.

HMM Filtering: general time step t Direct application of Bayes rule O t ╨ {X t-1, O 1,…,O t-1 } | X t and X t ╨ {O 1,…,O t-1 } | X t-1 By applying marginalization over X t-1 “backwards”: Normalize to make the probability to sum to 1. OtOt X t-1 XtXt

HMM Filtering Summary 35 Observation probability Transition probability We already know this from the previous step

Build a Bayesian Network for a given domain Compute the representational savings in terms of number of probabilities required Assignment 4 available on WebCT –Due Monday, April 4 Can only use 2 late days So we can give out solutions to study for the final exam –Final exam: Monday, April 11 Less than 3 weeks from now –You should now be able to solve questions 1, 2, and 5 Material for Question 3: Friday, and wrap-up on Monday Material for Question 4: next week 36 Learning Goals For Today’s Class