sequince.steps.mutation.adaptive.policies.rho#
Policies selecting MiniPCN step sizes from completed mutation blocks.
Classes#
Choose rho before a block and from its completed metrics. |
|
Tune rho toward a target acceptance using a bounded multiplicative update. |
Module Contents#
- class sequince.steps.mutation.adaptive.policies.rho.MiniPCNRhoPolicy[source]#
Bases:
ProtocolChoose rho before a block and from its completed metrics.
Decisions must be scalar, finite and strictly between zero and one. Stateful policies may supply
state_dictandload_state_dict; the wrapper forwards these when checkpointing. Policies never see intermediate rounds or mutate the sampler.- initialise(*, initial_rho, context)[source]#
Choose the first iteration’s step size.
- Parameters:
initial_rho (float)
context (sequince.steps.context.StepContext)
- Return type:
- update(*, current_rho, metrics, context)[source]#
Choose the next iteration’s step size from one complete block.
- Parameters:
current_rho (float)
metrics (sequince.steps.mutation.metrics.MutationMetricsOutput)
context (sequince.steps.context.StepContext)
- Return type:
- class sequince.steps.mutation.adaptive.policies.rho.AcceptanceRateRhoPolicy[source]#
Tune rho toward a target acceptance using a bounded multiplicative update.
- Parameters:
target_acceptance (float, optional) – Desired acceptance fraction. Default 0.234.
adaptation_rate (float, optional) – Rate in
rho * exp(rate * (acceptance - target)). Default 0.1. Zero retains rho exactly after initial clipping.min_rho (float, optional) – Bounds strictly between zero and one. Defaults 0.001 and 0.99. Initial rho is clipped to these bounds.
max_rho (float, optional) – Bounds strictly between zero and one. Defaults 0.001 and 0.99. Initial rho is clipped to these bounds.
Notes
Higher acceptance increases the next block’s proposal step size. Updates use finalized accepted and attempted counts; fractional counts are valid. Empty blocks retain rho. This policy has no evolving state; checkpoint configuration is validated when restoring into a reconstructed policy.
- initialise(*, initial_rho, context)[source]#
- Parameters:
initial_rho (float)
context (sequince.steps.context.StepContext)
- Return type:
- update(*, current_rho, metrics, context)[source]#
- Parameters:
current_rho (float)
metrics (sequince.steps.mutation.metrics.MutationMetricsOutput)
context (sequince.steps.context.StepContext)
- Return type:
- load_state_dict(state)[source]#
- Parameters:
state (collections.abc.Mapping[str, Any])
- Return type:
None