POMCP-DPW
POMCP with double progressive widening. The number of action children and the
number of observation children of a node are both capped by k * n**alpha,
where n is the node’s visit count. A node therefore gets more children
only as its visit count grows, so later simulations revisit existing children
and reach deeper levels instead of each opening a new child. That matters when
the action or observation space is large or continuous.
Beliefs stay unweighted particle sets, as in POMCP. For weighted particles, use POMCPOW.
Notes
Original paper: Sunberg, Z. N., & Kochenderfer, M. J. (2018). Online Algorithms for POMDPs with Continuous State, Action, and Observation Spaces. ICAPS 28(1), 259-263. https://ojs.aaai.org/index.php/ICAPS/article/view/13882
k_a/alpha_acontrol action widening,k_o/alpha_oobservation widening.alpha = 0freezes a branch atkchildren.Needs an
action_sampler; with a discrete environment that isDiscreteActionSampler(env.get_actions()).
Can I use?
Discrete |
Continuous |
|
|---|---|---|
State |
✔️ |
✔️ |
Action |
✔️ |
✔️ |
Observation |
✔️ |
✔️ |
Also supports |
|
|---|---|
Cost constraints |
❌ |
GPU |
❌ |
Example
import numpy as np
from POMDPPlanners.core.belief import get_initial_belief
from POMDPPlanners.environments.tiger_pomdp import TigerPOMDP
from POMDPPlanners.planners.mcts_planners.pomcp_dpw import POMCP_DPW
from POMDPPlanners.utils.action_samplers import DiscreteActionSampler
np.random.seed(42)
tiger = TigerPOMDP(discount_factor=0.95)
action_sampler = DiscreteActionSampler(tiger.get_actions())
planner = POMCP_DPW(
environment=tiger,
discount_factor=0.95,
depth=5,
exploration_constant=1.0,
k_o=3.0,
k_a=3.0,
alpha_o=0.5,
alpha_a=0.5,
action_sampler=action_sampler,
time_out_in_seconds=2.0,
name="ExamplePlanner",
)
belief = get_initial_belief(tiger, n_particles=10)
actions, run_data = planner.action(belief)
Parameters
- class POMDPPlanners.planners.mcts_planners.pomcp_dpw.POMCP_DPW(environment, discount_factor, depth, exploration_constant, k_o, k_a, alpha_o, alpha_a, name, action_sampler, time_out_in_seconds=None, n_simulations=None, min_visit_count_per_action=1, reserve_capacity=0, log_path=None, debug=False, use_queue_logger=False)[source]
Bases:
ArenaDoubleProgressiveWideningMCTSPolicyPOMCP_DPW operating on the arena
Tree+ integer node IDs.See module docstring for algorithm details and reference.
Example
>>> import numpy as np >>> from POMDPPlanners.environments.tiger_pomdp import TigerPOMDP >>> from POMDPPlanners.core.belief import get_initial_belief >>> from POMDPPlanners.utils.action_samplers import DiscreteActionSampler >>> np.random.seed(42) >>> >>> tiger = TigerPOMDP(discount_factor=0.95) >>> action_sampler = DiscreteActionSampler(tiger.get_actions()) >>> planner = POMCP_DPW( ... environment=tiger, ... discount_factor=0.95, ... depth=5, ... exploration_constant=1.0, ... k_o=3.0, ... k_a=3.0, ... alpha_o=0.5, ... alpha_a=0.5, ... action_sampler=action_sampler, ... n_simulations=10, ... name="ExamplePlanner" ... ) >>> planner.name 'ExamplePlanner' >>> >>> initial_belief = get_initial_belief(tiger, n_particles=10) >>> actions, run_data = planner.action(initial_belief) >>> >>> space_info = POMCP_DPW.get_space_info() >>> space_info.action_space.name 'MIXED'
- Parameters:
environment (Environment)
discount_factor (float)
depth (int)
exploration_constant (float)
k_o (float)
k_a (float)
alpha_o (float)
alpha_a (float)
name (str)
action_sampler (ActionSampler)
time_out_in_seconds (int | None)
n_simulations (int | None)
min_visit_count_per_action (int)
reserve_capacity (int)
log_path (Path | None)
debug (bool)
use_queue_logger (bool)