1
Fast Approximate Hierarchical Solutions of MDPs Jenny Barry Advisors: Leslie Kaelbling, Tomas Lozano-Perez MasterWorks 5/4/2009 Markov Decision Process: M = {S, A, T, R, G} S: The world is a finite number of states A: Actions allow non-deterministic transitions among states T: Function giving probability action transitions between two states R: Each state has a reward associated with it G: We must reach some goal state(s) Solution: Policy giving action for each state maximizing expected reward The Problem The Problem Space is BIG Everything affects everything The scope varies The world is uncertain World Model: Hierarchical Markov World Model: Hierarchical Markov Decision Processes (MDPs) Decision Processes (MDPs) Objectives Objectives Create a solver for a hierarchical MDP Top-down Efficient method for calculating transitions/rewards Fast, semi-accurate solution for non-primitive levels Clustering Algorithm: Works with solver Cluster “near” states Efficient Assure hierarchical policy   does not strand states Solver Solver Fast Upward Pass Assume deterministic transitions Calculate “cost” of moving between each state C(ija) = -R(ija)/T(ija) Solve using shortest path algorithm Cost between clusters = average cost i j C(i, j) = 4/3 i j R(ija) = -1 T(i, j, a) = 0.75 Downward Pass i policy[i] in sub-MDP sub-MDP goal Given policy, create “sub-MDP” from to policy[i] States in sub-MDP All sub-states of All sub-states of policy[i] reachable in one transition from Goal states are states in policy[i] Upper level: solve for policy using shortest path among clusters Primitive level: solve for policy using value iteration Clustering Clustering No “stranded” states Bad Clustering: Can't reach goals sub-MDP goal in sub-MDP i policy[i] Guarantee: If any state in cluster i can reach a state in cluster j, all states in cluster i can reach a state in cluster j  Enumerated States Agglomerative: state begins as its own cluster Pre-process: For each cluster add any states that Transition into cluster, but not out Are adjacent to the cluster in both directions Until done (maximum cluster size or number): Compute cluster adjacency matrix Find circuits in adjacency matrix Cluster circuits Factored Divisive: All states start in same cluster Cluster sets of states (fStates) Rule: f 1  and f 2  can be clustered together if all states in f 1  can reach some state in f 2  and vice-versa Operations: Split cluster C on cluster S creates C S  = C  S C \S  = C \ S Insert cluster N into cluster C For set S let R S  be all states that can reach some state in S and R S  be all states that can be reached by some state in S C= (C  R R N ) ( R C R C ) Prune: Removes all empty and duplicate clusters Until no more starting fStates exist: Start fState s = new set of states with same transition probability to previous start state or goal Find circuit N including S Split each cluster C on CS Prune Macro-state (cluster) Goal State Sub-state Macro-policy Action Macro-action Micro-policy Hierarchical Markov Decision Process: M = {S, A, T, R} S: Clusters of states (macro-states) A: Macro actions between clusters G: Clusters containing goal states T: ?? R: ?? Solution: Hierarchical policy: Macro-level policy specifies next macro- state.  Micro-level policy specifies how to reach next macro-state Specifying MDPs: Enumerated State MDPs List out all states Algorithm polynomial in number of states Factored MDPs Specify boolean state variables n variables = 2 n  states Algorithm polynomial in number of state variables But! We know more about the structure Example: Grid world Results Results Enumerated States Domains: Grid world: 1040 states, 4 actions Factory: 1024 states, 10 actions Discretized Mountain Car: 1024, 3 actions Comparison Algorithms: Value iteration: Optimal solution HVI: Alternative hierarchical method HDet: Our algorithm Factored (Preliminary) Coffee domain: 6 variables, 4 actions Metric is accumulated reward Tire domain: 12 variables, 14 actions Metric is percent success *Optimal solution

Fast Approximate Hierarchical Solutions of MDPs

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Fast Approximate Hierarchical Solutions of MDPs

Fast Approximate Hierarchical Solutions of MDPsJenny Barry

