Presentation is loading. Please wait.

Presentation is loading. Please wait.

Summary of MDPs (until Now) Finite-horizon MDPs – Non-stationary policy – Value iteration Compute V 0..V k.. V T the value functions for k stages to go.

Similar presentations


Presentation on theme: "Summary of MDPs (until Now) Finite-horizon MDPs – Non-stationary policy – Value iteration Compute V 0..V k.. V T the value functions for k stages to go."— Presentation transcript:

1 Summary of MDPs (until Now) Finite-horizon MDPs – Non-stationary policy – Value iteration Compute V 0..V k.. V T the value functions for k stages to go V k is computed in terms of V k-1 Policy  k is MEU of V k Infinite-horizon MDPs – Stationary policy – Value iteration Converges because of contraction property of Bellman operator – Policy iteration Indefinite horizon MDPs -- Stochastic Shortest Path problems (with initial state given) Proper policies -- Can exploit start state

2 Ideas for Efficient Algorithms.. Use heuristic search (and reachability information) – LAO*, RTDP Use execution and/or Simulation – “Actual Execution” Reinforcement learning (Main motivation for RL is to “learn” the model) – “Simulation” –simulate the given model to sample possible futures Policy rollout, hindsight optimization etc. Use “factored” representations – Factored representations for Actions, Reward Functions, Values and Policies – Directly manipulating factored representations during the Bellman update

3 Heuristic Search vs. Dynamic Programming (Value/Policy Iteration) VI and PI approaches use Dynamic Programming Update Set the value of a state in terms of the maximum expected value achievable by doing actions from that state. They do the update for every state in the state space – Wasteful if we know the initial state(s) that the agent is starting from Heuristic search (e.g. A*/AO*) explores only the part of the state space that is actually reachable from the initial state Even within the reachable space, heuristic search can avoid visiting many of the states. – Depending on the quality of the heuristic used.. But what is the heuristic? – An admissible heuristic is a lowerbound on the cost to reach goal from any given state – It is a lowerbound on J*!

4 Real Time Dynamic Programming [Barto, Bradtke, Singh’95] Trial: simulate greedy policy starting from start state; perform Bellman backup on visited states RTDP: repeat Trials until cost function converges RTDP was originally introduced for Reinforcement Learning  For RL, instead of “simulate” you “execute”  You also have to do “exploration” in addition to “exploitation”  with probability p, follow the greedy policy with 1-p pick a random action

5 0 0 Stochastic Shortest Path MDP

6 Min ? ? s0s0 JnJn JnJn JnJn JnJn JnJn JnJn JnJn Q n+1 (s 0,a) J n+1 (s 0 ) a greedy = a 2 Goal a1a1 a2a2 a3a3 RTDP Trial ?

7 Greedy “On-Policy” RTDP without execution  Using the current utility values, select the action with the highest expected utility (greedy action) at each state, until you reach a terminating state. Update the values along this path. Loop back—until the values stabilize

8 Comments Properties – if all states are visited infinitely often then J n → J* – Only relevant states will be considered A state is relevant if the optimal policy could visit it.  Notice emphasis on “optimal policy”—just because a rough neighborhood surrounds National Mall doesn’t mean that you will need to know what to do in that neighborhood Advantages – Anytime: more probable states explored quickly Disadvantages – complete convergence is slow! – no termination condition Do we care about complete convergence?  Think Cpt. Sullenberger

9 Labeled RTDP [Bonet&Geffner’03] Initialise J 0 with an admissible heuristic – ⇒ J n monotonically increases Label a state as solved – if the J n for that state has converged Backpropagate ‘solved’ labeling Stop trials when they reach any solved state Terminate when s 0 is solved sG high Q costs best action ) J(s) won’t change! sG ? t both s and t get solved together high Q costs Converged means bellman residual is less than 

10

11 Properties admissible J 0 ⇒ optimal J* heuristic-guided – explores a subset of reachable state space anytime – focusses attention on more probable states fast convergence – focusses attention on unconverged states terminates in finite time

12 Recent Advances: Focused RTDP [Smith&Simmons’06] Similar to Bounded RTDP except – a more sophisticated definition of priority that combines gap and prob. of reaching the state – adaptively increasing the max-trial length Recent Advances: Learning DFS [Bonet&Geffner’06]  Iterative Deepening A* equivalent for MDPs  Find strongly connected components to check for a state being solved.

13 Other Advances Ordering the Bellman backups to maximise information flow. – [Wingate & Seppi’05] – [Dai & Hansen’07] Partition the state space and combine value iterations from different partitions. – [Wingate & Seppi’05] – [Dai & Goldsmith’07] External memory version of value iteration – [Edelkamp, Jabbar & Bonet’07] …

14 Probabilistic Planning --The competition (IPPC) --The Action language.. (PPDDL)

15

16 Factored Representations: Actions Actions can be represented directly in terms of their effects on the individual state variables (fluents). The CPTs of the BNs can be represented compactly too! – Write a Bayes Network relating the value of fluents at the state before and after the action Bayes networks representing fluents at different time points are called “Dynamic Bayes Networks” We look at 2TBN (2-time-slice dynamic bayes nets) Go further by using STRIPS assumption – Fluents not affected by the action are not represented explicitly in the model – Called Probabilistic STRIPS Operator (PSO) model

17 Action CLK

18

19

20 Not ergodic

21

22

23 How to compete? Off-line policy generation First compute the whole policy – Get the initial state – Compute the optimal policy given the initial state and the goals Then just execute the policy – Loop Do action recommended by the policy Get the next state – Until reaching goal state Pros: Can anticipate all problems; Cons: May take too much time to start executing Online action selection Loop – Compute the best action for the current state – execute it – get the new state Pros: Provides fast first response Cons: May paint itself into a corner.. Policy Computation ExecSelect exex exex exex exex

24 Two Models of Evaluating Probabilistic Planning IPPC (Probabilistic Planning Competition) – How often did you reach the goal under the given time constraints FF-HOP FF-Replan Evaluate on the quality of the policy – Converging to optimal policy faster LRTDP mGPT Kolobov’s approach

25 1 st IPPC & Post-Mortem.. IPPC Competitors Most IPPC competitors used different approaches for offline policy generation. One group implemented a simple online “replanning” approach in addition to offline policy generation – Determinize the probabilistic problem Most-likely vs. All-outcomes – Loop Get the state S; Call a classical planner (e.g. FF) with [S,G] as the problem Execute the first action of the plan Umpteen reasons why such an approach should do quite badly.. Results and Post-mortem To everyone’s surprise, the replanning approach wound up winning the competition. Lots of hand-wringing ensued.. – May be we should require that the planners really really use probabilities? – May be the domains should somehow be made “probabilistically interesting”? Current understanding: – No reason to believe that off-line policy computation must dominate online action selection – The “replanning” approach is just a degenerate case of hind-sight optimization

26 FF-Replan Simple replanner Determinizes the probabilistic problem Solves for a plan in the determinized problem SG a1a2a3a4 a2 a3 a4 G a5

27 All Outcome Replanning (FFR A ) Action Effect 1 Effect 2 Probability 1 Probability 2 Action 1 Effect 1 Action 2 Effect 2 ICAPS-07 27

28 Reducing calls to FF.. We can reduce calls to FF by memoizing successes – If we were given s0 and sG as the problem, and solved it using our determinization to get the plan s0—a0—s1—a1—s2—a2—s3…an—sG – Then in addition to sending a1 to the simulator, we can memoize {si—ai} as the partial policy. Whenever a new state is given by the simulator, we can see if it is already in the partial policy Additionally, FF-replan can consider every state in the partial policy table as a goal state (in that if it reaches them, it knows how to get to goal state..)

29 Hindsight Optimization for Anticipatory Planning/Scheduling Consider a deterministic planning (scheduling) domain, where the goals arrive probabilistically – Using up resources and/or doing greedy actions may preclude you from exploiting the later opportunities How do you select actions to perform? – Answer: If you have a distribution of the goal arrival, then Sample goals upto a certain horizon using this distribution Now, we have a deterministic planning problem with known goals Solve it; do the first action from it. – Can improve accuracy with multiple samples FF-Hop uses this idea for stochastic planning. In anticipatory planning, the uncertainty is exogenous (it is the uncertain arrival of goals). In stochastic planning, the uncertainty is endogenous (the actions have multiple outcomes)

30 Probabilistic Planning (goal-oriented) Action Probabilistic Outcome Time 1 Time 2 Goal State 30 Action State Maximize Goal Achievement Dead End A1A2 I A1 A2 A1 A2 A1 A2 A1 A2 Left Outcomes are more likely

