sequince.steps.mutation.rejuvenation
====================================

.. py:module:: sequince.steps.mutation.rejuvenation

.. autoapi-nested-parse::

   Approximate direct rejuvenation using an injected generative proposal.



Classes
-------

.. autoapisummary::

   sequince.steps.mutation.rejuvenation.GenerativeProposal
   sequince.steps.mutation.rejuvenation.ProposalRejuvenation


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

.. py:class:: GenerativeProposal

   Bases: :py:obj:`Protocol`


   Minimal fitted-proposal surface required for direct rejuvenation.


   .. py:method:: fit(particles, context = None, *, rng = None)


   .. py:method:: sample(n_samples, context = None, *, rng = None)


.. py:class:: ProposalRejuvenation(target, proposal, *, transform = None)

   Bases: :py:obj:`sequince.steps.base.SMCStep`


   Refit 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.


   .. py:property:: proposal
      :type: GenerativeProposal


      The proposal fitted by the most recent application.


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


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

      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()

      Return mutable state required by subsequent SMC iterations.



   .. py:method:: load_state_dict(state)

      Restore state produced by :meth:`state_dict`.



