cs 4100 artificial intelligence prof. c. hafner class notes march 20, 2012
TRANSCRIPT
![Page 1: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/1.jpg)
CS 4100 Artificial Intelligence
Prof. C. HafnerClass Notes March 20, 2012
![Page 2: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/2.jpg)
Outline• Midterm planning problem: solution
http://www.ccs.neu.edu/course/cs4100sp12/classnotes/midterm-planning.doc
• Discuss term projects• Continue uncertain reasoning in AI
– Probability distribution (review)– Conditional Probability and the Chain Rule (cont.)– Bayes’ Rule– Independence, “Expert” systems and the combinatorics of
joint probabilities– Bayes networks– Assignment 6
![Page 3: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/3.jpg)
Term Projects – The Process
1. Form teams of 3 or 4 people – 10-12 teams2. Before next class (Mar 20) each team send an email
a. Name and a main contact person (email)b. All team members’ names and email addressesc. You can reserve a topic asap (first request)
3. Brief written project proposal due Fri March 23 10pm (email)4. Each team will
a. submit a written project report (due April 17, last day of class)b. a running computer application (due April 17, last day of class)c. make a presentation of 15 minutes on their project (April 12 & 17)
5. Attendance is required and will be taken on April 12 & 17
![Page 4: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/4.jpg)
Term Projects – The Content
1. Select a domain2. Model the domain
a. “Logical/state model” : define an ontology w/ example world stateb. Implementation in Protégé – demo with some queriesc. “Dynamics model” (of how the world changes)
Using Situation Calculus formalism or STRIPS-type operators
3. Define and solve example planning problems: initial state goal state
a. Specify planning axioms or STRIPS-type operatorsb. Show (on paper) a proof or derivation of a trivial plan and then a
more challenging one using resolution or the POP algorithm
![Page 5: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/5.jpg)
Ontology Design Example: Protege
• Simplest example: Dog project• Cooking ontology
– Overall Design– Implement class taxonomy– Slots representing data types– Slots containing relationships
![Page 6: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/6.jpg)
Cooking ontology (for meal or party planning)• FoodItem – taxonomy can include Dairy, Meat, Starch, Veg, Fruit,
Sweets. A higher level can be Protein, Carbs. Should include nuts due to possible allergies
• A Dish – taxonomy can be Appetizer, Main Course, Salad, Dessert. A Dish has Ingredients which are instances of FoodItem
• A Recipe– Has Servings (a number)– Has steps
• Each step includes a FoodItem, Amount, and Prep• An Amount is a number and units• Prep is a string
• Relationships
![Page 7: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/7.jpg)
![Page 8: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/8.jpg)
Bayes' Rule• Product rule P(ab) = P(a | b) P(b) = P(b | a) P(a)
Bayes' rule: P(a | b) = P(b | a) P(a) / P(b)• or in distribution form
P(Y|X) = P(X|Y) P(Y) / P(X) = αP(X|Y) P(Y)
• Useful for assessing diagnostic probability from causal probability:
P(Cause|Effect) = P(Effect|Cause) P(Cause) / P(Effect) P(Disease|Symptom) = P(Symptom|Diease) P(Symptom) / (Disease)
– E.g., let M be meningitis, S be stiff neck:P(m|s) = P(s|m) P(m) / P(s) = 0.8 × 0.0001 / 0.1 = 0.0008
– Note: posterior probability of meningitis still very small!•
•
![Page 9: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/9.jpg)
![Page 10: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/10.jpg)
![Page 11: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/11.jpg)
![Page 12: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/12.jpg)
![Page 13: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/13.jpg)
![Page 14: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/14.jpg)
Bayes' Rule and conditional independenceP(Cavity | toothache catch)
= αP(toothache catch | Cavity) P(Cavity) = αP(toothache | Cavity) P(catch | Cavity) P(Cavity)
• We say: “toothache and catch are independent, given cavity”. This is an example of a naïve Bayes model. We will study this later as our simplest machine learning application
P(Cause,Effect1, … ,Effectn) = P(Cause) πiP(Effecti|Cause)
• Total number of parameters is linear in n (number of symptoms). This is our first Bayesian inference net.
––
![Page 15: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/15.jpg)
Conditional independence• P(Toothache, Cavity, Catch) has 23 – 1 = 7 independent entries
• If I have a cavity, the probability that the probe catches in it doesn't depend on whether I have a toothache:(1) P(catch | toothache, cavity) = P(catch | cavity)
• The same independence holds if I haven't got a cavity:(2) P(catch | toothache,cavity) = P(catch | cavity)
• Catch is conditionally independent of Toothache given Cavity:P(Catch | Toothache,Cavity) = P(Catch | Cavity)
• Equivalent statements (from original definitions of independence):P(Toothache | Catch, Cavity) = P(Toothache | Cavity)P(Toothache, Catch | Cavity) = P(Toothache | Cavity) P(Catch | Cavity)
––
»
![Page 16: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/16.jpg)
Conditional independence contd.• Write out full joint distribution using chain rule:
P(Toothache, Catch, Cavity)= P(Toothache | Catch, Cavity) P(Catch, Cavity)= P(Toothache | Catch, Cavity) P(Catch | Cavity) P(Cavity)= P(Toothache | Cavity) P(Catch | Cavity) P(Cavity)
I.e., 2 + 2 + 1 = 5 independent numbers
• In most cases, the use of conditional independence reduces the size of the representation of the joint distribution from exponential in n to linear in n.
• Conditional independence is our most basic and robust form of knowledge about uncertain environments.
–
![Page 17: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/17.jpg)
Remember this examples
![Page 18: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/18.jpg)
Example of conditional independence
![Page 19: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/19.jpg)
![Page 20: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/20.jpg)
![Page 21: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/21.jpg)
Test your understanding of the Chain Rule
![Page 22: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/22.jpg)
This is our second Bayesian inference net
![Page 23: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/23.jpg)
![Page 24: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/24.jpg)
![Page 25: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/25.jpg)
![Page 26: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/26.jpg)
![Page 27: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/27.jpg)
![Page 28: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/28.jpg)
![Page 29: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/29.jpg)
![Page 30: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/30.jpg)
![Page 31: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/31.jpg)
How to construct a Bayes Net
![Page 32: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/32.jpg)
![Page 33: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/33.jpg)
![Page 34: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/34.jpg)
![Page 35: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/35.jpg)
![Page 36: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/36.jpg)
![Page 37: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/37.jpg)
![Page 38: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/38.jpg)
Test your understanding: design a Bayes net with plausible numbers
![Page 39: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/39.jpg)
Calculating using Bayes’ Nets
![Page 40: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/40.jpg)
![Page 41: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/41.jpg)
![Page 42: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/42.jpg)
![Page 43: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/43.jpg)
![Page 44: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/44.jpg)
![Page 45: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/45.jpg)
![Page 46: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/46.jpg)
![Page 47: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/47.jpg)
![Page 48: CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 20, 2012](https://reader035.vdocuments.mx/reader035/viewer/2022081418/56649eab5503460f94bb0e2b/html5/thumbnails/48.jpg)