For Friday Read Chapter 11, section 3

Slides:



Advertisements
Similar presentations
CS188: Computational Models of Human Behavior
Advertisements

Bayesian networks Chapter 14 Section 1 – 2. Outline Syntax Semantics Exact computation.
BAYESIAN NETWORKS Ivan Bratko Faculty of Computer and Information Sc. University of Ljubljana.
Planning II: Partial Order Planning
Plan Generation & Causal-Link Planning 1 José Luis Ambite.
Artificial Intelligence Universitatea Politehnica Bucuresti Adina Magda Florea
1 Bayes nets Computing conditional probability Polytrees Probability Inferences Bayes nets Computing conditional probability Polytrees Probability Inferences.
Exact Inference in Bayes Nets
Junction Trees And Belief Propagation. Junction Trees: Motivation What if we want to compute all marginals, not just one? Doing variable elimination for.
Dynamic Bayesian Networks (DBNs)
Reasoning under Uncertainty Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
Identifying Conditional Independencies in Bayes Nets Lecture 4.
For Monday Read chapter 18, sections 1-2 Homework: –Chapter 14, exercise 8 a-d.
For Monday Finish chapter 14 Homework: –Chapter 13, exercises 8, 15.
Artificial Intelligence Chapter 19 Reasoning with Uncertain Information Biointelligence Lab School of Computer Sci. & Eng. Seoul National University.
CPSC 322, Lecture 26Slide 1 Reasoning Under Uncertainty: Belief Networks Computer Science cpsc322, Lecture 27 (Textbook Chpt 6.3) March, 16, 2009.
Computability and Complexity 20-1 Computability and Complexity Andrei Bulatov Random Sources.
Artificial Intelligence Chapter 11: Planning
Bayesian Networks. Motivation The conditional independence assumption made by naïve Bayes classifiers may seem to rigid, especially for classification.
Probabilistic Reasoning Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 14 (14.1, 14.2, 14.3, 14.4) Capturing uncertain knowledge Probabilistic.
Bayesian Belief Networks
Constraint Satisfaction Problems
Bayesian Networks What is the likelihood of X given evidence E? i.e. P(X|E) = ?
Quiz 4: Mean: 7.0/8.0 (= 88%) Median: 7.5/8.0 (= 94%)
PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2.
Bayesian networks Chapter 14. Outline Syntax Semantics.
1 CS 343: Artificial Intelligence Bayesian Networks Raymond J. Mooney University of Texas at Austin.
Bayesian networks Chapter 14 Section 1 – 2. Bayesian networks A simple, graphical notation for conditional independence assertions and hence for compact.
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.
For Wednesday Read Chapter 11, sections 1-2 Program 2 due.
Bayesian Statistics and Belief Networks. Overview Book: Ch 13,14 Refresher on Probability Bayesian classifiers Belief Networks / Bayesian Networks.
Introduction to Bayesian Networks
For Monday Read chapter 12, sections 1-2 Homework: –Chapter 10, exercise 3.
For Friday No new reading Logic and Resolution Homework.
For Friday Finish chapter 10 No homework. Program 2 Any questions?
For Friday No reading Homework: –Chapter 11, exercise 4.
1 CMSC 671 Fall 2001 Class #21 – Tuesday, November 13.
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
Marginalization & Conditioning Marginalization (summing out): for any sets of variables Y and Z: Conditioning(variant of marginalization):
Introduction to Planning Dr. Shazzad Hosain Department of EECS North South Universtiy
AI Lecture 17 Planning Noémie Elhadad (substituting for Prof. McKeown)
For Friday Read Chapter 11, sections 1 and 2 Homework: –Chapter 10, exercises 1 and 5.
Exact Inference in Bayes Nets. Notation U: set of nodes in a graph X i : random variable associated with node i π i : parents of node i Joint probability:
For Monday Make sure you have read chapter 11 through section 3. No homework.
Planning I: Total Order Planners Sections
Today Graphical Models Representing conditional dependence graphically
Conditional Independence As with absolute independence, the equivalent forms of X and Y being conditionally independent given Z can also be used: P(X|Y,
Heuristic Search Planners. 2 USC INFORMATION SCIENCES INSTITUTE Planning as heuristic search Use standard search techniques, e.g. A*, best-first, hill-climbing.
Artificial Intelligence Chapter 19 Reasoning with Uncertain Information Biointelligence Lab School of Computer Sci. & Eng. Seoul National University.
CS 2750: Machine Learning Bayesian Networks Prof. Adriana Kovashka University of Pittsburgh March 14, 2016.
Web-Mining Agents Data Mining Prof. Dr. Ralf Möller Universität zu Lübeck Institut für Informationssysteme Karsten Martiny (Übungen)
1 Chapter 6 Bayesian Learning lecture slides of Raymond J. Mooney, University of Texas at Austin.
Reasoning Under Uncertainty: Belief Networks
CS 2750: Machine Learning Directed Graphical Models
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Qian Liu CSE spring University of Pennsylvania
L9. Planning Agents L7_exAnswer and explanation Review
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
For Wednesday Read Chapter 18, sections 1-3 Homework:
Planning (Chapter 10)
Artificial Intelligence Chapter 19
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
L11. Planning Agents and STRIPS
CAP 5636 – Advanced Artificial Intelligence
Bayesian Statistics and Belief Networks
CS 188: Artificial Intelligence
Biointelligence Lab School of Computer Sci. & Eng.
Hankz Hankui Zhuo Bayesian Networks Hankz Hankui Zhuo
Belief Networks CS121 – Winter 2003 Belief Networks.
CS 188: Artificial Intelligence Spring 2006
Presentation transcript:

For Friday Read Chapter 11, section 3 Chapter 14, exercises 1(a-d) and 3 (a-b)

Program 3

Types of Connections Given a triplet of variables x, y, z where x is connected to z via y, there are 3 possible connection types: tail­to­tail: x ¬ y ® z head­to­tail: x ¬ y ¬ z, or x ® y ® z head­to­head: x ® y ¬ z For tail­to­tail and head­to­tail connections, x and z are independent given y. For head­to­head connections, x and z are “marginally independent” but may become dependent given the value of y or one of its descendents (through “explaining away”).

Separation A subset of variables S is said to separate X from Y if all (undirected) paths between X and Y are separated by S. A path P is separated by a subset of variables S if at least one pair of successive links along P is blocked by S. Two links meeting head­to­tail or tail­to­tail at a node Z are blocked by S if Z is in S. Two links meeting head­to­head at a node Z are blocked by S if neither Z nor any of its descendants are in S.

Probabilistic Inference Given known values for some evidence variables, we want to determine the posterior probability of of some query variables. Example: Given that John calls, what is the probability that there is a Burglary? John calls 90% of the time there is a burglary and the alarm detects 94% of burglaries, so people generally think it should be fairly high (80­90%). But this ignores the prior probability of John calling. John also calls 5% of the time when there is no alarm. So over the course of 1,000 days we expect one burglary and John will probably call. But John will also call with a false report 50 times during 1,000 days on average. So the call is about 50 times more likely to be a false report P(Burglary | JohnCalls) ~ 0.02. Actual probability is 0.016 since the alarm is not perfect (an earthquake could have set it off or it could have just went off on its own). Of course even if there was no alarm and John called incorrectly, there could have been an undetected burglary anyway, but this is very unlikely.

Types of Inference Diagnostic (evidential, abductive): From effect to cause. P(Burglary | JohnCalls) = 0.016 P(Burglary | JohnCalls Ù MaryCalls) = 0.29 P(Alarm | JohnCalls Ù MaryCalls) = 0.76 P(Earthquake | JohnCalls Ù MaryCalls) = 0.18 Causal (predictive): From cause to effect P(JohnCalls | Burglary) = 0.86 P(MaryCalls | Burglary) = 0.67

More Types of Inference Intercausal (explaining away): Between causes of a common effect. P(Burglary | Alarm) = 0.376 P(Burglary | Alarm Ù Earthquake) = 0.003 Mixed: Two or more of the above combined (diagnostic and causal) P(Alarm | JohnCalls Ù ¬Earthquake) = 0.03 (diagnostic and intercausal) P(Burglary | JohnCalls Ù ¬Earthquake) = 0.017

Inference Algorithms Most inference algorithms for Bayes nets are not goal­directed and calculate posterior probabilities for all other variables. In general, the problem of Bayes net inference is NP­hard (exponential in the size of the graph).

Polytree Inference For singly­connected networks or polytrees, in which there are no undirected loops (there is at most one undirected path between any two nodes), polynomial (linear) time algorithms are known. Details of inference algorithms are somewhat mathematically complex, but algorithms for polytrees are structurally quite simple and employ simple propagation of values through the graph.

Belief Propagation Belief propogation and updating involves transmitting two types of messages between neighboring nodes: l messages are sent from children to parents and involve the strength of evidential support for a node. p messages are sent from parents to children and involve the strength of causal support.

Propagation Details Each node B acts as a simple processor which maintains a vector l(B) for the total evidential support for each value of the corresponding variable and an analagous vector p(B) for the total causal support. The belief vector BEL(B) for a node, which maintains the probability for each value, is calculated as the normalized product: BEL(B) = al(B)p(B)

Propogation Details (cont.) Computation at each node involve l and p message vectors sent between nodes and consists of simple matrix calculations using the CPT to update belief (the l and p node vectors) for each node based on new evidence. Assumes CPT for each node is a matrix (M) with a column for each value of the variable and a row for each conditioning case (all rows must sum to 1).

Basic Solution Approaches Clustering: Merge nodes to eliminate loops. Cutset Conditioning: Create several trees for each possible condition of a set of nodes that break all loops. Stochastic simulation: Approximate posterior proabilities by running repeated random trials testing various conditions.

Applications of Bayes Nets Medical diagnosis (Pathfinder, outperforms leading experts in diagnosis of lymph­node diseases) Device diagnosis (Diagnosis of printer problems in Microsoft Windows) Information retrieval (Prediction of relevant documents) Computer vision (Object recognition)

Planning

Search What are characteristics of good problems for search? What does the search know about the goal state? Consider the package problem on the exam: How well would search REALLY work on that problem?

Search vs. Planning Planning systems: Open up action and goal representation to allow selection Divide and conquer by subgoaling Relax the requirement for sequential construction of solutions

Planning in Situation Calculus PlanResult(p,s) is the situation resulting from executing p in s PlanResult([],s) = s PlanResult([a|p],s) = PlanResult(p,Result(a,s)) Initial state At(Home,S_0)  Have(Milk,S_0)  … Actions as Successor State axioms Have(Milk,Result(a,s))  [(a=Buy(Milk)  At(Supermarket,s))  Have(Milk,s)  a  ...)] Query s=PlanResult(p,S_0)  At(Home,s)  Have(Milk,s)  … Solution p = Go(Supermarket),Buy(Milk),Buy(Bananas),Go(HWS),…] Principal difficulty: unconstrained branching, hard to apply heuristics

