Docsity

Solving MDPs, Lecture notes of Artificial Intelligence

Toggle sidebar
bg1
1
CSE 473: Introduction to Artificial Intelligence
Markov Decision Processes II
Steve Tanimoto
Based on slides by: Dan Klein and Pieter Abbeel --- University of California, Berkeley
[These slides were created by Dan Klein and Pieter Abbeel for CS188 Intro to AI at UC Berkeley. All CS188 materials are available at http://ai.berkeley.edu.]
Solving MDPs
Value Iteration
Policy Iteration
Reinforcement Learning
Policy Evaluation Fixed Policies
Expectimax trees max over all actions to compute the optimal values
If we fixed some policy π (s), then the tree would be simpler – only one action per state
… though the tree’s value would depend on which policy we fixed
a
s
s, a
s,a,s’
s’
π (s)
s
s, π(s)
s, π(s),s’
s’
Do the optimal action Do what π says to do
Utilities for a Fixed Policy
Another basic operation: compute the utility of a state s
under a fixed (generally non-optimal) policy
Define the utility of a state s, under a fixed policy π:
V
π
(s) = expected total discounted rewards starting in s and following π
Recursive relation (one-step look-ahead / Bellman equation):
π (s)
s
s, π(s)
s, π(s),s’
s’
Example: Policy Evaluation
Always Go Right Always Go Forward
pf3
pf4

Partial preview of the text

Download Solving MDPs and more Lecture notes Artificial Intelligence in PDF only on Docsity!

CSE 473: Introduction to Artificial Intelligence

Markov Decision Processes II

Steve Tanimoto

Based on slides by: Dan Klein and Pieter Abbeel --- University of California, Berkeley [These slides were created by Dan Klein and Pieter Abbeel for CS188 Intro to AI at UC Berkeley. All CS188 materials are available at http://ai.berkeley.edu.]

Solving MDPs

 Value Iteration  Policy Iteration  Reinforcement Learning

Policy Evaluation Fixed Policies

 Expectimax trees max over all actions to compute the optimal values  If we fixed some policy π (s), then the tree would be simpler – only one action per state  … though the tree’s value would depend on which policy we fixed a s s, a s,a,s’ s’ π (s) s s, π(s) s, π(s),s’ s’ Do the optimal action Do what π says to do

Utilities for a Fixed Policy

 Another basic operation: compute the utility of a state s under a fixed (generally non-optimal) policy  Define the utility of a state s, under a fixed policy π: Vπ^ (s) = expected total discounted rewards starting in s and following π  Recursive relation (one-step look-ahead / Bellman equation): π (s) s s, π(s) s, π(s),s’ s’

Example: Policy Evaluation

Always Go Right Always Go Forward

Example: Policy Evaluation

Always Go Right Always Go Forward

Policy Evaluation

 How do we calculate the V’s for a fixed policy π?  Idea 1: Turn recursive Bellman equations into updates (like value iteration)  Efficiency: O(S^2 ) per iteration  Idea 2: Without the maxes, the Bellman equations are just a linear system  Solve with Matlab (or your favorite linear system solver) π (s) s s, π(s) s, π(s),s’ s’

Policy Iteration

 Alternative approach for optimal values:

 Step 1: Policy evaluation: calculate utilities for some fixed policy (not optimal utilities!) until convergence  Step 2: Policy improvement: update policy using one-step look-ahead with resulting converged (but not optimal!) utilities as future values  Repeat steps until policy converges

 This is policy iteration

 It’s still optimal! Can converge (much) faster under some conditions

Comparison

 Both value iteration and policy iteration compute the same thing (all optimal values)  In value iteration:  Every iteration updates both the values and (implicitly) the policy  We don’t track the policy, but taking the max over actions implicitly recomputes it  In policy iteration:  We do several passes that update utilities with fixed policy (each pass is fast because we consider only one action, not all of them)  After the policy is evaluated, a new policy is chosen (slow like a value iteration pass)  The new policy will be better (or we’re done)  Both are dynamic programs for solving MDPs

Summary: MDP Algorithms

 So you want to….

 Compute optimal values: use value iteration or policy iteration  Compute values for a particular policy: use policy evaluation  Turn your values into a policy: use policy extraction (one-step lookahead)

 These all look the same!

 They basically are – they are all variations of Bellman updates  They all use one-step lookahead expectimax fragments  They differ only in whether we plug in a fixed policy or max over actions

Manipulator Control

Arm with two joints (workspace) Configuration space

Online Planning

 Rules changed! Red’s win chance is different.

W L

Let’s Play!

What Just Happened?

 That wasn’t planning, it was learning!

 Specifically, reinforcement learning  There was an MDP, but you couldn’t solve it with just computation  You needed to actually act to figure it out

 Important ideas in reinforcement learning that came up

 Exploration: you have to try unknown actions to get information  Exploitation: eventually, you have to use what you know  Regret: even if you learn intelligently, you make mistakes  Sampling: because of chance, you have to try things repeatedly  Difficulty: learning can be much harder than solving a known MDP

Next Time: Reinforcement Learning!