sequince.steps.mutation.adaptive.base
=====================================

.. py:module:: sequince.steps.mutation.adaptive.base

.. autoapi-nested-parse::

   Shared lifecycle for adaptation after completed mutation blocks.



Classes
-------

.. autoapisummary::

   sequince.steps.mutation.adaptive.base.AdaptiveMutationStep


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

.. py:class:: AdaptiveMutationStep(mutation)

   Bases: :py:obj:`sequince.steps.base.SMCStep`, :py:obj:`abc.ABC`


   Base for eager adaptation after a complete mutation block.

   Subclasses prepare context and optionally choose a fixed budget in
   ``_prepare_mutation``, then consume finalized metrics in ``_adapt``.
   The base executes the child once, preserves its output, and forwards child
   checkpoint state. Adaptation cannot interrupt the current mutation block.


   .. py:attribute:: mutation
      :type:  sequince.steps.base.SMCStep | sequince.steps.base.FixedLengthMutation


   .. py:method:: apply(state, context, rng)


   .. py:method:: apply_functional(state, context, random_state)
      :abstractmethod:


      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.



   .. py:method:: state_dict()

      Forward the wrapped mutation's checkpoint state.



   .. py:method:: load_state_dict(state)

      Restore the wrapped mutation's checkpoint state.



