cmu mdps 15 381 781
play

CMU MDPs 15-381/781 Emma Brunskill (THIS TIME) Ariel Procaccia - PowerPoint PPT Presentation

CMU MDPs 15-381/781 Emma Brunskill (THIS TIME) Ariel Procaccia DeepMind 2 So long certainty Sensors Percepts Agent Environment Actuators Actions Until now, result of taking an action in a state was deterministic Slide


  1. CMU MDPs 15-381/781 Emma Brunskill (THIS TIME) Ariel Procaccia

  2. • DeepMind 2

  3. So long certainty… Sensors Percepts Agent Environment ¡ Actuators Actions • Until now, result of taking an action in a state was deterministic Slide adapted from Klein and Abbeel

  4. Reasoning Under Uncertainty Multi-armed Reinforcement Learn ¡model ¡ bandits Learning of ¡outcomes ¡ ¡ ¡ Markov Decision Given ¡model ¡ Decision theory Processes of ¡stochas#c ¡ outcomes ¡ Ac#ons ¡Don’t ¡ Ac#ons ¡Change ¡ Change ¡State ¡of ¡ State ¡of ¡the ¡ the ¡World ¡ World ¡

  5. Expectation • The expected value of a function of a random variable is the average, weighted by the probability distribution over outcomes • Example: expected time if take the bus • Time: 5 min + 30 min 12.5 ¡min ¡ • Probability: 0.7 + 0.3 Slide adapted from Klein and Abbeel

  6. Where Do Probabilities Come from? • Models max ¡ • Data chance ¡ • For now assume we are given the probabilities for any chance node

  7. Reasoning Under Uncertainty Learn ¡model ¡ of ¡outcomes ¡ ¡ Given ¡model ¡ Markov of ¡stochas#c ¡ Decision theory Decision outcomes ¡ Processes Ac#ons ¡Don’t ¡ Ac#ons ¡Change ¡ Change ¡State ¡of ¡ State ¡of ¡the ¡ the ¡World ¡ World ¡

  8. (Stochastically) Change the World Sensors Percepts Agent Environment ¡ Actuators Actions • Like planning/search, actions impact world • But exact impact is stochastic: probability distribution over next states Slide adapted from Klein and Abbeel

  9. Example: Grid World A ¡maze-­‑like ¡problem ¡ § The ¡agent ¡lives ¡in ¡a ¡grid ¡ § Walls ¡block ¡the ¡agent’s ¡path ¡ § The ¡agent ¡receives ¡rewards ¡each ¡#me ¡step ¡ § Small ¡“living” ¡reward ¡each ¡step ¡(can ¡be ¡ § nega#ve) ¡ Big ¡rewards ¡come ¡at ¡the ¡end ¡(good ¡or ¡bad) ¡ § Goal: ¡maximize ¡sum ¡of ¡rewards ¡ § Noisy ¡movement: ¡ac#ons ¡do ¡not ¡always ¡go ¡as ¡ § planned ¡ 80% ¡of ¡the ¡#me, ¡ac#on ¡North ¡takes ¡the ¡agent ¡ § North ¡(if ¡there ¡is ¡no ¡wall ¡there) ¡ 10% ¡of ¡the ¡#me, ¡North ¡takes ¡the ¡agent ¡West; ¡ § 10% ¡East ¡ If ¡there ¡is ¡a ¡wall ¡in ¡the ¡direc#on ¡the ¡agent ¡ § would ¡have ¡gone, ¡agent ¡stays ¡put ¡ Slide adapted from Klein and Abbeel

  10. Grid World Actions Determinis#c ¡Grid ¡World ¡ Stochas#c ¡Grid ¡World ¡ Slide adapted from Klein and Abbeel

  11. Markov Decision Processes • S et of states s ∈ S • Set of actions a ∈ A • Transition func. T(s, a, s’) Probability that a from s leads to s’, i.e., P(s’| s, a) • • Reward func. R(s, a, s’) / R(s) / R(s,a) • Start state or states (could be all S) • Maybe a terminal state Discount factor • • MDPs are non-deterministic search problems Slide adapted from Klein and Abbeel

  12. Markov Decision Processes

  13. Markov Property • Called Markov decision process because the outcome of an action depends only on the current state • p(s t+1 |s 1 ,a 1 ,s 2 ,a 2 , … s t ,a t )=p(s t+1 |s t ,a t )

  14. Policies • In deterministic single-agent search problems, we wanted an optimal plan, or sequence of actions, from start to a goal • In MDPs instead of plans, we have a policies • A policy π *: S → A Specifies what action to take in each state o Slide adapted from Klein and Abbeel

  15. How Many Policies? • How many non-terminal states? • How many actions? • How many deterministic policies over non-terminal states?

  16. Optimal Policies • Optimal plan had minimal cost to reach goal • Utility or value of a policy π starting in state s is the expected sum of future rewards will receive by following π starting in state s • Optimal policy has maximal expected sum of rewards from following it

  17. Optimal Policies R(s) ¡= ¡ R(s) ¡= ¡ -­‑0.03 ¡ -­‑0.01 ¡ R(s) ¡= ¡-­‑0.4 ¡ R(s) ¡= ¡-­‑2.0 ¡ Slide adapted from Klein and Abbeel

  18. Example: ¡Racing ¡ A ¡robot ¡car ¡wants ¡to ¡travel ¡far, ¡quickly ¡ • Three ¡states: ¡Cool, ¡Warm, ¡Overheated ¡ • Two ¡ac#ons: ¡ Slow , ¡ Fast ¡ • Going ¡faster ¡gets ¡double ¡reward ¡ • +1 ¡ ¡ 0.5 ¡ ¡ 1.0 ¡ ¡ Fast ¡ Slow ¡ -­‑10 ¡ +1 ¡ ¡ 0.5 ¡ ¡ Warm ¡ Slow ¡ Fast ¡ 0.5 ¡ ¡ +2 ¡ ¡ 0.5 ¡ ¡ Cool ¡ Overheated ¡ +1 ¡ ¡ 1.0 ¡ ¡ +2 ¡ ¡ Slide adapted from Klein and Abbeel

  19. Racing Search Tree Slide adapted from Klein and Abbeel

  20. Utilities of Sequences Slide adapted from Klein and Abbeel

  21. Utilities of Sequences • What preferences should an agent have over reward sequences? • More or less? [1, ¡2, ¡2] ¡ ¡or ¡ [2, ¡3, ¡4] ¡ • Now or later? [0, ¡0, ¡1] ¡ ¡or ¡ [1, ¡0, ¡0] ¡ Slide adapted from Klein and Abbeel

  22. Stationary Preferences • Theorem: if we assume stationary preferences: • Then: there are only two ways to define utilities over sequences of rewards Additive utility: o Discounted utility: o Slide adapted from Klein and Abbeel

  23. What are Discounts? • It’s reasonable to prefer rewards now to rewards later • Decay rewards exponentially Worth ¡ Worth ¡Next ¡ Worth ¡In ¡Two ¡ Now ¡ Step ¡ Steps ¡ Slide adapted from Klein and Abbeel

  24. Discounting • Given: Actions: East, West o Terminal states: a and e (end when reach one or the other) o Transitions: deterministic o Reward for reaching a is 10 (regardless of initial state & action, e.g. r(s,action,a) = 10), reward o for reaching e is 1, and the reward for reaching all other states is 0 • Quiz 1: For γ = 1, what is the optimal policy? • Quiz 2: For γ = 0.1, what is the optimal policy for states b, c and d? • Quiz 3: For which γ are West and East equally good when in state d? Slide adapted from Klein and Abbeel

  25. Quiz: Discounting • Given: Actions: East, West o Terminal states: a and e (endwhen reach one or the other) o Transitions: deterministic o Reward for reaching a is 10 (regardless of initial state a& action, e.g. r(s,action,a) = 10), reward o for reaching e is 1, and the reward for reaching all other states is 0 • Quiz 1: For γ = 1, what is the optimal policy? In all states, Go West (towards a) o • Quiz 2: For γ = 0.1, what is the optimal policy? b=W, c=W, d=E o • Quiz 3: For which γ are West and East equally good when in state d? Gamma = sqrt (1/10) Slide adapted from Klein and Abbeel

  26. Infinite Utilities?! § Problem: What if the game lasts forever? Do we get infinite rewards? § Solutions: Finite horizon: (similar to depth-limited search) § § Terminate episodes after a fixed T steps (e.g. life) § Gives nonstationary policies ( π depends on time left) Discounting: use 0 < γ < 1 § § Smaller γ means smaller “ horizon ” – shorter term focus Absorbing state: guarantee that for every policy, a terminal § state will eventually be reached (like “ overheated ” for racing) Slide adapted from Klein and Abbeel

  27. Recap: Defining MDPs • Markov decision processes: Set of states S o Start state s 0 o Set of actions A o Transitions P(s’|s,a) (or T(s,a,s’)) o Rewards R(s,a,s’) (and discount γ ) o • MDP quantities so far: Policy = Choice* of action for each state o Utility/Value = sum of (discounted) rewards o Slide adapted from Klein and Abbeel

  28. Value of a Policy in Each State • Expected immediate reward for taking action prescribed by policy π for that state • And expected future reward get after taking that action from that state and following π V π ( s ) = p ( s ' | s , π ( s )) R ( s , π ( s ), s ') + γ V π ( s ') ! # ∑ " $ s ' ∈ S • Future reward depends on horizon (how many more steps get to act). For now assume infinite 28

  29. Q: State-Action Value • Expected immediate reward for taking action • And expected future reward get after taking that action from that state and following π Q π ( s , a ) = p ( s ' | s , a ) R ( s , a , s ') + γ V π ( s ') ! # ∑ " $ s ' ∈ S

  30. Optimal Value V* and π * • Optimal value: Highest possible value for each s • Satisfies the Bellman Equation ( ) ! # ∑ V *( s i ) = max p ( s j | s i , a ) R ( s i , a , s ') + γ V *( s j ) " $ s j ∈ S a • Optimal policy π *( s i ) = argmax Q ( s i , a ) a ( ) ! # ∑ = argmax p ( s j | s i , a ) R ( s i , a , s ') + γ V *( s j ) " $ s j ∈ S a • Want to find these optimal values!

  31. Value Iteration • Bellman equation inspires an update rule ( ) ∑ ! # V *( s i ) = max p ( s j | s i , a ) R ( s , a , s ') + γ V *( s j ) " $ s j ∈ S a ( ) ∑ " $ V k ( s i ) = max p ( s j | s i , a ) R ( s , a , s ') + γ V k − 1 ( s j ) # % s j ∈ S a • Form of dynamic programming 31

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend