sequince.steps.mutation.adaptive.steps#

Adapt the number of mutation steps between SMC iterations.

Classes#

AdaptMutationSteps

Adapt a fixed-length mutation budget between SMC iterations.

Module Contents#

class sequince.steps.mutation.adaptive.steps.AdaptMutationSteps(mutation, policy=None, *, initial_steps, min_steps, max_steps)[source]#

Bases: sequince.steps.mutation.adaptive.base.AdaptiveMutationStep

Adapt a fixed-length mutation budget between SMC iterations.

Conditional on the completed SMC history before iteration t, the mutation budget is chosen and frozen before mutation begins. The wrapped mutation then executes that complete fixed-length block. Its final MutationMetricsOutput may determine the budget for iteration t + 1, but cannot change the current block. Repeated calls with the same StepContext.iteration reuse the frozen budget and update the policy at most once.

This wrapper deliberately does not implement trajectory-dependent stopping. Budget splitting across fixed rounds (for example, in RepeatedMutationStep) remains the responsibility of the wrapped mutation.

Parameters:
policy#
property current_n_steps: int | None#

The budget frozen for the current or most recent iteration.

Return type:

int | None

property next_n_steps: int | None#

The budget proposed for the next outer iteration, if known.

Return type:

int | None

state_dict()[source]#

Return the frozen/current decision and nested mutable state.

Return type:

dict[str, Any]

load_state_dict(state)[source]#

Restore an adaptive decision without consulting the policy again.

Parameters:

state (collections.abc.Mapping[str, Any])

Return type:

None