PFT-DPW

Particle Filter Tree with double progressive widening. PFT-DPW searches the belief MDP: a node is a particle belief, and stepping an action runs a full particle filter update to produce the child belief, which is then treated as a single state of the belief MDP. Because a node is a belief rather than a history, the reward at a node is the weighted mean over all its particles rather than the reward of one sampled state, at the cost of one filter update per simulation step.

Notes

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.pft_dpw import PFT_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 = PFT_DPW(
    environment=tiger,
    discount_factor=0.95,
    depth=5,
    name="ExamplePlanner",
    action_sampler=action_sampler,
    k_a=2.0,
    alpha_a=0.5,
    time_out_in_seconds=2.0,
)

belief = get_initial_belief(tiger, n_particles=10)
actions, run_data = planner.action(belief)

Parameters

class POMDPPlanners.planners.mcts_planners.pft_dpw.PFT_DPW(environment, discount_factor, depth, name, action_sampler, k_a=1.0, alpha_a=0.5, k_o=1.0, alpha_o=0.5, exploration_constant=1.0, 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: ArenaDoubleProgressiveWideningMCTSPolicy

PFT-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 = PFT_DPW(
...     environment=tiger,
...     discount_factor=0.95,
...     depth=5,
...     name="ExamplePlanner",
...     action_sampler=action_sampler,
...     k_a=2.0,
...     alpha_a=0.5,
...     n_simulations=10
... )
>>> planner.name
'ExamplePlanner'
>>>
>>> initial_belief = get_initial_belief(tiger, n_particles=10)
>>> actions, run_data = planner.action(initial_belief)
>>>
>>> space_info = PFT_DPW.get_space_info()
>>> space_info.action_space.name
'MIXED'
Parameters:
  • environment (Environment)

  • discount_factor (float)

  • depth (int)

  • name (str)

  • action_sampler (ActionSampler)

  • k_a (float)

  • alpha_a (float)

  • k_o (float)

  • alpha_o (float)

  • exploration_constant (float)

  • 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)