|
QDpy
|
Illuminate a fixed QDpy archive by evaluating and mutating neural policies. More...
Public Member Functions | |
| stats (self) | |
| train (self, max_env_steps, *, evaluation_batch_size=1, budget_aware=False) | |
| Spend an additional hard step budget on policy search. | |
| policy_for (self, individual, *, device=None, seed=0) | |
| Rebuild an independent inference actor from an archived genome. | |
| best_policy (self, *, device=None, seed=0) | |
| Rebuild the best archived actor for inference or export. | |
Illuminate a fixed QDpy archive by evaluating and mutating neural policies.
Search for high-return policies with different measured behaviour.
Random Torch initializations fill the initial archive. Later offspring
use Iso+LineDD without clipping network weights. All policies use the
same architecture, and the archive owns copies of their flat genomes.
:param env_factory: Callable returning a fresh Gymnasium environment.
:param archive: Empty, parentless, best-only Grid or CVTGrid with one
fitness objective. If set, its fitness weight must be positive.
:param descriptor: Map a completed :class:`Episode` to a descriptor vector.
:param fitness: Optional function of a completed episode. Defaults to return.
:param policy: Actor architecture as a :class:`PolicyConfig`.
:param evaluation_episodes: Average this many complete episodes per policy.
:param initial_policies: Number of evaluated random policies before variation.
:param iso_sigma: Independent Iso+LineDD noise scale.
:param line_sigma: Shared Iso+LineDD noise scale.
:param max_episode_steps: Per-episode safety horizon.
:param seed: Nonnegative seed for selection, initialization, and resets.
:param device: Torch CPU or CUDA device.
:param on_step: Optional callable receiving the archive and a frozen
snapshot of cumulative stats after each completed candidate evaluation.
| qdpy.rl.search.NeuralMAPElites.best_policy | ( | self, | |
| * | , | ||
| device = None, | |||
| seed = 0 ) |
| qdpy.rl.search.NeuralMAPElites.policy_for | ( | self, | |
| individual, | |||
| * | , | ||
| device = None, | |||
| seed = 0 ) |
Rebuild an independent inference actor from an archived genome.
Decode a candidate using this search's observation and action layout.
Reimplemented in qdpy.rl.bfm_qd.BFMQD, and qdpy.rl.gene_map_elites.GENEMAPElites.
| qdpy.rl.search.NeuralMAPElites.stats | ( | self | ) |
Return immutable cumulative step and candidate counts.
Reimplemented in qdpy.rl.adaptive_pga.AdaHOME, qdpy.rl.adaptive_pga.PGAAURORA, qdpy.rl.ascii_me.ASCIIME, qdpy.rl.bfm_qd.BFMQD, qdpy.rl.brpg.BRPGMAPElites, qdpy.rl.cma_mega.CMAMEGATD3ES, qdpy.rl.descriptor_search._DescriptorMAPElites, qdpy.rl.dynamics_aware.DynamicsAwareQD, qdpy.rl.gda_qd.GDAQD, qdpy.rl.madecm.MADECM, qdpy.rl.masqd.MASQD, qdpy.rl.miqd.MIQD, qdpy.rl.mome_p2c.MOMEP2C, qdpy.rl.mome_pgx.MOMEPGX, qdpy.rl.pbt.PBTMAPElites, qdpy.rl.pga.PGAMAPElites, qdpy.rl.ppga.PPGA, qdpy.rl.qdpg.QDPG, qdpy.rl.reset_free_qd.ResetFreeQD, qdpy.rl.sv_qd.SVQDRL, and qdpy.rl.wqdil.WQDIL.
| qdpy.rl.search.NeuralMAPElites.train | ( | self, | |
| max_env_steps, | |||
| * | , | ||
| evaluation_batch_size = 1, | |||
| budget_aware = False ) |
Spend an additional hard step budget on policy search.
| max_env_steps | Additional environment transitions allowed in this call. |
| evaluation_batch_size | Maximum number of policies evaluated together. |
| budget_aware | Reserve complete episodes when choosing each batch's width. |
Return cumulative stats. A budget-cut candidate cannot enter the archive. The optional batch size groups proposals before feedback and batches actor inference across independent local environments. Only plain NeuralMAPElites supports this mode. Proposals in a batch use the same archive state and complete feedback is applied in proposal order. Step callbacks see the consumed steps for the batch as its feedback is applied. With ``budget_aware=True``, the width is a ceiling. Reduce it to reserve the worst-case steps for every episode of each policy. When the remaining budget cannot reserve one complete policy, advance one policy at a time until the budget is spent.
Reimplemented in qdpy.rl.cma_mega.CMAMEGATD3ES, qdpy.rl.descriptor_search._DescriptorMAPElites, qdpy.rl.dynamics_aware.DynamicsAwareQD, qdpy.rl.madecm.MADECM, qdpy.rl.masqd.MASQD, qdpy.rl.mome_p2c._ParetoPolicySearch, qdpy.rl.mome_pgx.MOMEPGX, qdpy.rl.pbt.PBTMAPElites, qdpy.rl.ppga.PPGA, qdpy.rl.reset_free_qd.ResetFreeQD, and qdpy.rl.sv_qd.SVQDRL.