chapter 4 dynamic programming l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Chapter 4: Dynamic Programming PowerPoint Presentation
Download Presentation
Chapter 4: Dynamic Programming

Loading in 2 Seconds...

play fullscreen
1 / 30

Chapter 4: Dynamic Programming - PowerPoint PPT Presentation


  • 1629 Views
  • Uploaded on

Chapter 4: Dynamic Programming Overview of a collection of classical solution methods for MDPs known as dynamic programming (DP) Show how DP can be used to compute value functions, and hence, optimal policies Discuss efficiency and utility of DP Objectives of this chapter:

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Chapter 4: Dynamic Programming' - Ava


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
chapter 4 dynamic programming
Chapter 4: Dynamic Programming
  • Overview of a collection of classical solution methods for MDPs known as dynamic programming (DP)
  • Show how DP can be used to compute value functions, and hence, optimal policies
  • Discuss efficiency and utility of DP

Objectives of this chapter:

R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction

policy evaluation

Policy Evaluation: for a given policy p, compute the

state-value function

Policy Evaluation

Recall:

R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction

iterative methods
Iterative Methods

a “sweep”

A sweep consists of applying a backup operation to each state.

A full policy-evaluation backup:

R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction

iterative policy evaluation
Iterative Policy Evaluation

R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction

a small gridworld
A Small Gridworld
  • An undiscounted episodic task
  • Nonterminal states: 1, 2, . . ., 14;
  • One terminal state (shown twice as shaded squares)
  • Actions that would take agent off the grid leave state unchanged
  • Reward is –1 until the terminal state is reached

R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction

iterative policy eval for the small gridworld
Iterative Policy Evalfor the Small Gridworld

R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction

policy improvement

Suppose we have computed for a deterministic policy p.

For a given state s,

would it be better to do an action ?

Policy Improvement

R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction

policy improvement theorem

Then the policy must be as good as, or better than

Policy Improvement Theorem
  • Let and be any pair of deterministic policies such that

R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction

policy improvement cont
Policy Improvement Cont.

R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction

policy improvement cont10
Policy Improvement Cont.

R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction

policy iteration
Policy Iteration

policy evaluation

policy improvement

“greedification”

R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction

policy iteration12
Policy Iteration

R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction

jack s car rental
Jack’s Car Rental
  • $10 for each car rented (must be available when request rec’d)
  • Two locations, maximum of 20 cars at each
  • Cars returned and requested randomly
    • Poisson distribution, n returns/requests with prob
    • 1st location: average requests = 3, average returns = 3
    • 2nd location: average requests = 4, average returns = 2
  • Can move up to 5 cars between locations overnight
  • States, Actions, Rewards?
  • Transition probabilities?

R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction

jack s car rental14
Jack’s Car Rental

R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction

jack s cr exercise
Jack’s CR Exercise
  • Suppose the first car moved is free
    • From 1st to 2nd location
    • Because an employee travels that way anyway (by bus)
  • Suppose only 10 cars can be parked for free at each location
    • More than 10 cost $4 for using an extra parking lot
  • Such arbitrary nonlinearities are common in real problems

R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction

value iteration
Value Iteration

Recall the full policy-evaluation backup:

Here is the full value-iteration backup:

R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction

value iteration cont
Value Iteration Cont.

R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction

gambler s problem
Gambler’s Problem
  • Gambler can repeatedly bet $ on a coin flip
  • Heads he wins his stake, tails he loses it
  • Initial capital  {$1, $2, … $99}
  • Gambler wins if his capital becomes $100 loses if it becomes $0
  • Coin is unfair
    • Heads (gambler wins) with probability p = .4
  • States, Actions, Rewards?

R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction

gambler s problem solution
Gambler’s Problem Solution

R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction

herd management
Herd Management
  • You are a consultant to a farmer managing a herd of cows
  • Herd consists of 5 kinds of cows:
    • Young
    • Milking
    • Breeding
    • Old
    • Sick
  • Number of each kind is the State
  • Number sold of each kind is the Action
  • Cows transition from one kind to another
  • Young cows can be born

R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction

asynchronous dp
Asynchronous DP
  • All the DP methods described so far require exhaustive sweeps of the entire state set.
  • Asynchronous DP does not use sweeps. Instead it works like this:
    • Repeat until convergence criterion is met:
      • Pick a state at random and apply the appropriate backup
  • Still need lots of computation, but does not get locked into hopelessly long sweeps
  • Can you select states to backup intelligently? YES: an agent’s experience can act as a guide.

R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction

generalized policy iteration
Generalized Policy Iteration

Generalized Policy Iteration (GPI):

any interaction of policy evaluation and policy improvement,

independent of their granularity.

A geometric metaphor for

convergence of GPI:

R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction

bellman operators
Bellman Operators
  • Bellman operator for a fixed policy
  • Bellman optimality operator

R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction

bellman equations

( is the unique solution)

( is the unique solution)

Bellman Equations
  • Bellman equation
  • Bellman optimality equation

R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction

properties of bellman operators
Properties of Bellman Operators

Let and be two arbitrary functions on the state space

  • Max-Norm Contraction ( -contraction)
  • Monotonocity
  • Convergence (idea behind DP algorithms)

R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction

policy improvement26
Policy Improvement
  • Necessary and sufficient condition for optimality
  • Policy improvement step in policy iteration
  • Obtain a new policy satisfying
  • Stopping condition

R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction

linear programming
Linear Programming
  • Since for all , we have
  • Thus is the smallest that satisfies the constraint

R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction

efficiency of dp
Efficiency of DP
  • To find an optimal policy is polynomial in the number of states…
  • BUT, the number of states is often astronomical, e.g., often growing exponentially with the number of state variables (what Bellman called “the curse of dimensionality”).
  • In practice, classical DP can be applied to problems with a few millions of states.
  • Asynchronous DP can be applied to larger problems, and appropriate for parallel computation.
  • It is surprisingly easy to come up with MDPs for which DP methods are not practical.

R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction

efficiency of dp and lp
Efficiency of DP and LP
  • Total number of deterministic policies
  • DP methods are polynomial time algorithms
    • PI(each iteration)
    • VI(each iteration)
    • Each iteration of PI is computationally more expensive than each iteration of VI
    • PI typically require fewer iterations to converge than VI
    • Exponentially faster than any direct search in policy space
    • Number of states often grows exponentially with the number of state variables
  • LP methods
    • Their worst-case convergence guarantees are better than those of DP methods
    • Become impractical at a much smaller number of states than do DP methods

R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction

summary
Summary
  • Policy evaluation: backups without a max
  • Policy improvement: form a greedy policy, if only locally
  • Policy iteration: alternate the above two processes
  • Value iteration: backups with a max
  • Full backups (to be contrasted later with sample backups)
  • Generalized Policy Iteration (GPI)
  • Asynchronous DP: a way to avoid exhaustive sweeps
  • Bootstrapping: updating estimates based on other estimates

R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction