Variable Elimination Dhruv Batra, 10-708 Recitation 10/16/2008.

Slides:



Advertisements
Similar presentations
Variational Inference Amr Ahmed Nov. 6 th Outline Approximate Inference Variational inference formulation – Mean Field Examples – Structured VI.
Advertisements

SSA and CPS CS153: Compilers Greg Morrisett. Monadic Form vs CFGs Consider CFG available exp. analysis: statement gen's kill's x:=v 1 p v 2 x:=v 1 p v.
Lirong Xia Bayesian networks (2) Thursday, Feb 25, 2014.
Junction Trees And Belief Propagation. Junction Trees: Motivation What if we want to compute all marginals, not just one? Doing variable elimination for.
Lirong Xia Approximate inference: Particle filter Tue, April 1, 2014.
IMPORTANCE SAMPLING ALGORITHM FOR BAYESIAN NETWORKS
Clique Trees Amr Ahmed October 23, Outline Clique Trees Representation Factorization Inference Relation with VE.
Belief Propagation by Jakob Metzler. Outline Motivation Pearl’s BP Algorithm Turbo Codes Generalized Belief Propagation Free Energies.
Junction Trees: Motivation Standard algorithms (e.g., variable elimination) are inefficient if the undirected graph underlying the Bayes Net contains cycles.
From Variable Elimination to Junction Trees
Reasoning under Uncertainty: Conditional Prob., Bayes and Independence Computer Science cpsc322, Lecture 25 (Textbook Chpt ) March, 17, 2010.
CPSC 322, Lecture 30Slide 1 Reasoning Under Uncertainty: Variable elimination Computer Science cpsc322, Lecture 30 (Textbook Chpt 6.4) March, 23, 2009.
Artificial Intelligence Probabilistic reasoning Fall 2008 professor: Luigi Ceccaroni.
Hidden Markov Model Special case of Dynamic Bayesian network Single (hidden) state variable Single (observed) observation variable Transition probability.
Bayesian Networks. Graphical Models Bayesian networks Conditional random fields etc.
Belief Propagation, Junction Trees, and Factor Graphs
CS 188: Artificial Intelligence Spring 2007 Lecture 14: Bayes Nets III 3/1/2007 Srini Narayanan – ICSI and UC Berkeley.
CS 188: Artificial Intelligence Fall 2006 Lecture 17: Bayes Nets III 10/26/2006 Dan Klein – UC Berkeley.
Announcements Homework 8 is out Final Contest (Optional)
CPSC 422, Lecture 18Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 18 Feb, 25, 2015 Slide Sources Raymond J. Mooney University of.
CS 188: Artificial Intelligence Fall 2009 Lecture 19: Hidden Markov Models 11/3/2009 Dan Klein – UC Berkeley.
. PGM 2002/3 – Tirgul6 Approximate Inference: Sampling.
Factor Graphs Young Ki Baik Computer Vision Lab. Seoul National University.
QUIZ!!  T/F: The forward algorithm is really variable elimination, over time. TRUE  T/F: Particle Filtering is really sampling, over time. TRUE  T/F:
Department of Computer Science Undergraduate Events More
1 Variable Elimination Graphical Models – Carlos Guestrin Carnegie Mellon University October 11 th, 2006 Readings: K&F: 8.1, 8.2, 8.3,
Announcements  Office hours this week Tuesday (as usual) and Wednesday  HW6 posted, due Monday 10/20.
Instructor: Eyal Amir Grad TAs: Wen Pu, Yonatan Bisk Undergrad TAs: Sam Johnson, Nikhil Johri CS 440 / ECE 448 Introduction to Artificial Intelligence.
Bayes’ Nets: Sampling [These slides were created by Dan Klein and Pieter Abbeel for CS188 Intro to AI at UC Berkeley. All CS188 materials are available.
Announcements Project 4: Ghostbusters Homework 7
1 CMSC 671 Fall 2001 Class #21 – Tuesday, November 13.
Marginalization & Conditioning Marginalization (summing out): for any sets of variables Y and Z: Conditioning(variant of marginalization):
1 BN Semantics 1 Graphical Models – Carlos Guestrin Carnegie Mellon University September 15 th, 2008 Readings: K&F: 3.1, 3.2, –  Carlos.
Bayesian Networks CSE 473. © D. Weld and D. Fox 2 Bayes Nets In general, joint distribution P over set of variables (X 1 x... x X n ) requires exponential.
CPSC 422, Lecture 11Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 11 Oct, 2, 2015.
QUIZ!!  In HMMs...  T/F:... the emissions are hidden. FALSE  T/F:... observations are independent given no evidence. FALSE  T/F:... each variable X.
Inference Algorithms for Bayes Networks
1 CMSC 671 Fall 2001 Class #20 – Thursday, November 8.
CSE 473: Artificial Intelligence Autumn 2011 Bayesian Networks: Inference Luke Zettlemoyer Many slides over the course adapted from either Dan Klein, Stuart.
Reasoning Under Uncertainty: Independence and Inference CPSC 322 – Uncertainty 5 Textbook §6.3.1 (and for HMMs) March 25, 2011.
Daphne Koller Overview Conditional Probability Queries Probabilistic Graphical Models Inference.
1 BN Semantics 2 – Representation Theorem The revenge of d-separation Graphical Models – Carlos Guestrin Carnegie Mellon University September 17.
1 Structure Learning (The Good), The Bad, The Ugly Inference Graphical Models – Carlos Guestrin Carnegie Mellon University October 13 th, 2008 Readings:
1 Variable Elimination Graphical Models – Carlos Guestrin Carnegie Mellon University October 15 th, 2008 Readings: K&F: 8.1, 8.2, 8.3,
1 BN Semantics 1 Graphical Models – Carlos Guestrin Carnegie Mellon University September 15 th, 2006 Readings: K&F: 3.1, 3.2, 3.3.
Probabilistic Reasoning Inference and Relational Bayesian Networks.
QUIZ!!  T/F: You can always (theoretically) do BNs inference by enumeration. TRUE  T/F: In VE, always first marginalize, then join. FALSE  T/F: VE is.
Integrative Genomics I BME 230. Probabilistic Networks Incorporate uncertainty explicitly Capture sparseness of wiring Incorporate multiple kinds of data.
3.5 Solving systems of equations in three variables Main Ideas Solve systems of linear equations in three variables. Solve real-world problems using systems.
Computer Science cpsc322, Lecture 25
Artificial Intelligence
Quizzz Rihanna’s car engine does not start (E).
CS 4/527: Artificial Intelligence
CAP 5636 – Advanced Artificial Intelligence
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 18
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 11
CHAPTER 7 BAYESIAN NETWORK INDEPENDENCE BAYESIAN NETWORK INFERENCE MACHINE LEARNING ISSUES.
Inference Inference: calculating some useful quantity from a joint probability distribution Examples: Posterior probability: Most likely explanation: B.
Readings: K&F: 15.1, 15.2, 15.3, 15.4, 15.5 K&F: 7 (overview of inference) K&F: 8.1, 8.2 (Variable Elimination) Structure Learning in BNs 3: (the good,
CS 188: Artificial Intelligence
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 11
CS 188: Artificial Intelligence Fall 2008
Class #16 – Tuesday, October 26
Readings: K&F: 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7 Markov networks, Factor graphs, and an unified view Start approximate inference If we are lucky… Graphical.
CS 188: Artificial Intelligence Fall 2007
CS 188: Artificial Intelligence Spring 2006
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 18
Variable Elimination Graphical Models – Carlos Guestrin
Presentation transcript:

Variable Elimination Dhruv Batra, Recitation 10/16/2008

Overview Variable Elimination –Example on chain networks –Intuition –Tools for VE, factor product, marginalization –Implementation hints

Chain Networks BN: Goal: Need all marginals P(X)

Chain Networks Naïve solution

Chain Networks A little smarter solution: Phased Computation General Chains: Why is this better? vs What’s the intuition?

Chain Networks A lot of structure

Chain Networks Let’s cache

Chain Networks Let’s cache again

Chain Networks Intuitions from this process –Group common things/terms/factors based on scope –Dynamic programming ideas: cache computations VE extends/formalizes these intuitions to general graphs –but separates the elimination ordering from the process

Another Idea A commonly used idea Goal Can forget about denominator; just renormalize when done

Example Let’s do an example for general graphs

Implementing VE What do you need to implement VE? –Reuse some code from HW2

Tools for VE Factors Special kind of factors: CPTs

Operations on Factors Factor Product –Consider two factors –Define factor product –such that

Operations on Factors Factor Product

Operations on Factors Factor Marginalization –Consider a factor –Define factor marginal –such that

Operations on Factors Factor Marginalization

Factors Are factors always distributions? –Obviously not Are factors produced in VE always distributions? –Yes, always conditional distributions –In SOME graph, not necessarily the original graph –HW3, prob 2. Hint: read

Implementing VE What do you need to implement VE? –Reuse some code from HW2 Representation –BN as an array of factors –table_factor.m –assignment.m VE –multipy_factors.m –marginalize_factor.m –min_fill.m

21 Variable elimination algorithm Given a BN and a query P(X|e) / P(X,e) Instantiate evidence e Prune non-active vars for {X,e} Choose an ordering on variables, e.g., X 1, …, X n Initial factors {f 1,…,f n }: f i = P(X i |Pa Xi ) (CPT for X i ) For i = 1 to n, If X i  {X,E}  Collect factors f 1,…,f k that include X i  Generate a new factor by eliminating X i from these factors  Variable X i has been eliminated! Normalize P(X,e) to obtain P(X|e)

Questions?