sequince.steps.mutation.adaptive.policies.acceptance
====================================================

.. py:module:: sequince.steps.mutation.adaptive.policies.acceptance

.. autoapi-nested-parse::

   Choose mutation budgets from observed acceptance probabilities.



Classes
-------

.. autoapisummary::

   sequince.steps.mutation.adaptive.policies.acceptance.AcceptanceRatePolicy


Module Contents
---------------

.. py:class:: AcceptanceRatePolicy(target_steps, *, min_steps, max_steps, min_acceptance = 1e-06)

   Target an expected number of accepted moves per particle.

   Propose ``ceil(target_steps / max(acceptance, min_acceptance))``
   for the next iteration. ``min_acceptance`` (default ``1e-6``) keeps the
   budget finite for zero or very small acceptance rates. Every returned
   budget is clipped to the required ``min_steps`` and ``max_steps`` bounds. A block with no attempted moves
   supplies no acceptance estimate, so its current budget is retained (or
   increased to one when zero) to allow a subsequent measurement.

   Acceptance is estimated from the complete block's accepted and attempted
   counts, including fractional expected counts from recycling algorithms.


   .. py:attribute:: min_steps


   .. py:attribute:: max_steps


   .. py:attribute:: target_steps


   .. py:attribute:: min_acceptance


   .. py:method:: initialise(*, initial_steps, context)


   .. py:method:: update(*, current_steps, metrics, context)


