Solver repair, repertoire selection, and cross-component search¶

The first three methods use the base installation. QDHUAC uses qdpy[rl]. The Solver repair, repertoire selection, and cross-component search page compares repair budgets, live trials, coherence calls, and learner updates on four small CPU tasks.

Solver-repaired MAP-Elites¶

Use BinaryMILPRepair when a decision is a binary vector and the feasible region has linear constraints. The solver minimizes the number of bits changed. Equalities enforce exact counts, and inequalities can bound resources or exclude combinations of bits.

from scipy.optimize import LinearConstraint
from qdpy.algorithms import BinaryMILPRepair, RepairedMAPElites
from qdpy.containers import Grid

constraints = LinearConstraint([[1, 1, 1, 1], [1, 1, 0, 0]],
                               [2, 0], [2, 1])
repair = BinaryMILPRepair(4, constraints)
archive = Grid(shape=(3,), features_domain=((0., 1.),),
               fitness_domain=((0., 5.),), fitness_weights=(1.,))

def evaluate(bits):
    quality = sum((i + 1) * bit for i, bit in enumerate(bits)) / 2.
    return (quality,), (sum(bits[:2]) / 2.,)

search = RepairedMAPElites(archive, repair, seed=7)
stats = search.run(evaluate, budget=8, repair_budget=40)
print(stats.evaluations, stats.repair_calls, stats.duplicate_repairs)

The same binary design can result from several proposals. The search tracks attempted repaired genomes across calls and skips repeats. Set both budgets when the feasible space is small or heavily constrained. A failed repair consumes one solver call. Configure time_limit or node_limit for individual solves. With accept_incumbent=True, a verified feasible assignment from a limited solve can enter the search even when minimal Hamming distance is unproven. Keep other expensive validity checks in the evaluator.

The design follows the Hamming-distance repair step in Zhang et al.. Compare it with Constrained MAP-Elites using python examples/repair_transfer.py repair.

APROL¶

Prepare several repertoires of short policies, each with a nominal displacement for a different operating condition. Pass them to APROL as named collections of RTESkill records. The caller sets the local displacement subgoal, executes the selected genome, and reports the measured displacement.

from qdpy.algorithms import APROL, RTESkill

normal = [RTESkill((-1.,), (-.2,)), RTESkill((1.,), (.2,))]
reversed_steering = [RTESkill((-1.,), (.2,)), RTESkill((1.,), (-.2,))]
planner = APROL({"normal": normal, "reversed": reversed_steering},
                compatibility_std=.1, exploration=.1)

first = planner.ask((.2,))
# The live actuator in this example reverses the command.
planner.tell((-.2 * first.genome[0],))
print(planner.repertoire_probabilities())
second = planner.ask((.2,))
planner.tell((-.2 * second.genome[0],))

The planner gives weight to priors whose nominal predictions match live observations and includes an exploration bonus for less-used priors. Each prior has a GP for correcting nominal displacements. When the same genome occurs in several repertoires, one live action can inform all of them, while only the selected repertoire is charged a live trial. Use a common policy representation and common physical units across the repertoires. A high-level planner can update the next subgoal after each completed action.

The algorithm is based on Kaushik, Desreumaux, and Mouret. Run python examples/repair_transfer.py aprol for a fixed-prior comparison under a simulated steering fault.

MEliTA¶

MEliTA explores designs made of independently mutable components. Each component has a scalar descriptor and one archive axis. A coherence callback scores the result of combining all components. A mutation proposes one replacement. Transverse assessment then tries it with partners from elites in its new descriptor slice. The best-ranked combination that can improve its cell is admitted.

import numpy as np
from qdpy.algorithms import MEliTA
from qdpy.containers import Grid

archive = Grid(shape=(6, 6), features_domain=((0., 1.),) * 2,
               fitness_domain=((0., 1.),), fitness_weights=(1.,))

def mutation(index):
    return lambda parts, rng: float(np.clip(parts[index] + rng.normal(0., .15), 0., 1.))

search = MEliTA(
    archive, initialize=lambda rng: tuple(rng.random(2)),
    mutations=(mutation(0), mutation(1)), descriptors=(float, float),
    coherence=lambda parts: 1. - abs(parts[0] - parts[1]), seed=7,
)
stats = search.run(budget=80)
print(stats.assessments, stats.transverse_assessments, archive.filled_bins)

Use immutable components such as numbers, strings, or tuples. A mutation can read the full parent tuple and returns one component. Multiple pairings can spend the assessment budget for one edit. The direct combination is considered first if there is only enough budget for a partial assessment of that edit. Set transverse=False for a direct-only control at the same number of coherence calls.

See Zammit et al. for the original formulation, and run python examples/repair_transfer.py melita for a layout and controller pairing example.

QDHUAC¶

