QDpy
Loading...
Searching...
No Matches
checkpoints.py File Reference

Batch-boundary restart for native MAP-Elites with ordered feedback. More...

Go to the source code of this file.

Classes

class  qdpy.checkpoints._PauseAtBoundary

Namespaces

namespace  qdpy

Functions

 qdpy.checkpoints._novelty_settings (archive)
 qdpy.checkpoints._settings (algorithm)
 qdpy.checkpoints.run_checkpointed (algorithm, evaluate, *, checkpoint_path, seed=0, checkpoint_every=10, stop_after=None, resume=False, trusted=False, packed=False, journal_path=None, evaluation_key=None, journal_executor=None, stop_requested=None, _observer=None)
 Run to a batch boundary and optionally continue a previous search.

Detailed Description

Batch-boundary restart for native MAP-Elites with ordered feedback.

Definition in file checkpoints.py.

Function Documentation

◆ _novelty_settings()

qdpy.checkpoints._novelty_settings ( archive)
protected
Describe fixed Euclidean novelty and each parent admission policy.

Definition at line 45 of file checkpoints.py.

◆ _settings()

qdpy.checkpoints._settings ( algorithm)
protected
Describe the search state whose reconstruction is covered by this codec.

Definition at line 61 of file checkpoints.py.

◆ run_checkpointed()

qdpy.checkpoints.run_checkpointed ( algorithm,
evaluate,
* ,
checkpoint_path,
seed = 0,
checkpoint_every = 10,
stop_after = None,
resume = False,
trusted = False,
packed = False,
journal_path = None,
evaluation_key = None,
journal_executor = None,
stop_requested = None,
_observer = None )

Run to a batch boundary and optionally continue a previous search.

Run MAP-Elites, fixed Euclidean NSLC, CMA-MAE, or MOME with atomic checkpoints.

Supply a fresh supported optimiser for either a new run or a resume.
Its budget is the total search budget. MOME saves its ordered
Pareto fronts and generation count.
NSLC checkpoints save the active novelty archive and its plain
parent histories. The exact index is rebuilt on the next query.
``checkpoint_every`` counts full batches. ``stop_after`` is a
cumulative evaluation count and must be a batch boundary or the
total budget. The last completed chunk is also saved.

To resume, pass ``resume=True, trusted=True`` with the same optimiser
settings, evaluator and runtime. Checkpoints contain the native
archive, counters and Python and NumPy global random generator states.
Supply only checkpoints you trust. The seed initializes a fresh run
and the checkpoint supplies the generator states when resuming.
Use one writer per path. External simulator state, callback state,
user-owned random generators, and side effects need caller management.
With ``packed=True``, the evaluator receives a whole batch and returns
one result per candidate in proposal order. It can use remote workers
for deterministic measurements or assign stable seeds itself.
With ``journal_path``, supply a scalar evaluator taking a numeric
individual and a stable seed. Use ``evaluation_key`` to identify the
simulator and settings, and optionally a caller-owned ``journal_executor``.
The evaluator should use the supplied seed with a local random generator.
The journal reuses returned measurements in proposal order on resume.
If ``stop_requested()`` returns true, pause at the next completed batch.
A signal handler can set the flag that this callable observes.
Resume mutates the supplied empty archive in place. The result's
evaluation count is the number of attempts in this invocation.

Definition at line 114 of file checkpoints.py.