sequince.steps.mutation.adaptive.policies.rho#

Policies selecting MiniPCN step sizes from completed mutation blocks.

Classes#

MiniPCNRhoPolicy

Choose rho before a block and from its completed metrics.

AcceptanceRateRhoPolicy

Tune rho toward a target acceptance using a bounded multiplicative update.

Module Contents#

class sequince.steps.mutation.adaptive.policies.rho.MiniPCNRhoPolicy[source]#

Bases: Protocol

Choose 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_dict and load_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:
Return type:

float

update(*, current_rho, metrics, context)[source]#

Choose the next iteration’s step size from one complete block.

Parameters:
Return type:

float

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.

target_acceptance: float = 0.234#
adaptation_rate: float = 0.1#
min_rho: float = 0.001#
max_rho: float = 0.99#
initialise(*, initial_rho, context)[source]#
Parameters:
Return type:

float

update(*, current_rho, metrics, context)[source]#
Parameters:
Return type:

float

state_dict()[source]#
Return type:

dict[str, Any]

load_state_dict(state)[source]#
Parameters:

state (collections.abc.Mapping[str, Any])

Return type:

None