sequince.steps.mutation.adaptive.minipcn#
Fit MiniPCN geometry per block and adapt rho between SMC iterations.
Classes#
Adapt MiniPCN proposals between complete blocks (eager execution only). |
Module Contents#
- class sequince.steps.mutation.adaptive.minipcn.AdaptiveMiniPCNMutation(mutation, policy=None, *, initial_rho=0.5)[source]#
Bases:
sequince.steps.mutation.adaptive.base.AdaptiveMutationStepAdapt MiniPCN proposals between complete blocks (eager execution only).
- Parameters:
mutation (MiniPCNMutation or RepeatedMutationStep) – A non-adaptive MiniPCN mutation, optionally inside repeated blocks. Wrap the entire repeated block to freeze geometry and rho across all rounds. Place conditional execution outside this wrapper.
policy (MiniPCNRhoPolicy or None, optional) – Selects rho from completed block metrics. Defaults to AcceptanceRateRhoPolicy. Stateful policies are checkpointed.
initial_rho (float, optional) – Initial proposal step size supplied to the policy, overriding the child’s rho. Default 0.5.
Notes
Requires equal, finite particle weights: place after resampling. Before the first nonempty round, fit mu, covariance and (for tPCN) nu using MiniPCN’s unweighted fitter in latent coordinates. The fitted transform and proposal are frozen for the entire block. Transform refit policies are consulted once per nonempty block, not once per round.
Completed acceptance selects rho for the next context iteration. Further calls at the same iteration reuse rho and do not update it again; each call still fits geometry from its starting population. Empty blocks do not consume an adaptation update. Metrics include
minipcn_adaptationwithrhoandnext_rho.Checkpoints retain rho decisions and the child’s transform state. Geometry is temporary block state and is fitted again at the next call. Reconstruct the same configuration before restoring a checkpoint. No adaptive pilot transitions are performed. As with other population-adaptive SMC methods, freezing each block is not a claim of exact finite-population invariance.
- initial_rho#
- policy#
- property current_rho: float#
Step size used for the current or most recent outer iteration.
- Return type:
- apply_with_n_steps(state, context, rng, *, n_steps)[source]#
Run a complete block with an externally selected fixed budget.
- Parameters:
state (sequince.state.ParticleState)
context (sequince.steps.context.StepContext)
rng (orng.RandomGenerator)
n_steps (int)
- Return type:
tuple[sequince.state.ParticleState, sequince.steps.context.StepContext, Any]
- load_state_dict(state)[source]#
Restore tuning without rerunning an adaptation update.
- Parameters:
state (collections.abc.Mapping[str, Any])
- Return type:
None