Markov Decision Processes [RN2] Sec 17.1, 17.2, 17.4, 17.5 [RN3] - - PDF document

markov decision processes rn2 sec 17 1 17 2 17 4 17 5 rn3
SMART_READER_LITE
LIVE PREVIEW

Markov Decision Processes [RN2] Sec 17.1, 17.2, 17.4, 17.5 [RN3] - - PDF document

Markov Decision Processes [RN2] Sec 17.1, 17.2, 17.4, 17.5 [RN3] Sec 17.1, 17.2, 17.4 CS 486/686 University of Waterloo Lecture 13: February 14, 2012 Outline Markov Decision Processes Dynamic Decision Networks 2 CS486/686 Lecture


slide-1
SLIDE 1

1

Markov Decision Processes [RN2] Sec 17.1, 17.2, 17.4, 17.5 [RN3] Sec 17.1, 17.2, 17.4

CS 486/686 University of Waterloo Lecture 13: February 14, 2012

CS486/686 Lecture Slides (c) 2012 P. Poupart

2

Outline

  • Markov Decision Processes
  • Dynamic Decision Networks
slide-2
SLIDE 2

2

CS486/686 Lecture Slides (c) 2012 P. Poupart

3

Sequential Decision Making

Static Inference

Bayesian Networks

Sequential Inference

Hidden Markov Models Dynamic Bayesian Networks

Static Decision Making

Decision Networks

Sequential Decision Making

Markov Decision Processes Dynamic Decision Networks

CS486/686 Lecture Slides (c) 2012 P. Poupart

4

Sequential Decision Making

  • Wide range of applications

– Robotics (e.g., control) – Investments (e.g., portfolio management) – Computational linguistics (e.g., dialogue management) – Operations research (e.g., inventory management, resource allocation, call admission control) – Assistive technologies (e.g., patient monitoring and support)

slide-3
SLIDE 3

3

CS486/686 Lecture Slides (c) 2012 P. Poupart

5

  • Intuition: Markov Process with…

– Decision nodes – Utility nodes

Markov Decision Process

s0 s1 s2 s3 s4 a0 a1 a2 a3 r1 r2 r3 r4

CS486/686 Lecture Slides (c) 2012 P. Poupart

6

Stationary Preferences

  • Hum… but why many utility nodes?
  • U(s0,s1,s2,…)

– Infinite process  infinite utility function

  • Solution:

– Assume stationary and additive preferences – U(s0,s1,s2,…) = Σt R(st)

slide-4
SLIDE 4

4

CS486/686 Lecture Slides (c) 2012 P. Poupart

7

Discounted/Average Rewards

  • If process infinite, isn’t Σt R(st) infinite?
  • Solution 1: discounted rewards

– Discount factor: 0 ≤  ≤ 1 – Finite utility: Σt tR(st) is a geometric sum –  is like an inflation rate of 1/- 1 – Intuition: prefer utility sooner than later

  • Solution 2: average rewards

– More complicated computationally – Beyond the scope of this course

CS486/686 Lecture Slides (c) 2012 P. Poupart

8

Markov Decision Process

  • Definition

