sequince.steps.mutation.rejuvenation#
Approximate direct rejuvenation using an injected generative proposal.
Classes#
Minimal fitted-proposal surface required for direct rejuvenation. |
|
Refit and directly redraw from an injected generative proposal. |
Module Contents#
- class sequince.steps.mutation.rejuvenation.GenerativeProposal[source]#
Bases:
ProtocolMinimal fitted-proposal surface required for direct rejuvenation.
- class sequince.steps.mutation.rejuvenation.ProposalRejuvenation(target, proposal, *, transform=None)[source]#
Bases:
sequince.steps.base.SMCStepRefit and directly redraw from an injected generative proposal.
Direct proposal draws are not, in general, exact samples from the current SMC target. Unlike an MCMC mutation kernel, this step does not preserve the target exactly and has no Metropolis-Hastings correction.
A supplied transform defines the latent fitting space. Draws are mapped back to physical coordinates before the target evaluation is refreshed.
- Parameters:
target (sequince.target.Target)
proposal (GenerativeProposal)
transform (sequince.transforms.ParticleTransform | None)
- property proposal: GenerativeProposal#
The proposal fitted by the most recent application.
- Return type:
- 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, dict[str, Any]]
- 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.
- Parameters:
state (sequince.state.ParticleState)
context (sequince.steps.context.StepContext)
random_state (Any)
- Return type:
tuple[sequince.state.ParticleState, sequince.steps.context.StepContext, Any, Any]
- load_state_dict(state)[source]#
Restore state produced by
state_dict().- Parameters:
state (collections.abc.Mapping[str, Any])
- Return type:
None