sequince.steps.mutation.adaptive.steps#
Adapt the number of mutation steps between SMC iterations.
Classes#
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.AdaptiveMutationStepAdapt 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 finalMutationMetricsOutputmay determine the budget for iterationt + 1, but cannot change the current block. Repeated calls with the sameStepContext.iterationreuse 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:
mutation (sequince.steps.base.FixedLengthMutation)
policy (sequince.steps.mutation.adaptive.policies.MutationStepPolicy | None)
initial_steps (int)
min_steps (int)
max_steps (int)
- 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
- load_state_dict(state)[source]#
Restore an adaptive decision without consulting the policy again.
- Parameters:
state (collections.abc.Mapping[str, Any])
- Return type:
None