QDpy
Loading...
Searching...
No Matches
qdpy.rl.tree_map_elites.DecisionTreeMAPElites Class Reference

Optimize decision-tree structure and learn actions at the leaves. More...

Public Member Functions

 stats (self)
 best_policy (self)
 policy_for (self, individual)
 Restore a policy from one repertoire individual.
 run (self, env_factory, max_env_steps)
 Train and score as many complete trees as fit the budget.
 evaluate (self, env_factory, policy, *, episodes, seed)
 Audit one fitted policy on an independent reset stream.

Detailed Description

Optimize decision-tree structure and learn actions at the leaves.

Evolve split structures and fit fresh action values for each structure.

Train on seeded epsilon-greedy episodes, then place the greedy policy
by tree depth and action entropy measured on fixed scoring episodes.
Use evaluate for a separate audit on new resets. The reward-only
control retains the same reporting grid and mutates its best policy
across all cells. The default selects a uniform occupied cell.

:param observation_bounds: Finite (low, high) threshold interval per flattened coordinate.
:param max_depth: Maximum split depth, up to 12.
:param entropy_bins: Grid resolution on the normalized action entropy axis.
:param train_episodes: Q-learning episodes per proposed tree.
:param evaluation_episodes: Fixed greedy scoring episodes per tree.
:param max_episode_steps: Hard limit on steps per training or scoring episode.
:param epsilon: Exploration probability for the leaf learner.
:param learning_rate: Tabular Q-learning step size.
:param gamma: Future reward discount. Truncation permits bootstrapping.
:param restart_probability: Probability of generating a fresh structure from scratch.
:param selection: "archive" for MAP-Elites or "quality" for the reward-only control.
:param seed: Private seed for structure, tabular training, and scoring streams.

Definition at line 88 of file tree_map_elites.py.

Member Function Documentation

◆ best_policy()

qdpy.rl.tree_map_elites.DecisionTreeMAPElites.best_policy ( self)
Return the highest-scoring policy currently in the grid.

Definition at line 149 of file tree_map_elites.py.

◆ evaluate()

qdpy.rl.tree_map_elites.DecisionTreeMAPElites.evaluate ( self,
env_factory,
policy,
* ,
episodes,
seed )

Audit one fitted policy on an independent reset stream.

Parameters
env_factoryCallable returning a new single Gymnasium environment.
policyFitted or reloaded decision tree to measure.
episodesNumber of complete greedy episodes.
seedExplicit reset seed, separate from the archive scoring stream.
Returns
TreeEvaluation including the separately charged audit step count.
Evaluate without changing search state or the repertoire.

Definition at line 262 of file tree_map_elites.py.

◆ policy_for()

qdpy.rl.tree_map_elites.DecisionTreeMAPElites.policy_for ( self,
individual )

Restore a policy from one repertoire individual.

Parameters
individualStored grid individual produced by the search.
Read the fitted tree from the individual's genome.

Definition at line 157 of file tree_map_elites.py.

◆ run()

qdpy.rl.tree_map_elites.DecisionTreeMAPElites.run ( self,
env_factory,
max_env_steps )

Train and score as many complete trees as fit the budget.

Parameters
env_factoryCallable returning a new single Gymnasium environment.
max_env_stepsMaximum additional calls to the environment's step method.
Returns
Cumulative TreeSearchStats with separate training and evaluation costs.
Reserve the worst-case cost per candidate and charge actual steps.

Definition at line 234 of file tree_map_elites.py.

◆ stats()

qdpy.rl.tree_map_elites.DecisionTreeMAPElites.stats ( self)
Return cumulative search costs.

Definition at line 144 of file tree_map_elites.py.


The documentation for this class was generated from the following file: