QDpy
Loading...
Searching...
No Matches
qdpy.rl.qdpg.QDPG Class Reference

Illuminate a bounded continuous control archive with two policy gradients. More...

Inheritance diagram for qdpy.rl.qdpg.QDPG:
qdpy.rl.search.NeuralMAPElites

Public Member Functions

 stats (self)
Public Member Functions inherited from 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.
 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.

Detailed Description

Illuminate a bounded continuous control archive with two policy gradients.

Train half the generation toward task return and half toward state novelty.

Each objective has a separate pair of shared critics. The algorithm
clones elites, fits both critic pairs on a single shared replay buffer,
and varies each clone with its assigned gradient. It evaluates every
proposal in the environment. Episode descriptors select archive cells,
and raw episodic return or the supplied fitness ranks the candidates.

:param env_factory: Factory for a single Gymnasium environment with bounded
    floating-point Box actions.
:param archive: Best-only QDpy Grid or CVTGrid as in :class:`NeuralMAPElites`.
:param state_descriptor: Callable taking the pre-action non-flattened
    float32 observation and its reset or step info. Return a finite 1-D
    vector with the same number of coordinates as the episode descriptor.
    Use state coordinates that have a meaningful relation to the episode
    descriptor, such as current position and final position.
:param td3: Optional :class:`TD3Config` for the replay and twin critics.
    QD-PG uses SGD and draws replay batches with replacement.
    ``learning_starts`` can extend the random-policy warmup.
:param population_size: Even number of proposals per generation. Unless
    overridden, also the number of initial random policies.
:param gradient_steps_ratio: Optimizer rounds per objective are the floor
    of this ratio times the number of transitions collected since the
    start of the previous generation.
:param novelty_capacity: Maximum number of admitted timestep descriptors.
:param novelty_neighbors: Number of nearest neighbors used in the mean.
:param novelty_threshold: An arrival must score strictly above this
    threshold to enter the novelty archive. The first arrival is accepted.
:param novelty_metric: Optional pairwise distance function. Takes query
    rows and archive rows, and returns a nonnegative (queries, archive)
    distance matrix. Defaults to Euclidean distance.
:param kwargs: Evaluation and policy options for :class:`NeuralMAPElites`.

Definition at line 172 of file qdpg.py.

Member Function Documentation

◆ stats()

qdpy.rl.qdpg.QDPG.stats ( self)
Return cumulative training costs, operator counts, and buffer sizes.

Reimplemented from qdpy.rl.search.NeuralMAPElites.

Definition at line 247 of file qdpg.py.


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