QDpy
Loading...
Searching...
No Matches
qdpy.rl.ssd.SSD Class Reference

Discover controllable skills with a population of continuous-action SAC species. More...

Public Member Functions

 stats (self)
 train (self, max_env_steps)
 Collect reward-free replay and update the shared contrastive model.
 policy (self, species, *, device=None, seed=0)
 Copy a portable species actor with fresh inference randomness.
 evaluate (self, *, episodes=1, descriptor=None, archive=None, seed=0)
 Audit every species on common seeded resets independently of training.

Detailed Description

Discover controllable skills with a population of continuous-action SAC species.

Use jointly classified species-skill pairs and a shared particle exploration reward.

Each species has a separate actor, critics and replay buffer. A shared
contrastive encoder scores successor observations against all learned
species-skill prototypes. Its joint log likelihood decomposes into
skill and conditional species log likelihoods. A nearest-particle
bonus encourages visitation of underrepresented states.

This implementation uses discrete skills, Gymnasium Box observations
and Box actions. A new episode holds one skill fixed throughout.
Each call visits species in round-robin order and can spend its full
interaction budget. A cutoff contributes the measured transitions
to replay and the next call starts a fresh episode.

:param env_factory: Callable returning a fresh Gymnasium environment.
:param config: SSDConfig for intrinsic rewards and speciation.
:param sac: SACConfig shared by the independent learners.
:param policy: PolicyConfig for the actors.
:param max_episode_steps: Horizon for collection and independent evaluation.
:param seed: Private search and reset seed.
:param device: PyTorch device.

Definition at line 153 of file ssd.py.

Member Function Documentation

◆ evaluate()

qdpy.rl.ssd.SSD.evaluate ( self,
* ,
episodes = 1,
descriptor = None,
archive = None,
seed = 0 )

Audit every species on common seeded resets independently of training.

Parameters
episodesNumber of audit episodes per skill.
descriptorOptional callable mapping an episode to behavior coordinates.
archiveOptional Grid or CVTGrid to use as audit geometry.
seedReset-panel seed.
Returns
A tuple of SkillDiscoveryAudit records, one for each species.
Use the standard skill audit with one result per species.

Definition at line 272 of file ssd.py.

◆ policy()

qdpy.rl.ssd.SSD.policy ( self,
species,
* ,
device = None,
seed = 0 )

Copy a portable species actor with fresh inference randomness.

Parameters
speciesZero-based species index.
deviceOptional device for the independent actor.
seedSeed for stochastic inference.
Returns
SSDPolicy.
Copy one actor. Save it with SSDPolicy.save.

Definition at line 254 of file ssd.py.

◆ stats()

qdpy.rl.ssd.SSD.stats ( self)
Return cumulative costs, including prefixes of unfinished episodes.

Definition at line 203 of file ssd.py.

◆ train()

qdpy.rl.ssd.SSD.train ( self,
max_env_steps )

Collect reward-free replay and update the shared contrastive model.

Parameters
max_env_stepsAdditional hard environment step cap.
Returns
Cumulative SSDStats.
Train on intrinsic rewards and return cumulative accounting.

Definition at line 214 of file ssd.py.


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