The Wumpus World!
description
Transcript of The Wumpus World!
![Page 1: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/1.jpg)
The Wumpus World!
2012级 ACM班金汶功
![Page 2: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/2.jpg)
Hunt the wumpus!
![Page 3: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/3.jpg)
Description
• Performance measure• Environment• Actuators• Sensors: Stench & Breeze & Glitter & Bump &
Scream
![Page 4: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/4.jpg)
An Example
![Page 5: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/5.jpg)
An Example
![Page 6: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/6.jpg)
Reasoning via logic
![Page 7: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/7.jpg)
Semantics
• Semantics: Relationship between logic and the real world
• Model: • Entailment:
![Page 8: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/8.jpg)
Models• KB: valid sentences• : “There is no pit in [1,2]”• : “There is no pit in [2,2]”
![Page 9: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/9.jpg)
Knowledge base
Axioms
Current States
Sensors
Actuators
Agent
Tell
Ask
TellModel
checking
Answer
![Page 10: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/10.jpg)
Efficient Model Checking
• DPLL• Early termination• Pure symbol heuristic• Unit clause heuristic• Component analysis• …
![Page 11: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/11.jpg)
Drawbacks
• Model checking is NP-complete
• Knowledge base may tell nothing.
![Page 12: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/12.jpg)
Probabilistic Reasoning
![Page 13: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/13.jpg)
Full joint probability distribution
• P(X, Y) = P(X|Y)P(Y)• X: {1,2,3,4} -> {0.1,0.2,0.3,0.4}• Y: {a,b} -> {0.4, 0.6}
• P(X = 2, Y = a) = P(X = 2|Y = a)P(Y = a)• The probability of all combination of values
![Page 14: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/14.jpg)
![Page 15: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/15.jpg)
Normalization
• is a constant•
![Page 16: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/16.jpg)
The Wumpus World• Aim: calculate the probability that each of the
three squares contains a pit.
![Page 17: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/17.jpg)
Full joint distribution
• P(, , , ) P(, , |) P(• P(
• Every room contains a pit of probability 0.2
![Page 18: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/18.jpg)
How likely is it that [1,3] has a pit?• Given observation:
• terms
![Page 19: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/19.jpg)
Using independence
![Page 20: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/20.jpg)
Simplification
• Now there are only 4 terms, cheers!
![Page 21: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/21.jpg)
![Page 22: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/22.jpg)
Finally
• [2,2] contains a pit with 86% probability!
• Data structures---independence
![Page 23: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/23.jpg)
Bayesian Network
![Page 24: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/24.jpg)
Simple Example
Burglary Earthquake
Alarm(Bark)
John Calls Mary Calls
P(B)
.001
P(E)
.002
B E P(A)
True true .95
true false .94
false true .29
false false .001
Bark P(J)
true .90
false .05
Bark P(M)
true .70
false .01
![Page 25: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/25.jpg)
Specification
• Each node corresponds to a random variable
• Acyclic – DAG
• Each node has a conditional probability distribution
![Page 26: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/26.jpg)
Conditional Independence
![Page 27: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/27.jpg)
Exact Inference
![Page 28: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/28.jpg)
![Page 29: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/29.jpg)
P1,3 known
b
P3,1P2,2
P1,3 P2,2 P3,1 b
True True True 1
True True False 1
True False True 1
True False False 0
False True True 1
False True False 1
False False True 0
False False False 0
P(1,3)
0.2
P(known)
P(P3,1)
0.2P(P2,2)
0.2
![Page 30: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/30.jpg)
Approximate Inference
• Markov Chain Monte Carlo• Gibbs Sampling• Idea: The long-run fraction of time spent in
each state is exactly proportional to its posterior probability.
![Page 31: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/31.jpg)
𝑃 (𝑥 𝑖′∨𝑀𝑎𝑟𝑘𝑜𝑣𝐵𝑙𝑎𝑛𝑘𝑒𝑡 (𝑋 𝑖 ))=α P (𝑥𝑖′∨𝑃𝑎𝑟𝑒𝑛𝑡𝑠 (𝑋 𝑖 ))× ∏
𝑌 𝑗∈ h𝐶 𝑖𝑙𝑑𝑟𝑒𝑛 ( 𝑋 𝑖)𝑃(𝑦 𝑗∨𝑝𝑎𝑟𝑒𝑛𝑡𝑠 (𝑌 𝑗))
![Page 32: The Wumpus World!](https://reader033.fdocuments.net/reader033/viewer/2022061615/5681625d550346895dd2b580/html5/thumbnails/32.jpg)
Reference• http://zh.wikipedia.org/wiki/Hunt_the_Wumpus• http://zh.wikipedia.org/wiki/%
E8%B4%9D%E5%8F%B6%E6%96%AF%E7%BD%91%E7%BB%9C
• Stuart Russell, Peter Norvig Artificial Intelligence—A Modern Approach 3rd edition, 2010