QDpy
Loading...
Searching...
No Matches
qdpy.algorithms.policy_manifold.PolicyManifoldSearch Class Reference

Mutate well-reconstructed policies in a learned latent space. More...

Inheritance diagram for qdpy.algorithms.policy_manifold.PolicyManifoldSearch:
qdpy.algorithms.modern._FixedGeneration qdpy.algorithms.base.QDAlgorithm qdpy.algorithms.base.QDAlgorithmLike qdpy.base.Summarisable qdpy.base.Saveable qdpy.base.Copyable qdpy.base.CreatableFromConfig

Public Member Functions

 reinit (self)
 model_fits (self)
 model_fit_seconds (self)
 operator_counts (self)
Public Member Functions inherited from qdpy.algorithms.modern._FixedGeneration
 current_iter (self)
 ask (self)
 ask_batch (self, size=None)
 Issue one manual generation in proposal order.
 tell_batch (self, results)
 Apply results from the outstanding manual generation.
 optimise (self, *args, **kwargs)
Public Member Functions inherited from qdpy.algorithms.base.QDAlgorithm
Union[str, Sequence[float]] optimisation_task (self)
None optimisation_task (self, Union[str, Sequence[float]] optimisation_task)
int nb_suggestions (self)
int nb_suggestions_in_iteration (self)
int nb_evaluations (self)
int nb_evaluations_in_iteration (self)
int nb_updated (self)
int nb_updated_in_iteration (self)
int batch_size (self)
Union[int, float] nb_max_iter (self)
None tell_container_entries (self, Optional[Container] cont=None)
IndividualLike best (self)
None add_callback (self, str event, Callable fn)
Public Member Functions inherited from qdpy.base.Summarisable
Mapping[str, Any] __get_summary_state__ (self)
str summary (self, Optional[int] max_depth=None, Optional[int] max_entry_length=250)
Public Member Functions inherited from qdpy.base.Saveable
Mapping[str, Any] __get_saved_state__ (self)
None save (self, str output_path, str output_type="pickle")
Public Member Functions inherited from qdpy.base.CreatableFromConfig
Any from_config (cls, Mapping[str, Any] config, **Any kwargs)

Protected Member Functions

 _start_fixed_batch (self, size)
 _internal_ask (self, base_ind)
 _commit_generation (self, evaluated)
Protected Member Functions inherited from qdpy.algorithms.modern._FixedGeneration
 _offer_to_grid (self, individual, cell)
 _receive_fixed_batch (self, records, verbose, batch_start_time)
Protected Member Functions inherited from qdpy.algorithms.base.QDAlgorithm
 _check_archive_weights (self)
None _attach_evaluation (self, ind, fitness, features, scores, elapsed)
Tuple[MutableMapping[str, Any], bool] _tell_before_container_update (self, IndividualLike individual)
 Read pre-admission state for optimiser feedback.
None _tell_after_container_update (self, IndividualLike individual, bool added, Mapping[str, Any] xattr={})
 Account for a completed tell and send feedback.
None _internal_tell (self, IndividualLike individual, bool added_to_container, Mapping[str, Any] xattr={})
IndividualLike _internal_best (self)
bool _verify_if_finished_iteration (self, float batch_start_time)
None _transfer_suggestion (self, IndividualLike individual, IndividualLike evaluated)
 Transfer coordinator-side metadata when evaluation returns a new object.
 _fixed_batch_plan (self, size, evaluate, packed)

Detailed Description

Mutate well-reconstructed policies in a learned latent space.

Bounded Policy Manifold Search (PoMS) using a native best-only grid.

Fit a deterministic autoencoder periodically on the occupied elite
vectors. For a parent at or below the mean reconstruction error at the
last fit, draw a Gaussian in normalized parameter coordinates and
multiply it by the transpose of the decoder Jacobian. Add this
perturbation to the parent's latent code and decode the result.
Less well-reconstructed parents receive direct parameter mutation.

:param container: Best-only scalar Grid or CVTGrid.
:param budget: Total attempted candidate evaluations.
:param dimension: Number of bounded real coordinates in each policy vector.
:param ind_domain: Shared finite lower and upper bounds.
:param batch_size: Maximum candidates in one generation.
:param latent_size: Size of the autoencoder bottleneck.
:param hidden_size: Width of the encoder and decoder hidden layers.
:param min_elites: Minimum measured archive size before fitting.
:param fit_interval: Minimum number of generations between refits.
:param fit_epochs: Number of archive passes per fit.
:param fit_batch_size: Maximum number of training rows per update.
:param learning_rate: Positive Adam learning rate.
:param sigma: Gaussian standard deviation in normalized [0, 1] coordinates.
:param seed: Seed for initialization, parent selection and fitting.
:param device: PyTorch CPU or CUDA device.
:param kwargs: Native algorithm options such as optimisation_task.

Archive admission uses scalar fitness. For an exploration-only
objective, return the same fitness in every niche.

Definition at line 93 of file policy_manifold.py.

Member Function Documentation

◆ _commit_generation()

qdpy.algorithms.policy_manifold.PolicyManifoldSearch._commit_generation ( self,
evaluated )
protected
Offer validated measurements to a native grid in proposal order.

Reimplemented from qdpy.algorithms.modern._FixedGeneration.

Definition at line 218 of file policy_manifold.py.

◆ _internal_ask()

qdpy.algorithms.policy_manifold.PolicyManifoldSearch._internal_ask ( self,
base_ind )
protected
Internal ask method. To be implemented by subclasses.

Parameters
----------
:param base_ind: IndividualLike
    The base (empty) individual object. The `_internal_ask` method must change
    this object, by filling out the genome and providing other information.

Returns
-------
out: IndividualLike
    The suggested individual.

Reimplemented from qdpy.algorithms.base.QDAlgorithm.

Definition at line 211 of file policy_manifold.py.

◆ _start_fixed_batch()

qdpy.algorithms.policy_manifold.PolicyManifoldSearch._start_fixed_batch ( self,
size )
protected
Prepare a generation for an optimiser that opts into batch feedback.

Reimplemented from qdpy.algorithms.modern._FixedGeneration.

Definition at line 177 of file policy_manifold.py.

◆ model_fit_seconds()

qdpy.algorithms.policy_manifold.PolicyManifoldSearch.model_fit_seconds ( self)
Return wall-clock time spent fitting the autoencoder and measuring training error.

Definition at line 168 of file policy_manifold.py.

◆ model_fits()

qdpy.algorithms.policy_manifold.PolicyManifoldSearch.model_fits ( self)
Return the number of completed archive autoencoder fits.

Definition at line 163 of file policy_manifold.py.

◆ operator_counts()

qdpy.algorithms.policy_manifold.PolicyManifoldSearch.operator_counts ( self)
Return attempted proposals by random, parameter, or latent variation.

Definition at line 173 of file policy_manifold.py.

◆ reinit()

qdpy.algorithms.policy_manifold.PolicyManifoldSearch.reinit ( self)
Reset model state and diagnostics while retaining the reporting archive.

Reimplemented from qdpy.algorithms.modern._FixedGeneration.

Definition at line 146 of file policy_manifold.py.


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