The Blocks World We have three blocks A, B, and C We can know things like whether a block is clear (nothing on top of it) and whether one block is on another (or on the table) Initial State: Goal State: A B C A B C

Situation Calculus in Prolog holds(on(A,B),result(puton(A,B),S)) :­ holds(clear(A),S), holds(clear(B),S), neq(A,B). holds(clear(C),result(puton(A,B),S)) :­ holds(on(A,C),S), holds(on(X,Y),result(puton(A,B),S)) :­ holds(on(X,Y),S), neq(X,A), neq(Y,A), neq(A,B). holds(clear(X),result(puton(A,B),S)) :­ holds(clear(X),S), neq(X,B). holds(clear(table),S).

neq(a,table). neq(table,a). neq(b,table). neq(table,b). neq(c,table). neq(table,c). neq(a,b). neq(b,a). neq(a,c). neq(c,a). neq(b,c). neq(c,b).

Situation Calculus Planner plan([G1|Gs], S0, S) :­ holds(G1,S), plan(Gs, S0, S), reachable(S,S0). reachable(S,S). reachable(result(_,S1),S) :­ reachable(S1,S). However, what will happen if we try to make plans using normal Prolog depth­first search?

Stack of 3 Blocks holds(on(a,b), s0). holds(on(b,table), s0). holds(on(c,table),s0). holds(clear(a), s0). holds(clear(c), s0). | ?­ cpu_time(db_prove(6,plan([on(a,b),on(b,c)],s0,S)), T). S = result(puton(a,b),result(puton(b,c),result(puton(a,table),s0))) T = 1.3433E+01