QDHUAC applies replay-based critic and actor updates while evolving a fixed-size Dominated Novelty Search population. The categorical critic predicts a distribution over fixed return values. It uses a single shared forward pass on current and next state-action pairs for batch normalization. The actor uses the distribution’s mean. Prioritized replay uses expected-return errors.

from examples.qdhuac import CurveControl
from qdpy.rl import PolicyConfig, QDHUAC, SACConfig

search = QDHUAC(
    CurveControl,
    descriptor=lambda episode: (float(episode.observations[1:, 0].mean()),),
    config=SACConfig(batch_size=16, learning_starts=16,
                     critic_hidden_sizes=(24,)),
    policy=PolicyConfig((16,)), return_bounds=(0., 16.), atoms=21,
    population_size=12, batch_size=6, updates_per_transition=2,
    gradient_steps=2, max_episode_steps=8, seed=7,
)
stats = search.train(96)
print(len(search.population), stats.env_steps, stats.critic_updates)
actor = search.best_policy()

Choose return_bounds for the task’s discounted return range. Targets beyond those bounds place their probability on an endpoint. updates_per_transition specifies the number of critic updates for each step after replay warm-up. A cut episode still supplies replay, and only completed generations update the population. Save the Gaussian actor with actor.save(path) and reload it with SACPolicy.load(path).

See Koohy and Bayne. Run python examples/qdhuac.py to compare against TD3 under the same emitter schedule, transition budget, and critic update count.

qdpy

Navigation

