|
QDpy
|
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. | |
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.
| 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.
| qdpy.rl.tree_map_elites.DecisionTreeMAPElites.evaluate | ( | self, | |
| env_factory, | |||
| policy, | |||
| * | , | ||
| episodes, | |||
| seed ) |
Audit one fitted policy on an independent reset stream.
| env_factory | Callable returning a new single Gymnasium environment. |
| policy | Fitted or reloaded decision tree to measure. |
| episodes | Number of complete greedy episodes. |
| seed | Explicit reset seed, separate from the archive scoring stream. |
Evaluate without changing search state or the repertoire.
Definition at line 262 of file tree_map_elites.py.
| qdpy.rl.tree_map_elites.DecisionTreeMAPElites.policy_for | ( | self, | |
| individual ) |
Restore a policy from one repertoire individual.
| individual | Stored 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.
| qdpy.rl.tree_map_elites.DecisionTreeMAPElites.run | ( | self, | |
| env_factory, | |||
| max_env_steps ) |
Train and score as many complete trees as fit the budget.
| env_factory | Callable returning a new single Gymnasium environment. |
| max_env_steps | Maximum additional calls to the environment's step method. |
Reserve the worst-case cost per candidate and charge actual steps.
Definition at line 234 of file tree_map_elites.py.
| qdpy.rl.tree_map_elites.DecisionTreeMAPElites.stats | ( | self | ) |
Return cumulative search costs.
Definition at line 144 of file tree_map_elites.py.