Advisors: Leslie Kaelbling, Tomas Lozano­PerezMasterWorks 5/4/2009

Markov Decision Process:M = {S, A, T, R, G}S: The world is a finite number of statesA: Actions allow non­deterministic transitions among statesT: Function giving probability action transitions between two states R: Each state has a reward associated with itG: We must reach some goal state(s)Solution: Policy giving action for each state maximizing expected reward

The ProblemThe Problem

Space is BIG Everything affects everything

The scope varies

The world is uncertain

World Model: Hierarchical Markov World Model: Hierarchical Markov Decision Processes (MDPs)Decision Processes (MDPs)

ObjectivesObjectives

Create a solver for a hierarchical MDPTop­downEfficient method for calculating transitions/rewardsFast, semi­accurate solution for non­primitive levels

Clustering Algorithm: Works with solverCluster “near” statesEfficientAssure hierarchical policy  does not strand states

SolverSolverFast Upward Pass

Assume deterministic transitionsCalculate “cost” of moving between each stateC(i, j, a) = ­R(i, j, a)/T(i, j, a)Solve using shortest path algorithmCost between clusters = average cost

i jC(i, j) = 4/3

i jR(i, j, a) = ­1

T(i, j, a) = 0.75

Downward Pass

i policy[i]

in sub­MDP

sub­MDP goal

Given policy, create “sub­MDP” from i to policy[i]States in sub­MDP

All sub­states of i All sub­states of policy[i] reachable in one transition from i 

Goal states are states in policy[i]Upper level: solve for policy using shortest path among clustersPrimitive level: solve for policy using value iteration

ClusteringClustering

No “stranded” statesBad Clustering:

Can't reach goals

sub­MDP goal

in sub­MDPi

policy[i]

Guarantee: If any state in cluster i can reach a state in cluster j, all states in cluster i can reach a state in cluster j  

Enumerated StatesAgglomerative: state begins as its own clusterPre­process:

For each cluster add any states thatTransition into cluster, but not out Are adjacent to the cluster in both 

directionsUntil done (maximum cluster size or number):

Compute cluster adjacency matrixFind circuits in adjacency matrixCluster circuits

FactoredDivisive: All states start in same clusterCluster sets of states (fStates)Rule: f

1 and f

2 can be clustered together if all states in f

1 can reach some 

state in f2 and vice­versa

Operations:Split cluster C on cluster S creates

CS = C  S

C\S

 = C \ S

Insert cluster N into cluster CFor set S let R

→S be all states that can reach some state in S 

and R←S

 be all states that can be reached by some state in S

C←N = (C  R→N 

R←N) (N  R

→C R

←C)

Prune: Removes all empty and duplicate clustersUntil no more starting fStates exist:

Start fState s = new set of states with same transition probability to previous start state or goalFind circuit N including SSplit each cluster C on C←SPrune

Macro­state (cluster)

Goal State

Sub­state

Macro­policyAction

Macro­action

Micro­policy

Hierarchical Markov Decision Process:M = {S, A, T, R}S: Clusters of states (macro­states)A: Macro actions between clustersG: Clusters containing goal statesT: ?? R: ??Solution: Hierarchical policy: Macro­level policy specifies next macro­state.  Micro­level policy specifies how to reach next macro­state

Specifying MDPs:Enumerated State MDPs

List out all statesAlgorithm polynomial in number of states

Factored MDPsSpecify boolean state variables

n variables = 2n statesAlgorithm polynomial in number of state variablesBut! We know more about the structure

Example: Grid world

ResultsResultsEnumerated States

Domains:Grid world: 1040 states, 4 actionsFactory: 1024 states, 10 actionsDiscretized Mountain Car: 1024, 3 actions

Comparison Algorithms:Value iteration: Optimal solutionHVI: Alternative hierarchical methodHDet: Our algorithm

Factored (Preliminary)Coffee domain: 6 variables, 4 actions

Metric is accumulated rewardTire domain: 12 variables, 14 actions

Metric is percent success

*Optimal solution