|
QDpy
|
Fit cosine-kernel PCA over symmetric prediction references and retain one elite per cell. More...
Public Member Functions | |
| archive (self) | |
| stats (self) | |
| run (self, evaluate, budget) | |
| Evaluate and project model batches on the fixed training panel. | |
| predict (self, predict, *, size=None) | |
| Average final elite predictions on a new dataset. | |
Fit cosine-kernel PCA over symmetric prediction references and retain one elite per cell.
Implement the semantic search of Zhang et al. with caller-defined model encodings. Fit a cosine-kernel projection using symmetric reference predictions around the target vector. Preserve the best fraction of offspring and incumbents before rebuilding the archive in the new coordinates. Evaluators should provide out-of-fold or other training-only predictions. Use held-out observations only for final comparison. :param targets: Supervised target vector in evaluator prediction order. :param sample: Callable (rng) returning a model genome iterable. :param mutate: Callable (genome, rng) returning an offspring genome. :param crossover: Optional callable (genome, donor, rng) returning a recombinant genome. :param crossover_probability: Probability of crossing before mutation when supplied. :param shape: Number of cells along each projected axis. :param population_size: Initial sample and offspring batch size. :param alpha: Reference displacement along the target-to-prediction vector. :param retain_fraction: Fraction of the merged pool considered for the new archive. :param maximize: Compare larger fitness when True and smaller fitness otherwise. :param seed: Seed for parent selection, variation, and model evaluation.
Definition at line 57 of file cosine_elites.py.
| qdpy.algorithms.cosine_elites.CosineMAPElites.archive | ( | self | ) |
Return the native Grid from the most recent fit. Its geometry can change at a rebuild.
Definition at line 101 of file cosine_elites.py.
| qdpy.algorithms.cosine_elites.CosineMAPElites.predict | ( | self, | |
| predict, | |||
| * | , | ||
| size = None ) |
Average final elite predictions on a new dataset.
| predict | Callable taking a genome and returning predictions on held-out data. |
| size | Optional maximum number of members, selected by training fitness. |
Keep held-out predictions outside the evolution loop.
Definition at line 171 of file cosine_elites.py.
| qdpy.algorithms.cosine_elites.CosineMAPElites.run | ( | self, | |
| evaluate, | |||
| budget ) |
Evaluate and project model batches on the fixed training panel.
| evaluate | Callable (genome, seed) returning (fitness, predictions) or None. |
| budget | Additional attempted model evaluations. |
Retain any incomplete batch so a later call continues the same trajectory.
Definition at line 145 of file cosine_elites.py.
| qdpy.algorithms.cosine_elites.CosineMAPElites.stats | ( | self | ) |
Return model evaluation and archive rebuild counts.
Definition at line 106 of file cosine_elites.py.