Download Markov Decision Problems: Solving Complex Problems in Artificial Intelligence and more Study notes Computer Science in PDF only on Docsity!
example: a probabilistic blocksworld
start^
goal
actionmove paint
outcomesuccessfailuresuccess
probability0.10.9 1.
time (= cost)1 minute1minute3 minutes
C move C to D color E^
F move F to G start E
G D stop
how to determine the average plan-execution time of a given plant 1 t 2
t^3
t^4
t= average plan-execution time untili^ a goal state is reached if the agent startsin state i and follows the plant^1
= 1 + 0.1 t
+ 0.9 t 2
t= 3 + 1.0 t^2
t= 1 + 0.1 t^3
+ 0.9 t 2
t= 0^4 t= 13 (= average plan-execution time)^1 t= 3^2 t= 13^3 t= 0^4
Markov Decision Problems; page 5 of 30
A BD CE
move A to D^
move A to ground
color A^
color B^
...
A BD CE
...
BD ACE move A to D A BD ACE BD CE
... ...
BD ACE
A BD CE
A BD CE
...^
...^
...
move A to D BD ACE A BD CE
... ...
the decision tree is infinite!the values associated with thesechance nodes should be the samethe actions associated with thesechoice nodes should be the same
whenever the configuration of theblocks is the same, one wants toexecute the same action (= policy)
how to (almost) detemine a plan with minimal average plan-execution time
probabilistic planning and searchactions have probabilistic effects
a plan is a mapping from states to actions (= policy)
=Markov Decision Problems (MDPs)states are completely observableminimize expected total costoptimal plan can be cyclic
state and action uniquely determine prob distribution over successor states
Markov property
start
goal 1
0.^
start
goal actions are probabilisticthe robot can “drift”
deterministic planning and searcha plan is a sequence of actions (= path)
can be found using (forward or backward) search
Markov Decision Problems
a plan is a mapping from states to actions (= policy)
how to find it?
determine the expected goal distances of all states
greedily assign the action to each state
that decreases the expected goal distance the most
start
goal N N E E 1 2
A B C
A1A2A3A4B1B2B4C1C2C3C
E E - WNNNNNWN
s a A(s)succ(s,a)gd(s) Markov Decision Problems; page 10 of 30
= state= action= set of actions that can be executed in state s= the set of states that can result from the execution of action a in state s= expected goal distance of state s c(s,a)^
= the cost that results from the execution of action a in state s
Markov Decision Problems^ start
goal 1
0.^
= the probability that state s’ results from the execution of action a in state s p(s’|s,a)gd(s) = 0gd(s) = min
a^ ε^ A(s)^
(c(s,a)
succ(s,a)
p(s’|s,a) gd(s’))
if s is a goal state if s is not a goal state
a(s)^
= the optimal action to execute in state s a(s) = argmin
a^ ε^ A(s)^
(c(s,a)
succ(s,a)
p(s’|s,a) gd(s’))
Bellman equation if s is not a goal state
examples
start
goal 1
0.^
Markov Decision Problems
start
goal 1
deterministic planning and search given the expected goal distances, we can use the definition to check thembut calculating them is a chicken-and-egg problem
s a A(s)succ(s,a)gd(s) Markov Decision Problems; page 13 of 30
= state= action= set of actions that can be executed in state s= the set of states that can result from the execution of action a in state s= expected goal distance of state s c(s,a)^
= the cost that results from the execution of action a in state s
Markov Decision Problems^ start
goal 1
0.^
= the probability that state s’ results from the execution of action a in state s p(s’|s,a)gd^ (s)^ i^
= minimal expected cost until a goal is reached or i actions have been executed gd(s) = lim
i -> infinity
gd(s) (not necessarily after a finite amount of time) i^
gd^ (s) = 0i^ gd^ (s) = mini^
a^ ε^ A(s)
(c(s,a)
succ(s,a)
p(s’|s,a) gd
(s’))^ i-^
if s is a goal stateif s is not a goal state
gd^ (s) = 0^0
if execution starts in state s
Markov Decision Problems; page 14 of 30
Value Iteration
1. i := 02. Set (for all s
εS) gd
(s) = 0.i
gd^ (s) = 0i gd^ (s) = mini
a^ ε^ A(s)
(c(s,a)
succ(s,a)
p(s’|s,a) gd
(s’))^ i-
if s is a goal stateif s is not a goal state
4. Set (for all s
εS)
5. If (for some s
εS) |gd
(s) - gdi
(s)| > small constant, go to 3.i-
6. Set (for all s
εS that are not goal states)
a(s) = argmin
a^ ε^ A(s)^
(c(s,a)
succ(s,a)
p(s’|s,a) gd
(s’))i^
maintains approximations of the goal distances (= values)^ 3. i := i+
example of Value Iteration (2)
start
goal 1
0.^
0.^
state 1 a
a^
a 3
which action to execute in the start state?a1: 3 + 0 = 3a2: 1 + 0.5 3 + 0.5 2.5 = 3.75execute a1!
(no discounting)
Policy Iteration
a^ (s) = argmini^
a^ ε^ A(s)
(c(s,a)
succ(s,a)
p(s’|s,a) gd
(s’))i
1. i := 02. Set (for all s
εS that are not goal states) a
(s) to an arbitrary action in A(s).i
3. Set gd4. i := i+
(s) to the average plan-execution time until a goal state isi
reached if the agent starts in state s and follows policy a
i
5. Set (for all s
εS that are not goal states)
6. If (for some s
εS that is not a goal state) a
(s) does not equal ai
(s), go to 3i-
7. Set (for all s
εS that are not goal states) a(s) = a
(s).i
maintains a policy
Note: The initial policy ao
has to guarantee that the agent reaches a
goal state with probability one no matter which state it is started in.
extensions: no goal (1)what if there is no goal?“living in the world”
can no longer minimize expected cost until the goal is reached
- can minimize expected cost per action execution- can minimize expected total discounted cost
here:
extensions: no goal (2)
cannot minimize expected total cost
expected total cost = infiniteexpected total cost = infinite