QDpy
Loading...
Searching...
No Matches
qdpy.containers.archives.SelfAdaptiveNoveltyArchive Class Reference

Scale the novelty threshold from a bounded sample of parent history. More...

Inheritance diagram for qdpy.containers.archives.SelfAdaptiveNoveltyArchive:
qdpy.containers.archives.NoveltyArchive qdpy.containers.base.Container qdpy.containers.base.ContainerLike qdpy.base.Summarisable qdpy.base.Copyable qdpy.base.CreatableFromConfig

Public Member Functions

float recompute_threshold (self)
 Update the threshold from the largest sampled descriptor distance.
Public Member Functions inherited from qdpy.containers.archives.NoveltyArchive
 __getstate__ (self)
 Omit the transient search index from result files.
Public Member Functions inherited from qdpy.containers.base.Container
float capacity (self)
float free (self)
int size (self)
Any best (self)
Optional[FitnessLike] best_fitness (self)
Optional[FeaturesLike] best_features (self)
int nb_discarded (self)
int nb_added (self)
int nb_rejected (self)
int nb_operations (self)
Optional[Sequence[DomainLike]] fitness_extrema (self)
Optional[Sequence[DomainLike]] features_extrema (self)
Sequence[IndividualLike] all_parents_inds (self)
str size_str (self)
bool in_bounds (self, Any val, Any domain)
FeaturesLike get_ind_features (self, IndividualLike individual, *args, **kwargs)
FitnessLike get_ind_fitness (self, IndividualLike individual, *args, **kwargs)
 set_ind_fitness (self, IndividualLike individual, FitnessLike fitness, *args, **kwargs)
Optional[int] add (self, IndividualLike individual, bool raise_if_not_added_to_parents=False)
None discard (self, IndividualLike individual, bool also_from_parents=False)
int update (self, Iterable iterable, bool ignore_exceptions=True, bool issue_warning=False)
None clear (self, bool also_from_parents=False)
None clear_all (self)
 novelty (self, IndividualLike individual, **kwargs)
 novelty_local_competition (self, IndividualLike individual, **kwargs)
Any to_grid (self, Union[ShapeLike, int] shape, int max_items_per_bin=1, Optional[float] capacity=None, **Any kwargs)
float qd_score (self, bool normalized=True)
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.CreatableFromConfig
Any from_config (cls, Mapping[str, Any] config, **Any kwargs)

Protected Member Functions

 _recompute_threshold (self, parents)
 Limit pairwise-distance memory by scanning blocks of rows.
 _admission_neighbours (self, individual, parents)
 Update the threshold before a scheduled admission query.
Protected Member Functions inherited from qdpy.containers.archives.NoveltyArchive
Optional[int] _add_internal (self, IndividualLike individual, bool raise_if_not_added_to_parents, bool only_to_parents)
 Apply the novelty gate or compare the nearest reference fitness.
Protected Member Functions inherited from qdpy.containers.base.Container
Optional[Sequence[DomainLike]] _float_feature_extrema (self)
Tuple[bool, int] _add_to_collection (self, BackendLike[IndividualLike] collection, IndividualLike individual)
None _check_if_can_be_added (self, IndividualLike individual)
None _add_to_parents (self, IndividualLike individual, bool require_admission)
 Forward a candidate to each immediate parent in order.
 _can_undo_parent_appends (self, individual)
 _add_to_append_only_parents (self, individual)
 Take a short pre-admission record and rebuild a snapshot only after rejection.
 _snapshot_parents (self)
None _discard_by_index (self, IndividualLike individual, Optional[int] idx=None, bool also_from_parents=False)

Detailed Description

Scale the novelty threshold from a bounded sample of parent history.

Re-estimate an NSLC novelty threshold as the reference set grows.

Use the sampled Euclidean diameter divided by the square root of
``k_resolution``, floored by ``min_threshold``. The initial threshold is
used until two parent entries are available. Recompute before every
``threshold_update_period``-th valid local query. The default Euclidean
admission rule and parent replacement semantics still apply.

:param k_resolution: Positive scale parameter for the diameter heuristic.
:param threshold_update_period: Valid query count between updates. Zero disables them.
:param max_threshold_samples: Maximum number of parents used in a diameter estimate.
:param min_threshold: Lower bound for the computed threshold.
:param seed: Seed for sampling parents, independent of the search RNG.

Definition at line 177 of file archives.py.

Member Function Documentation

◆ recompute_threshold()

float qdpy.containers.archives.SelfAdaptiveNoveltyArchive.recompute_threshold ( self)

Update the threshold from the largest sampled descriptor distance.

Returns
The current threshold, retained when there are fewer than two parents.
Recompute the threshold from the current parent archive.

Definition at line 215 of file archives.py.


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