QDpy
Loading...
Searching...
No Matches
qdpy.rl.refqd.RefQD Class Reference

Train one shared policy encoder and archive lightweight decision heads. More...

Public Member Functions

 stats (self)
 heads (self)
 encoder_version (self)
 parameter_bytes (self)
 train (self, max_env_steps)
 Spend an additional hard budget on offspring and archive refreshes.
 policy_for (self, cell, rank=0, *, device=None)
 Combine the current encoder and a selected head in an independent actor.
 audit (self, max_env_steps, *, seed=0)
 Measure the top heads using a separate seed and step budget.

Detailed Description

Train one shared policy encoder and archive lightweight decision heads.

Run RefQD with continuous Box actions and replay-based variation.

Reuse a caller's empty Grid or CVTGrid as reporting geometry. The
training archive stores ranked heads according to their last measured
returns. Periodic refreshes replace selected measurements using the
current shared encoder. Use audit() to measure current performance.

:param env_factory: Callable returning a fresh single environment.
:param archive: Empty, parentless, best-only reporting geometry.
:param descriptor: Function of a completed episode returning descriptor coordinates.
:param policy: ContinuousPolicy configuration with at least one hidden layer.
:param td3: Optional TD3Config.
:param depth: Maximum decision heads in each cell.
:param refresh_top: Number of highest-ranked heads to reevaluate per occupied cell.
:param refresh_every: Number of generations between re-evaluations.
:param batch_size: Offspring per generation.
:param critic_steps: TD3 updates per eligible generation.
:param pg_steps: Updates for each gradient offspring.
:param pg_learning_rate: Adam step size for gradient offspring.
:param encoder_decay: Per-generation multiplier for the encoder learning rate.
:param max_episode_steps: Hard horizon for one evaluation.
:param seed: Local root random seed.
:param device: CPU or CUDA for policy and learner networks.

Definition at line 103 of file refqd.py.

Member Function Documentation

◆ audit()

qdpy.rl.refqd.RefQD.audit ( self,
max_env_steps,
* ,
seed = 0 )

Measure the top heads using a separate seed and step budget.

Return a fresh grid of measured results without changing training state.

Definition at line 298 of file refqd.py.

◆ encoder_version()

qdpy.rl.refqd.RefQD.encoder_version ( self)
Return the version shared by candidates in the current generation.

Definition at line 189 of file refqd.py.

◆ heads()

qdpy.rl.refqd.RefQD.heads ( self)
Read an immutable snapshot of the ranked heads in occupied cells.

Definition at line 184 of file refqd.py.

◆ parameter_bytes()

qdpy.rl.refqd.RefQD.parameter_bytes ( self)
Count the encoder once and the stored float32 decision vectors.

Definition at line 194 of file refqd.py.

◆ policy_for()

qdpy.rl.refqd.RefQD.policy_for ( self,
cell,
rank = 0,
* ,
device = None )

Combine the current encoder and a selected head in an independent actor.

Reconstruct a policy that can be saved with ContinuousPolicy.save().

Definition at line 290 of file refqd.py.

◆ stats()

qdpy.rl.refqd.RefQD.stats ( self)
Snapshot training counters, including the TD3 updates.

Definition at line 178 of file refqd.py.

◆ train()

qdpy.rl.refqd.RefQD.train ( self,
max_env_steps )

Spend an additional hard budget on offspring and archive refreshes.

Return cumulative stats. A budget-cut refresh leaves the archive intact.

Definition at line 260 of file refqd.py.


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