Invert stack holds(on(a,table), s0). holds(on(b,a), s0). holds(on(c,b),s0). holds(clear(c), s0). ?­ cpu_time(db_prove(6,plan([on(b,c),on(a,b)],s0,S)),T). S = result(puton(a,b),result(puton(b,c),result(puton(c,table),s0))), T = 7.034E+00

Simple Four Block Stack holds(on(a,table), s0). holds(on(b,table), s0). holds(on(c,table),s0). holds(on(d,table),s0). holds(clear(c), s0). holds(clear(b), s0). holds(clear(a), s0). holds(clear(d), s0). | ?­ cpu_time(db_prove(7,plan([on(b,c),on(a,b),on(c,d)],s0,S)),T). S = result(puton(a,b),result(puton(b,c),result(puton(c,d),s0))), T = 2.765935E+04 7.5 hours!

STRIPS Developed at SRI (formerly Stanford Research Institute) in early 1970's. Just using theorem proving with situation calculus was found to be too inefficient. Introduced STRIPS action representation. Combines ideas from problem solving and theorem proving. Basic backward chaining in state space but solves subgoals independently and then tries to reachieve any clobbered subgoals at the end.

STRIPS Representation Attempt to address the frame problem by defining actions by a precondition, and add list, and a delete list. (Fikes & Nilsson, 1971). Precondition: logical formula that must be true in order to execute the action. Add list: List of formulae that become true as a result of the action. Delete list: List of formulae that become false as result of the action.

