aspire.samplers.smc.emcee
=========================

.. py:module:: aspire.samplers.smc.emcee


Attributes
----------

.. autoapisummary::

   aspire.samplers.smc.emcee.logger


Classes
-------

.. autoapisummary::

   aspire.samplers.smc.emcee.EmceeSMC


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

.. py:data:: logger

.. py:class:: EmceeSMC(log_likelihood, log_prior, dims, prior_flow, xp, dtype=None, parameters=None, preconditioning_transform=None)

   Bases: :py:obj:`aspire.samplers.smc.base.NumpySMCSampler`


   SMCSampler that maps samples and log probabilities to NumPy arrays for
   compatibility with numpy-only samplers


   .. py:method:: sample(n_samples, n_steps = None, adaptive = True, target_efficiency = 0.5, target_efficiency_rate = 1.0, sampler_kwargs = None, n_final_samples = None, checkpoint_callback=None, checkpoint_every = None, checkpoint_file_path = None, resume_from = None)

      Sample using the SMC sampler.

      :param n_samples: The number of samples (particles) to use in the SMC sampler.
      :type n_samples: :py:class:`int`
      :param n_steps: The number of SMC iterations to perform. Must be specified if
                      :code:`adaptive=False`. Default is None.
      :type n_steps: :py:class:`int`, *optional*
      :param adaptive: Whether to adaptively determine the beta schedule. Default is True.
      :type adaptive: :py:class:`bool`, *optional*
      :param min_beta_step: The minimum beta step size when using adaptive beta. Default is None,
                            which means no minimum step size.
      :type min_beta_step: :py:class:`float`, *optional*
      :param max_beta_step: The maximum beta step size when using adaptive beta. Default is None,
                            which means no maximum step size.
      :type max_beta_step: :py:class:`float`, *optional*
      :param max_n_steps: The maximum number of SMC iterations to perform when using adaptive
                          beta. Default is None, which means no maximum.
      :type max_n_steps: :py:class:`int`, *optional*
      :param target_efficiency: The target sample efficiency (ESS / n_samples) to aim for at each
                                SMC iteration. Can be a single float in (0, 1) or a tuple of two
                                floats specifying a range to adapt between. Default is 0.5.
      :type target_efficiency: :py:class:`float` or :py:class:`tuple`, *optional*
      :param target_efficiency_rate: When using a tuple for target_efficiency, this controls the rate at
                                     which the target efficiency adapts from the first value to the
                                     second value as beta increases. Default is 1.0 (linear adaptation).
      :type target_efficiency_rate: :py:class:`float`, *optional*
      :param n_final_samples: If specified, the number of final samples to produce after the SMC
                              iterations. If not specified, the number of final samples will be
                              the same as n_samples. Default is None.
      :type n_final_samples: :py:class:`int`, *optional*
      :param checkpoint_callback: A callback function to call with a checkpoint dictionary at regular
                                  intervals during sampling. Default is None (no checkpointing).
      :type checkpoint_callback: :py:class:`callable`, *optional*
      :param checkpoint_every: The number of iterations between checkpoints when using checkpoint
                               callback.
                               Default is None, which means no regular checkpointing.
      :type checkpoint_every: :py:class:`int`, *optional*
      :param checkpoint_file_path: If using checkpoint_callback, this can be used to specify a file
                                   path to save checkpoints to. Default is None.
      :type checkpoint_file_path: :py:class:`str`, *optional*
      :param resume_from: If specified, this can be used to resume sampling from a previous
                          checkpoint. Can be a file path, bytes object, or checkpoint
                          dictionary. Default is None (start from scratch).
      :type resume_from: :py:class:`str`, :py:class:`bytes`, or :py:class:`dict`, *optional*
      :param store_sample_history: Whether to store the history of samples at each iteration in
                                   :code:`self.history.sample_history`. Default is True.
      :type store_sample_history: :py:class:`bool`, *optional*
      :param beta_tolerance: Tolerance for determining convergence of beta when using adaptive
                             beta. Default is given by :code:`DEFAULT_BETA_TOLERANCE`.
      :type beta_tolerance: :py:class:`float`, *optional*

      :returns: **final_samples** -- The final samples after running the SMC sampler, with log evidence
                and log evidence error estimates.
      :rtype: :py:class:`SMCSamples`

      :raises ValueError: If both n_steps is None and adaptive is False, or if
          target_efficiency is not in (0, 1) when a float, or if
          target_efficiency tuple is not valid, or if log probabilities
          contain NaN values.



   .. py:method:: mutate(particles, beta, n_steps=None)