31 Probabilistic Planning All Outcome Determinization Action Probabilistic Outcome Time 1 Time 2 Goal State 31 Action State Find Goal Dead End A1A2 A1 A2 A1 A2 A1 A2 A1 A2 I A1-1A1-2A2-1A2-2 A1-1A1-2A2-1A2-2A1-1A1-2A2-1A2-2A1-1A1-2A2-1A2-2A1-1A1-2A2-1A2-2

32 Probabilistic Planning All Outcome Determinization Action Probabilistic Outcome Time 1 Time 2 Goal State 32 Action State Find Goal Dead End A1A2 A1 A2 A1 A2 A1 A2 A1 A2 I A1-1A1-2A2-1A2-2 A1-1A1-2A2-1A2-2A1-1A1-2A2-1A2-2A1-1A1-2A2-1A2-2A1-1A1-2A2-1A2-2

33 Problems of FF-Replan and better alternative sampling 33 FF-Replan’s Static Determinizations don’t respect probabilities. We need “Probabilistic and Dynamic Determinization” Sample Future Outcomes and Determinization in Hindsight Each Future Sample Becomes a Known-Future Deterministic Problem

34 Hindsight Optimization (Online Computation of V HS ) Pick action a with highest Q(s,a,H) where – Q(s,a,H) = R(s,a) +  T(s,a,s’)V*(s’,H-1) Compute V* by sampling – H-horizon future F H for M = [S,A,T,R] Mapping of state, action and time (h<H) to a state – S × A × h → S Common-random number (correlated) vs. independent futures.. Time-independent vs. Time-dependent futures Value of a policy π for F H – R(s,F H, π ) V*(s,H) = max π E F H [ R(s,F H, π ) ] – But this is still too hard to compute.. – Let’s swap max and expectation V HS (s,H) = E F H [max π R(s,F H, π )] – max π R(s,F H-1, π ) is approximated by FF plan V HS overestimates V* Why? – Intuitively, because V HS can assume that it can use different policies in different futures; while V* needs to pick one policy that works best (in expectation) in all futures. But then, V FFRa overestimates V HS – Viewed in terms of J*, V HS is a more informed admissible heuristic.. 34

35 Solving stochastic planning problems via determinizations Quite an old idea (e.g. envelope extension methods) What is new is that there is increasing realization that determinizing approaches provide state-of-the-art performance –Even for probabilistically interesting domains Should be a happy occasion..

36 Hindsight Optimization (Online Computation of V HS ) H-horizon future F H for M = [S,A,T,R] –Mapping of state, action and time (h<H) to a state –S × A × h → S Value of a policy π for F H –R(s,F H, π) Pick action a with highest Q(s,a,H) where –Q(s,a,H) = R(s) + V*(s,H-1) V*(s,H) = max π E F H [ R(s,F H,π) ] Compare this and the real value V HS (s,H) = E F H [max π R(s,F H,π)] V FFRa (s) = max F V(s,F) ≥ V HS (s,H) ≥ V*(s,H) Q(s,a,H) = (R(a) + E F H-1 [max π R(a(s),F H-1,π)] ) –In our proposal, computation of max π R(s,F H-1,π) is approximately done by FF [Hoffmann and Nebel ’01] 36 Done by FF Each Future is a Deterministic Problem

37 Implementation FF-Hindsight Constructs a set of futures Solves the planning problem using the H-horizon futures using FF Sums the rewards of each of the plans Chooses action with largest Qhs value

38 Probabilistic Planning (goal-oriented) Action Probabilistic Outcome Time 1 Time 2 Goal State 38 Action State Maximize Goal Achievement Dead End Left Outcomes are more likely A1A2 A1 A2 A1 A2 A1 A2 A1 A2 I

39 Improvement Ideas Reuse –Generated futures that are still relevant –Scoring for action branches at each step –If expected outcomes occur, keep the plan Future generation –Not just probabilistic –Somewhat even distribution of the space Adaptation –Dynamic width and horizon for sampling –Actively detect and avoid unrecoverable failures on top of sampling

40 Hindsight Sample 1 Action Probabilistic Outcome Time 1 Time 2 Goal State 40 Action State Maximize Goal Achievement Dead End A1: 1 A2: 0 Left Outcomes are more likely A1A2 A1 A2 A1 A2 A1 A2 A1 A2 I

