CS 730/730W/830: Intro AI 1 handout: slides final blog entries were due Wheeler Ruml (UNH) Lecture 27, CS 730 1 / 15
Reminder Wheeler Ruml (UNH) Lecture 27, CS 730 2 / 15
The Alarm Domain Reminder Wheeler Ruml (UNH) Lecture 27, CS 730 3 / 15
Bayes Nets Reminder Reminder In general: P(x 1,...,x n ) = P(x n x n 1,...,x 1 )P(x n 1,...,x 1 ) Wheeler Ruml (UNH) Lecture 27, CS 730 4 / 15
Bayes Nets Reminder Reminder In general: P(x 1,...,x n ) = P(x n x n 1,...,x 1 )P(x n 1,...,x 1 ) n = P(x i x i 1,...,x 1 ) i=1 Bayes Net specifies independence: joint distribution: P(X i X i 1,...,X 1 ) = P(X i parents(x i )) P(x 1,...,x n ) = n i=1 P(x i parents(x i )) What is distribution of X given evidence e and unobserved Y? Wheeler Ruml (UNH) Lecture 27, CS 730 4 / 15
Basic Sampling Rej. Sampling Likelihood Wting Break Approximate Inference Wheeler Ruml (UNH) Lecture 27, CS 730 5 / 15
Sampling According to the Joint Distribution Basic Sampling Rej. Sampling Likelihood Wting Break sample values for variables, working top down directly implements the semantics of the network generative model each sample is linear time Wheeler Ruml (UNH) Lecture 27, CS 730 6 / 15
Rejection Sampling Basic Sampling Rej. Sampling Likelihood Wting Break What is distribution of X given evidence e and unobserved Y? Draw worlds from the joint, rejecting those that do not match e. Look at distribution of X. each sample is linear time, but overall slow if e is unlikely Wheeler Ruml (UNH) Lecture 27, CS 730 7 / 15
Likelihood Weighting Basic Sampling Rej. Sampling Likelihood Wting Break What is distribution of X given evidence e and unobserved Y? ChooseSample (e) w 1 for each variable V i in topological order: if (V i = v i ) e then w w P(v i parents(v i )) else v i sample from P(V i parents(v i )) (afterwards, normalize samples so all w s sum to 1) uses all samples, but needs lots of samples if e are late in ordering Wheeler Ruml (UNH) Lecture 27, CS 730 8 / 15
Break Basic Sampling Rej. Sampling Likelihood Wting Break exam 3: calculator, review session May 4 projects Wheeler Ruml (UNH) Lecture 27, CS 730 9 / 15
Enumeration Var. Elim. 1 Var. Elim. 2 EOLQs in Wheeler Ruml (UNH) Lecture 27, CS 730 10 / 15
Enumeration Over the Joint Distribution What is distribution of X given evidence e and unobserved Y? Enumeration Var. Elim. 1 Var. Elim. 2 EOLQs P(X e) = P(e X)P(X) P(e) = αp(x,e) = α y P(X,e,y) = α y n P(V i parents(v i )) i=1 Wheeler Ruml (UNH) Lecture 27, CS 730 11 / 15
Example Enumeration Var. Elim. 1 Var. Elim. 2 EOLQs P(B j,m) = P(j,m B)P(B) P(j,m) = αp(b,j,m) = α P(B,e,a,j,m) e a = α n P(V i parents(v i )) e a i=1 P(b j,m) = α P(b)P(e)P(a b,e)p(j a)p(m a) e a = αp(b) e P(e) a P(a b,e)p(j a)p(m a) [draw tree] Wheeler Ruml (UNH) Lecture 27, CS 730 12 / 15
Variable Elimination Enumeration Var. Elim. 1 Var. Elim. 2 EOLQs P(B j,m) = αp(b) e P(e) a factors = tables = f varsused (dimensions). eg: f A (A,B,E), f M (A) multiplying factors: table with union of variables summing reduces table P(a B,e)P(j a)p(m a) Wheeler Ruml (UNH) Lecture 27, CS 730 13 / 15
Variable Elimination Enumeration Var. Elim. 1 Var. Elim. 2 EOLQs eliminating variables: eg P(J b) P(J b) = αp(b) P(e) P(a b,e)p(j a) P(m a) e a m all vars not ancestor of query or evidence are irrelevant! Wheeler Ruml (UNH) Lecture 27, CS 730 14 / 15
EOLQs Enumeration Var. Elim. 1 Var. Elim. 2 EOLQs What question didn t you get to ask today? What s still confusing? What would you like to hear more about? Please write down your most pressing question about AI and put it in the box on your way out. Thanks! Wheeler Ruml (UNH) Lecture 27, CS 730 15 / 15