QDpy
Loading...
Searching...
No Matches
qdpy.rl.bfm_qd.BFMQD Class Reference

Run MAP-Elites over a pretrained controller's latent sphere. More...

Inheritance diagram for qdpy.rl.bfm_qd.BFMQD:
qdpy.rl.search.NeuralMAPElites

Public Member Functions

 stats (self)
 policy_for (self, individual, *, device=None, seed=0)
 Bind an archived latent code to this search's frozen controller.
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.
 best_policy (self, *, device=None, seed=0)
 Rebuild the best archived actor for inference or export.

Detailed Description

Run MAP-Elites over a pretrained controller's latent sphere.

Behavioral Foundation Models for QD following Bendib et al. (2026 preprint).

The same frozen controller evaluates every candidate. Gaussian and
optional backward-inference variation propose latent codes that are
projected back onto the sphere. The archive stores codes and measured
returns and descriptors. Training the controller is a separate stage.

:param env_factory: Factory for a single Gymnasium environment.
:param archive: Empty scalar one-elite Grid or CVTGrid.
:param controller: Deterministic function of (observation, latent_code)
    returning an action in the environment's original space.
:param descriptor: Function of a completed Episode returning the descriptor.
:param latent_size: Dimension of the supplied controller's latent space.
:param radius: Latent sphere radius, default square root of latent_size.
:param backward_features: Optional frozen function of successor
    observation returning one backward feature per latent coordinate.
    The replay estimator uses the observed reward for that transition.
:param backward_probability: Probability of directed variation.
    Defaults to 0.5 with backward features and zero otherwise.
:param backward_step: Interpolation fraction toward the inferred code.
:param replay_capacity: Maximum number of observed feature-reward pairs.
:param backward_batch_size: Number of replay pairs sampled per estimate.
:param kwargs: Native evaluation and seed settings. A nonzero line_sigma
    opts into Iso+LineDD. The default Gaussian iso_sigma is 1.

Definition at line 75 of file bfm_qd.py.

Member Function Documentation

◆ policy_for()

qdpy.rl.bfm_qd.BFMQD.policy_for ( self,
individual,
* ,
device = None,
seed = 0 )

Bind an archived latent code to this search's frozen controller.

Return an independent code binding using the existing inference function.

Reimplemented from qdpy.rl.search.NeuralMAPElites.

Definition at line 192 of file bfm_qd.py.

◆ stats()

qdpy.rl.bfm_qd.BFMQD.stats ( self)
Return cumulative real evaluation statistics.

Reimplemented from qdpy.rl.search.NeuralMAPElites.

Definition at line 136 of file bfm_qd.py.


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