Sample Action Puton(x,y) Precondition: Clear(x) Ù Clear(y) Ù On(x,z) Add List: {On(x,y), Clear(z)} Delete List: {Clear(y), On(x,z)}

STRIPS Assumption Every formula that is satisfied before an action is performed and does not belong to the delete list is satisfied in the resulting state. Although Clear(z) implies that On(x,z) must be false, it must still be listed in the delete list explicitly. For action Kill(x,y) must put Alive(y), Breathing(y), Heart­Beating(y), etc. must all be included in the delete list although these deletions are implied by the fact of adding Dead(y)

Subgoal Independence If the goal state is a conjunction of subgoals, search is simplified if goals are assumed independent and solved separately (divide and conquer) Consider a goal of A on B and C on D from 4 blocks all on the table

Subgoal Interaction Achieving different subgoals may interact, the order in which subgoals are solved in this case is important. Consider 3 blocks on the table, goal of A on B and B on C If do puton(A,B) first, cannot do puton(B,C) without undoing (clobbering) subgoal: on(A,B)

Sussman Anomaly Goal of A on B and B on C Starting state of C on A and B on table Either way of ordering subgoals causes clobbering

STRIPS Approach Use resolution theorem prover to try and prove that goal or subgoal is satisfied in the current state. If it is not, use the incomplete proof to find a set of differences between the current and goal state (a set of subgoals). Pick a subgoal to solve and an operator that will achieve that subgoal. Add the precondition of this operator as a new goal and recursively solve it.

STRIPS Algorithm STRIPS(init­state, goals, ops) Let current­state be init­state; For each goal in goals do If goal cannot be proven in current state Pick an operator instance, op, s.t. goal Î adds(op); /* Solve preconditions */ STRIPS(current­state, preconds(op), ops); /* Apply operator */ current­state := current­state + adds(op) ­ dels(ops); /* Patch any clobbered goals */ Let rgoals be any goals which are not provable in current­state; STRIPS(current­state, rgoals, ops).

Algorithm Notes The “pick operator instance” step involves a nondeterministic choice that is backtracked to if a dead­end is ever encountered. Employs chronological backtracking (depth­first search), when it reaches a dead­end, backtrack to last decision point and pursue the next option.

Norvig’s Implementation Simple propositional (no variables) Lisp implementation of STRIPS. #S(OP ACTION (MOVE C FROM TABLE TO B) PRECONDS ((SPACE ON C) (SPACE ON B) (C ON TABLE)) ADD­LIST ((EXECUTING (MOVE C FROM TABLE TO B)) (C ON B)) DEL­LIST ((C ON TABLE) (SPACE ON B))) Commits to first sequence of actions that achieves a subgoal (incomplete search). Prefers actions with the most preconditions satisfied in the current state. Modified to to try and re-achieve any clobbered subgoals (only once).

STRIPS Results ; Invert stack (good goal ordering) > (gps '((a on b)(b on c) (c on table) (space on a) (space on table)) '((b on a) (c on b))) Goal: (B ON A) Consider: (MOVE B FROM C TO A) Goal: (SPACE ON B) Consider: (MOVE A FROM B TO TABLE) Goal: (SPACE ON A) Goal: (SPACE ON TABLE) Goal: (A ON B) Action: (MOVE A FROM B TO TABLE)

Goal: (SPACE ON A) Goal: (B ON C) Action: (MOVE B FROM C TO A) Goal: (C ON B) Consider: (MOVE C FROM TABLE TO B) Goal: (SPACE ON C) Goal: (SPACE ON B) Goal: (C ON TABLE) Action: (MOVE C FROM TABLE TO B) ((START) (EXECUTING (MOVE A FROM B TO TABLE)) (EXECUTING (MOVE B FROM C TO A)) (EXECUTING (MOVE C FROM TABLE TO B)))