41 Exploiting Determinism Find the longest prefix for all plans Apply the actions in the prefix to continuously until one is not applicable Resume ZSL/OSL steps

42 Exploiting Determinism G S1S1 G S1S1 G S1S1 a* Plans generated for chosen action, a* Longest prefix for each plan is identified and executed without running ZSL, OSL or FF!

43 Handling unlikely outcomes: All-outcome Determinization Assign each possible outcome an action Solve for a plan Combine the plan with the plans from the HOP solutions

44 Deterministic Techniques for Stochastic Planning No longer the Rodney Dangerfield of Stochastic Planning?

45 Determinizations Most-likely outcome determinization – Inadmissible – e.g. if only path to goal relies on less likely outcome of an action All outcomes determinization – Admissible, but not very informed – e.g. Very unlikely action leads you straight to goal

46 Relaxations for Stochastic Planning Determinizations can also be used as a basis for heuristics to initialize the V for value iteration [mGPT; GOTH etc] Heuristics come from relaxation We can relax along two separate dimensions: – Relax –ve interactions Consider +ve interactions alone using relaxed planning graphs – Relax uncertainty Consider determinizations – Or a combination of both!

47 Solving Determinizations If we relax –ve interactions – Then compute relaxed plan Admissible if optimal relaxed plan is computed Inadmissible otherwise If we keep –ve interactions – Then use a deterministic planner (e.g. FF/LPG) Inadmissible unless the underlying planner is optimal

48 Dimensions of Relaxation Uncertainty Negative Interactions 1 1 2 2 3 3 1 1 Relaxed Plan Heuristic 2 2 McLUG 3 3 FF/LPG Reducing Uncertainty Bound the number of stochastic outcomes  Stochastic “width” 4 4 4 4 Limited width stochastic planning? Increasing consideration 

49 Dimensions of Relaxation NoneSomeFull NoneRelaxed PlanMcLUG Some FullFF/LPGLimited width Stoch Planning Uncertainty -ve interactions

50 Expressiveness v. Cost h = 0 McLUG FF-Replan FF Limited width stochastic planning Node Expansions v. Heuristic Computation Cost Nodes Expanded Computation Cost FF R FF

51

52 Reducing Heuristic Computation Cost by exploiting factored representations The heuristics computed for a state might give us an idea about the heuristic value of other “similar” states – Similarity is possible to determine in terms of the state structure Exploit overlapping structure of heuristics for different states – E.g. SAG idea for McLUG – E.g. Triangle tables idea for plans (c.f. Kolobov)

53 A Plan is a Terrible Thing to Waste Suppose we have a plan – s0—a0—s1—a1—s2—a2—s3…an—sG – We realized that this tells us not just the estimated value of s0, but also of s1,s2…sn – So we don’t need to compute the heuristic for them again Is that all? – If we have states and actions in factored representation, then we can explain exactly what aspects of si are relevant for the plan’s success. – The “explanation” is a proof of correctness of the plan » Can be based on regression (if the plan is a sequence) or causal proof (if the plan is a partially ordered one. The explanation will typically be just a subset of the literals making up the state – That means actually, the plan suffix from si may actually be relevant in many more states that are consistent with that explanation

54 Triangle Table Memoization Use triangle tables / memoization C C B B A A A A B B C C If the above problem is solved, then we don’t need to call FF again for the below: B B A A A A B B

55 Explanation-based Generalization (of Successes and Failures) Suppose we have a plan P that solves a problem [S, G]. We can first find out what aspects of S does this plan actually depend on – Explain (prove) the correctness of the plan, and see which parts of S actually contribute to this proof – Now you can memoize this plan for just that subset of S

56

57

58 Factored Representations: Reward, Value and Policy Functions Reward functions can be represented in factored form too. Possible representations include – Decision trees (made up of fluents) – ADDs (Algebraic decision diagrams) Value functions are like reward functions (so they too can be represented similarly) Bellman update can then be done directly using factored representations..

59

60 SPUDDs use of ADDs

61 Direct manipulation of ADDs in SPUDD


Download ppt "Summary of MDPs (until Now) Finite-horizon MDPs – Non-stationary policy – Value iteration Compute V 0..V k.. V T the value functions for k stages to go."

Similar presentations


Ads by Google