sequince.steps.mutation.adaptive.base#
Shared lifecycle for adaptation after completed mutation blocks.
Classes#
Base for eager adaptation after a complete mutation block. |
Module Contents#
- class sequince.steps.mutation.adaptive.base.AdaptiveMutationStep(mutation)[source]#
Bases:
sequince.steps.base.SMCStep,abc.ABCBase for eager adaptation after a complete mutation block.
Subclasses prepare context and optionally choose a fixed budget in
_prepare_mutation, then consume finalized metrics in_adapt. The base executes the child once, preserves its output, and forwards child checkpoint state. Adaptation cannot interrupt the current mutation block.- Parameters:
mutation (sequince.steps.base.SMCStep | sequince.steps.base.FixedLengthMutation)
- apply(state, context, rng)[source]#
- Parameters:
state (sequince.state.ParticleState)
context (sequince.steps.context.StepContext)
rng (orng.RandomGenerator)
- Return type:
tuple[sequince.state.ParticleState, sequince.steps.context.StepContext, Any]
- abstractmethod apply_functional(state, context, random_state)[source]#
Apply a functional step to particle step.
This returns the updated state, context, next random state, and any additional outputs.
This method is intended for use in functional SMC iterations where the random state is explicitly threaded through the computation.
- load_state_dict(state)[source]#
Restore the wrapped mutation’s checkpoint state.
- Parameters:
state (collections.abc.Mapping[str, Any])
- Return type:
None