Contents:

  • Choose your first QDpy search
  • Run your first searches from PyPI
  • Validation for recommended methods
  • Run a seeded MAP-Elites search
  • Run a seeded NSLC search
  • Choose a QD method
  • Choose a QD algorithm
  • Compare three QD baselines
  • Run reference QD benchmarks
  • Reference QD benchmark results
  • MAP-Elites with Iso+LineDD
  • CMA-MAE with a best-only result grid
  • Dominated Novelty Search
  • Multi-Objective MAP-Elites
  • CMA-MAEGA with analytic gradients
  • Bayesian optimisation of elites
  • Discount Model Search
  • Constrained MAP-Elites with mixed variables
  • Conditional design search with HiGeME
  • Generational Adversarial MAP-Elites
  • Multi-Task Multi-Behavior MAP-Elites
  • Parametric-Task MAP-Elites
  • Learn descriptors from trajectories with AutoQD
  • MOUR-QD for unbounded descriptors
  • Mix-ME for cooperative teams
  • Quality diversity through human feedback
  • Graph-path quality diversity
  • Dynamic MAP-Elites
  • Multiple descriptors and CMA-based search
  • Case-wise selection and policy repertoires
  • Case-wise search and policy repertoire benchmarks
  • Conditional designs and task repertoires
  • Conditional designs and task repertoire benchmarks
  • Offline search and diverse plans
  • Offline search and diverse planning benchmarks
  • Compact repertoires and skill composition
  • Compact repertoire benchmarks
  • Deep archives and scenario discovery
  • Deep archives and scenario discovery benchmarks
  • Adaptive exploration, operator selection, and phased diversity
  • Residual regression and focused QD search
  • Learned density, design portfolios, and shared controllers
  • Refine diverse starts and coevolve complementary solutions
  • Guide search with task feedback and local adaptation
  • Build repertoires for classifiers, schedules, and skills
  • Search across age layers, decoders, and learned behaviors
  • Dynamic mutation and learned novelty
  • Encodings, behavior spaces, and design prototypes
  • Editable archives, preference drift, and component credit
  • Composite designs, surrogate niching, and heuristics
  • Composite design and heuristic search benchmarks
  • Solver-backed archives, graph policies, and self-play
  • Solver-backed archives, graph controllers, and parent selection
  • Few-shot priors, basin search, and semantic trade-offs
  • Language models for context rewrites, ideas, and benchmark tasks
  • Changing constraints, structured niches, fidelity, and replay
  • Changing constraints, structured niches, fidelity, and replay
  • Hierarchical archives, counterfactuals, and generative QD
  • Hierarchical archives, counterfactuals, and generative QD
  • Constraint programming, safe exploration, and diffusion search
  • Constraint programming, safe exploration, and diffusion search
  • Sequence search, outcome distributions, and continuing control
  • Sequence search, outcome distributions, and continuing control
  • Counterexamples, design symmetries, and learned policy variation
  • Counterexamples, design symmetries, and learned policy variation
  • Few-shot priors, basin search, and semantic trade-offs
  • Feasible Pareto fronts, analytic gradients, and diverse breeding
  • Feasible fronts, gradients, and diverse breeding
  • Quality thresholds, measured surrogates, and comparable policies
  • Quality thresholds, measured surrogates, and comparable policies
  • Metric archives, peer exchange, and structured variation
  • Metric archives, peer exchange, and structured variation
  • Pareto fronts, noisy elites, and policy gradients
  • Pareto fronts, noisy elites, and policy gradients on CPU
  • Model merging, subset selection, and planning
  • CPU comparisons for model merging, subset selection, and planning
  • Binary swarms, geometric policies, and budgeted archives
  • CPU pilots for binary, geometric, and budgeted search
  • Reference niches, repertoire selection, and model-based skills
  • CPU pilots for reference repertoires and model-based skills
  • Case novelty, linked variation, and discovered skills
  • CPU pilots for case novelty, linked variation, and discovered skills
  • Near-optimal portfolios, novelty, and policy reuse
  • CPU pilots for portfolios, novelty–surprise search, and policy reuse
  • Guided variation, reward coverage, and offline priors
  • Objective voting, structural diversity, and transfer
  • CPU pilots for guided search
  • Batch acquisition, benchmark instances, feasibility, and scenario risk
  • CPU pilots for batch acquisition, benchmark instances, feasibility, and risk
  • Discrete policy search with PPO and MAP-Elites
  • Continuous control with PPO, TD3, and PGA-MAP-Elites
  • Batched neural MAP-Elites
  • Quality-diversity policy gradient
  • Descriptor-conditioned MAP-Elites
  • Quality-Diversity Actor-Critic
  • Discrete QDAC variants
  • Control evaluation with ask and tell
  • Run a QDpy seed sweep with Rundra
  • Evaluate a MAP-Elites search with Ray
  • Replay a saved search
  • Save and resume a portable run
  • Compare multi-seed runs
  • Plot archive geometry and evolution
  • Genealogy and stepping stones
  • MC-AURORA with learned descriptors
  • MAP-Elites with noisy evaluations
  • Audit a noisy archive
  • Shared noisy Rastrigin validation
  • How QDpy runs a search
  • Core Python API
  • QDpy source reference
  • QDpy release notes
  • Run the release preflight
  • Benchmark search throughput
  • QDpy parallelism benchmarks
  • Compare MAP-Elites, CVT-MAP-Elites, and CMA-MAE
  • Shared QD benchmark panels
  • Modern QD pilot results
  • Differentiable, Bayesian, and high-dimensional QD pilots
  • Constrained search and GAME pilots
  • Fixed-task and dynamic QD pilots
  • Local Pareto, team, feedback, graph, and Bayesian QD pilots
  • Joint population optimization with SQUAD
  • Segment crossover in MAP-Elites
  • Learned competition rules
  • Share policy representations with RefQD
  • Co-design bodies and controllers with Pollination
  • Population objectives, learned selection, and policy transfer
  • Adapt a repertoire with M-BOA
  • Two-objective MO-CMA-MAE
  • Gradient-informed search on categorical genomes
  • Behavior-regulated policy gradients
  • Return to promising states with Go-Explore
  • Repertoire adaptation, gradient search, and exploration benchmarks
  • Multifidelity search, adaptive grids, and curricula
  • Train controllers for objective trade-offs
  • Multifidelity search, adaptive grids, and curricula benchmarks
  • Scalable covariance search and learned genome variation
  • Gradient, imitation, and dynamics-aware policy search
  • Scalable emitters and continuous policy search benchmarks
  • Targeted search, balanced designs, and adversarial tournaments
  • SAC populations and search over frozen policy latents
  • Targeted search and policy population benchmarks
  • Interactive search, scheduling rules, and repertoire reuse
  • Distill a repertoire with the Quality-Diversity Transformer
  • Interactive and repertoire workflow benchmarks
  • Symbolic regression with MAP-Elites
  • Symbolic regression benchmark
  • Parent selection, surrogate search, and diverse skills
  • Parent selection, surrogate search, and skill pilots
  • Archive repair, ensembles, and policy reuse
  • Archive repair, ensembles, and policy reuse benchmarks
  • Differential evolution, mixed variables, and learned preferences
  • Differential evolution, mixed variables, and learned preferences
  • Solver repair, repertoire selection, and cross-component search
    • Solver-repaired MAP-Elites
    • APROL
    • MEliTA
    • QDHUAC
  • Solver repair, repertoire selection, and cross-component search
  • Offline search, learned niches, and cooperating policy parts
  • Offline search, learned niches, and cooperating policies benchmarks
  • Trace-Elites, MEMES, and asymmetric islands
  • Trace-Elites, MEMES, and AIM benchmarks
  • Deep QD, Voronoi-Elites, and occupancy CVT-MAP-Elites
  • Deep QD, Voronoi-Elites, and occupancy benchmarks
  • Sparse rewards, interpretable trees, and population diversity
  • Sparse rewards, decision trees, and determinant diversity
  • Ordered trajectories and model-guided variation
  • Ordered trajectories and model-guided variation

Related Topics

  • Documentation overview
    • Previous: Differential evolution, mixed variables, and learned preferences
    • Next: Solver repair, repertoire selection, and cross-component search
©2018, Leo Cazenille. | Powered by Sphinx 9.2.0 & Alabaster 1.0.0 | Page source