– Set of states: S – Set of actions (i.e., decisions): A – Transition model: Pr(st|at-1,st-1) – Reward model (i.e., utility): R(st) – Discount factor: 0 ≤  ≤ 1 – Horizon (i.e., # of time steps): h

  • Goal: find optimal policy
slide-5
SLIDE 5

5

CS486/686 Lecture Slides (c) 2012 P. Poupart

9

Inventory Management

  • Markov Decision Process

– States: inventory levels – Actions: {doNothing, orderWidgets} – Transition model: stochastic demand – Reward model: Sales – Costs - Storage – Discount factor: 0.999 – Horizon: ∞

  • Tradeoff: increasing supplies decreases odds
  • f missed sales but increases storage costs

CS486/686 Lecture Slides (c) 2012 P. Poupart

10

Policy

  • Choice of action at each time step
  • Formally:

– Mapping from states to actions – i.e., δ(st) = at – Assumption: fully observable states

  • Allows at to be chosen only based on current

state st. Why?

slide-6
SLIDE 6

6

CS486/686 Lecture Slides (c) 2012 P. Poupart

11

Policy Optimization

  • Policy evaluation:

– Compute expected utility – EU(δ) = Σt=0 t Pr(st|δ) R(st)

  • Optimal policy:

– Policy with highest expected utility – EU(δ) ≤ EU(δ*) for all δ

h

CS486/686 Lecture Slides (c) 2012 P. Poupart

12

Policy Optimization

  • Three algorithms to optimize policy:

– Value iteration – Policy iteration – Linear Programming

  • Value iteration:

– Equivalent to variable elimination

slide-7
SLIDE 7

7

CS486/686 Lecture Slides (c) 2012 P. Poupart

13

Value Iteration

s0 s1 s2 s3 s4 a0 a1 a2 a3 r1 r2 r3 r4

  • Nothing more than variable elimination
  • Performs dynamic programming
  • Optimize decisions in reverse order

CS486/686 Lecture Slides (c) 2012 P. Poupart

14

Value Iteration

s0 s1 s2 s3 s4 a0 a1 a2 a3 r1 r2 r3 r4

  • At each t, starting from t=h down to 0:

– Optimize at: EU(at|st)? – Factors: Pr(si+1|ai,si), R(si), for 0≤i≤h – Restrict st – Eliminate st+1,…,sh,at+1,…,ah

slide-8
SLIDE 8

8

CS486/686 Lecture Slides (c) 2012 P. Poupart

15

Value Iteration

  • Value when no time left:

– V(sh) = R(sh)

  • Value with one time step left:

– V(sh-1) = maxah-1 R(sh-1) +  Σsh Pr(sh|sh-1,ah-1) V(sh)

  • Value with two time steps left:

– V(sh-2) = maxah-2 R(sh-2) +  Σsh-1 Pr(sh-1|sh-2,ah-2) V(sh-

1)

  • Bellman’s equation:

– V(st) = maxat R(st) +  Σst+1 Pr(st+1|st,at) V(st+1) – at* = argmaxat R(st) +  Σst+1 Pr(st+1|st,at) V(st+1)

CS486/686 Lecture Slides (c) 2012 P. Poupart

16

A Markov Decision Process

1 Poor & Unknown +0 Poor & Famous +0 Rich & Famous +10 Rich & Unknown +10 S S S S A A A A 1 1 ½ ½ ½ ½ ½ ½ ½ ½ ½ ½

 = 0.9

You own a company In every state you must choose between Saving money or Advertising

slide-9
SLIDE 9

9

CS486/686 Lecture Slides (c) 2012 P. Poupart

17

1 PU +0 PF +0 RF +10 RU +10 S S S S A A A A 1 1 ½ ½ ½ ½ ½ ½ ½ ½ ½ ½

 = 0.9

t V(PU) V(PF) V(RU) V(RF) h 10 10 h-1 4.5 14.5 19 h-2 2.03 8.55 16.53 25.08 h-3 4.76 12.20 18.35 28.72 h-4 7.63 15.07 20.40 31.18 h-5 10.21 17.46 22.61 33.21

CS486/686 Lecture Slides (c) 2012 P. Poupart

18

Finite Horizon

  • When h is finite,
  • Non-stationary optimal policy
  • Best action different at each time step
  • Intuition: best action varies with the amount
  • f time left
slide-10
SLIDE 10

10

CS486/686 Lecture Slides (c) 2012 P. Poupart

19

Infinite Horizon

  • When h is infinite,
  • Stationary optimal policy
  • Same best action at each time step
  • Intuition: same (infinite) amount of time left

at each time step, hence same best action

  • Problem: value iteration does an infinite

number of iterations…

CS486/686 Lecture Slides (c) 2012 P. Poupart

20

Infinite Horizon

  • Assuming a discount factor , after k time

steps, rewards are scaled down by k

  • For large enough k, rewards become

insignificant since k  0

  • Solution:

– pick large enough k – run value iteration for k steps – Execute policy found at the kth iteration

slide-11
SLIDE 11

11

CS486/686 Lecture Slides (c) 2012 P. Poupart

21

Computational Complexity

  • Space and time: O(k|A||S|2) 

– Here k is the number of iterations

  • But what if |A| and |S| are defined by

several random variables and consequently exponential?

  • Solution: exploit conditional

independence

– Dynamic decision network

CS486/686 Lecture Slides (c) 2012 P. Poupart

22

Dynamic Decision Network

Tt Lt Ct Nt Tt+1 Lt+1 Ct+1 Nt+1 Mt Mt+1 Actt Tt-1 Lt-1 Ct-1 Nt-1 Mt-1 Actt-1 Tt-2 Lt-2 Ct-2 Nt-2 Mt-2 Actt-2 Rt+1 Rt Rt-1 Rt-2

slide-12
SLIDE 12

12

CS486/686 Lecture Slides (c) 2012 P. Poupart

23

Dynamic Decision Network

  • Similarly to dynamic Bayes nets:

– Compact representation  – Exponential time for decision making 

CS486/686 Lecture Slides (c) 2012 P. Poupart

24

Partial Observability

  • What if states are not fully observable?
  • Solution: Partially Observable Markov

Decision Process

s0 s1 s2 s3 s4 a0 a1 a2 a3 r1 r2 r3 r4

  • 1
  • 2
  • 3
slide-13
SLIDE 13

13

CS486/686 Lecture Slides (c) 2012 P. Poupart

25

Partially Observable Markov Decision Process (POMDP)

  • Definition

– Set of states: S – Set of actions (i.e., decisions): A – Set of observations: O – Transition model: Pr(st|at-1,st-1) – Observation model: Pr(ot|st) – Reward model (i.e., utility): R(st) – Discount factor: 0 ≤  ≤ 1 – Horizon (i.e., # of time steps): h

  • Policy: mapping from past obs. to actions

CS486/686 Lecture Slides (c) 2012 P. Poupart

26

POMDP

  • Problem: action choice generally depends
  • n all previous observations…
  • Two solutions:

– Consider only policies that depend on a finite history of observations – Find stationary sufficient statistics encoding relevant past observations

slide-14
SLIDE 14

14

CS486/686 Lecture Slides (c) 2012 P. Poupart

27

Partially Observable DDN

Tt Lt Ct Nt Tt+1 Lt+1 Ct+1 Nt+1 Mt Mt+1 Actt Tt-1 Lt-1 Ct-1 Nt-1 Mt-1 Actt-1 Tt-2 Lt-2 Ct-2 Nt-2 Mt-2 Actt-2 Rt+1 Rt Rt-1 Rt-2

  • Actions do not depend on all state variables

CS486/686 Lecture Slides (c) 2012 P. Poupart

28

Policy Optimization

  • Policy optimization:

– Value iteration (variable elimination) – Policy iteration

  • POMDP and PODDN complexity:

– Exponential in |O| and k when action choice depends on all previous observations  – In practice, good policies based on subset

  • f past observations can still be found
slide-15
SLIDE 15

15

CS486/686 Lecture Slides (c) 2012 P. Poupart

29

COACH project

  • Automated prompting system to help elderly persons

wash their hands

  • IATSL: Alex Mihailidis, Pascal Poupart, Jennifer Boger,

Jesse Hoey, Geoff Fernie and Craig Boutilier

CS486/686 Lecture Slides (c) 2012 P. Poupart

30

Aging Population

  • Dementia

– Deterioration of intellectual faculties – Confusion – Memory losses (e.g., Alzheimer’s disease)

  • Consequences:

– Loss of autonomy – Continual and expensive care required

slide-16
SLIDE 16

16

CS486/686 Lecture Slides (c) 2012 P. Poupart

31

Intelligent Assistive Technology

  • Let’s facilitate aging in place
  • Intelligent assistive technology

– Non-obtrusive, yet pervasive – Adaptable

  • Benefits:

– Greater autonomy – Feeling of independence

CS486/686 Lecture Slides (c) 2012 P. Poupart

32

System Overview

sensors hand washing verbal cues planning

slide-17
SLIDE 17

17

CS486/686 Lecture Slides (c) 2012 P. Poupart

33

Prompting Strategy

  • Sequential decision problem

– Sequence of prompts

  • Noisy sensors & imprecise actuators

– Noisy image processing, uncertain prompt effects

  • Partially unknown environment

– Unknown user habits, preferences and abilities

  • Tradeoff between complex concurrent goals

– Rapid task completion vs greater autonomy

  • Approach: Partially Observable Markov Decision

Processes (POMDPs)

CS486/686 Lecture Slides (c) 2012 P. Poupart

34

POMDP components

  • State set S = dom(HL) x dom(WF) x dom(D) x …

– Hand Location  {tap,water,soap,towel,sink,away,…} – Water Flow  {on, off}, – Dementia  {high, low}, etc.

  • Observation set O = dom(C) x dom(FS)

– Camera  {handsAtTap, handsAtTowel, …} – Faucet sensor  {waterOn, waterOff}

  • Action set A

– DoNothing, CallCaregiver, Prompt  {turnOnWater, rinseHands, useSoap, …}

slide-18
SLIDE 18

18

CS486/686 Lecture Slides (c) 2012 P. Poupart

35

POMDP components

  • Transition function

Pr(s’|s,a)

  • Reward function R(s,a)

– Task completed  +100 – Call caregiver  -30 – Each prompt  -1, -2 or -3 sink,off sink,off sink,off tap,on tap,on soap,off soap,off 0.3 0.6 0.01 0.95 0.01 0.01

Observation function Pr(o|s)

CS486/686 Lecture Slides (c) 2012 P. Poupart

36

Next Class

  • Machine Learning
  • Decision Trees