; Invert stack (bad goal ordering) > (gps '((a on b)(b on c) (c on table) (space on a) (space on table)) '((c on b)(b on a))) Goal: (C ON B) Consider: (MOVE C FROM TABLE TO B) Goal: (SPACE ON C) Consider: (MOVE B FROM C TO TABLE) Goal: (SPACE ON B) Consider: (MOVE A FROM B TO TABLE) Goal: (SPACE ON A) Goal: (SPACE ON TABLE) Goal: (A ON B) Action: (MOVE A FROM B TO TABLE) Goal: (B ON C) Action: (MOVE B FROM C TO TABLE)

Goal: (SPACE ON B) Goal: (C ON TABLE) Action: (MOVE C FROM TABLE TO B) Goal: (B ON A) Consider: (MOVE B FROM TABLE TO A) Consider: (MOVE C FROM B TO TABLE) Goal: (SPACE ON C) Goal: (SPACE ON TABLE) Goal: (C ON B) Action: (MOVE C FROM B TO TABLE) Goal: (SPACE ON A) Goal: (B ON TABLE) Action: (MOVE B FROM TABLE TO A)

Must reachieve clobbered goals: ((C ON B)) Goal: (C ON B) Consider: (MOVE C FROM TABLE TO B) Goal: (SPACE ON C) Goal: (SPACE ON B) Goal: (C ON TABLE) Action: (MOVE C FROM TABLE TO B) ((START) (EXECUTING (MOVE A FROM B TO TABLE)) (EXECUTING (MOVE B FROM C TO TABLE)) (EXECUTING (MOVE C FROM TABLE TO B)) (EXECUTING (MOVE C FROM B TO TABLE)) (EXECUTING (MOVE B FROM TABLE TO A)) (EXECUTING (MOVE C FROM TABLE TO B)))

STRIPS on Sussman Anomaly > (gps '((c on a)(a on table)( b on table) (space on c) (space on b) (space on table)) '((a on b)(b on c))) Goal: (A ON B) Consider: (MOVE A FROM TABLE TO B) Goal: (SPACE ON A) Consider: (MOVE C FROM A TO TABLE) Goal: (SPACE ON C) Goal: (SPACE ON TABLE) Goal: (C ON A) Action: (MOVE C FROM A TO TABLE) Goal: (SPACE ON B) Goal: (A ON TABLE) Action: (MOVE A FROM TABLE TO B) Goal: (B ON C)

Consider: (MOVE B FROM TABLE TO C) Goal: (SPACE ON B) Consider: (MOVE A FROM B TO TABLE) Goal: (SPACE ON A) Goal: (SPACE ON TABLE) Goal: (A ON B) Action: (MOVE A FROM B TO TABLE) Goal: (SPACE ON C) Goal: (B ON TABLE) Action: (MOVE B FROM TABLE TO C) Must reachieve clobbered goals: ((A ON B)) Consider: (MOVE A FROM TABLE TO B)

Goal: (SPACE ON A) Goal: (SPACE ON B) Goal: (A ON TABLE) Action: (MOVE A FROM TABLE TO B) ((START) (EXECUTING (MOVE C FROM A TO TABLE)) (EXECUTING (MOVE A FROM TABLE TO B)) (EXECUTING (MOVE A FROM B TO TABLE)) (EXECUTING (MOVE B FROM TABLE TO C)) (EXECUTING (MOVE A FROM TABLE TO B)))

How Long Do 4 Blocks Take? ;; Stack four clear blocks (good goal ordering) > (time (gps '((a on table)(b on table) (c on table) (d on table)(space on a) (space on b) (space on c) (space on d)(space on table)) '((c on d)(b on c)(a on b)))) User Run Time = 0.00 seconds ((START) (EXECUTING (MOVE C FROM TABLE TO D)) (EXECUTING (MOVE B FROM TABLE TO C)) (EXECUTING (MOVE A FROM TABLE TO B)))

;; Stack four clear blocks (bad goal ordering) > (time (gps '((a on table)(b on table) (c on table) (d on table)(space on a) (space on b) (space on c) (space on d)(space on table)) '((a on b)(b on c) (c on d)))) User Run Time = 0.06 seconds ((START) (EXECUTING (MOVE A FROM TABLE TO B)) (EXECUTING (MOVE A FROM B TO TABLE)) (EXECUTING (MOVE B FROM TABLE TO C)) (EXECUTING (MOVE B FROM C TO TABLE)) (EXECUTING (MOVE C FROM TABLE TO D)) (EXECUTING (MOVE A FROM TABLE TO B)))