sequince.steps.mutation.adaptive.policies.acceptance#

Choose mutation budgets from observed acceptance probabilities.

Classes#

AcceptanceRatePolicy

Target an expected number of accepted moves per particle.

Module Contents#

class sequince.steps.mutation.adaptive.policies.acceptance.AcceptanceRatePolicy(target_steps, *, min_steps, max_steps, min_acceptance=1e-06)[source]#

Target an expected number of accepted moves per particle.

Propose ceil(target_steps / max(acceptance, min_acceptance)) for the next iteration. min_acceptance (default 1e-6) keeps the budget finite for zero or very small acceptance rates. Every returned budget is clipped to the required min_steps and max_steps bounds. A block with no attempted moves supplies no acceptance estimate, so its current budget is retained (or increased to one when zero) to allow a subsequent measurement.

Acceptance is estimated from the complete block’s accepted and attempted counts, including fractional expected counts from recycling algorithms.

Parameters:
min_steps#
max_steps#
target_steps#
min_acceptance#
initialise(*, initial_steps, context)[source]#
Parameters:
Return type:

int

update(*, current_steps, metrics, context)[source]#
Parameters:
Return type:

int