|
QDpy
|
Archive best measured candidates by their ordered closest landmarks. More...
Public Member Functions | |
| from_reference (cls, reference, distance, *, count, **kwargs) | |
| landmarks (self) | |
| cells (self) | |
| weights (self) | |
| index (self, descriptor) | |
| Map a descriptor to a tuple of landmark indices. | |
| add (self, genome, fitness, descriptor) | |
| Admit a measured elite and update cached weights. | |
Archive best measured candidates by their ordered closest landmarks.
Keep one elite per occupied landmark signature and cache elite distances.
:param landmarks: Ordered distinct immutable and hashable descriptors.
:param distance: Symmetric, finite dissimilarity, zero for equal points
and strictly positive for distinct points.
:param rank: Number of closest landmarks in each signature. Equal
distances are ordered by the supplied landmark order.
:param capacity: Maximum number of occupied signatures. If a new niche
would exceed it, evict the least magnitude-weighted candidate in
the expanded set, breaking ties by fitness and admission order.
:param maximize: Compare larger scalar fitness values as better.
Definition at line 87 of file magnitude.py.
| qdpy.algorithms.magnitude.MagnitudeArchive.add | ( | self, | |
| genome, | |||
| fitness, | |||
| descriptor ) |
Admit a measured elite and update cached weights.
Return whether the candidate filled or improved its niche.
Definition at line 179 of file magnitude.py.
| qdpy.algorithms.magnitude.MagnitudeArchive.cells | ( | self | ) |
Return a copy of the occupied signatures and their measured elites.
Definition at line 156 of file magnitude.py.
| qdpy.algorithms.magnitude.MagnitudeArchive.from_reference | ( | cls, | |
| reference, | |||
| distance, | |||
| * | , | ||
| count, | |||
| ** | kwargs ) |
Fit landmarks by trying magnitude-increasing swaps at a fixed kernel scale. Use the first count distinct descriptors as the initial set, then try each remaining descriptor in place of the least-weighted one. The ordered reference panel is consumed once and needs no fitness.
Definition at line 115 of file magnitude.py.
| qdpy.algorithms.magnitude.MagnitudeArchive.index | ( | self, | |
| descriptor ) |
Map a descriptor to a tuple of landmark indices.
Return the ordered indices of its rank nearest landmarks.
Definition at line 172 of file magnitude.py.
| qdpy.algorithms.magnitude.MagnitudeArchive.landmarks | ( | self | ) |
Return the fixed landmarks in tie-breaking order.
Definition at line 151 of file magnitude.py.
| qdpy.algorithms.magnitude.MagnitudeArchive.weights | ( | self | ) |
Return a copy of the unnormalized magnitude weights by signature.
Definition at line 161 of file magnitude.py.