jexplore.steps.modsel.inmodel_single ==================================== .. py:module:: jexplore.steps.modsel.inmodel_single .. autoapi-nested-parse:: This module defines the classes for Model Selection in-model steps acting separately on each chain. Classes ------- .. autoapisummary:: jexplore.steps.modsel.inmodel_single.AllChainsWrap jexplore.steps.modsel.inmodel_single.InModelSC Module Contents --------------- .. py:class:: AllChainsWrap[Tepoch: jexplore.sampling.EpochMS, Tstate: jexplore.sampling.StateMS, Tsampling: jexplore.sampling.SamplingMS, Tstep: jexplore.steps.mh.AllChains](step) Bases: :py:obj:`jexplore.steps.mh.AllChains`\ [\ :py:obj:`Tepoch`\ , :py:obj:`Tstate`\ , :py:obj:`Tsampling`\ ] Model selection wrapper for :py:attr:`jexplore.steps.mh.AllChains` steps. The step is wrapped so that it is applied only on chains that are in a model which (dimensions) mask fully contains the mask of the step. Note that the resulting step does not propose changes in to the chains' models. :param step: the step to be wrapped .. py:attribute:: wrapped_step :type: Tstep .. py:attribute:: active_models :type: jax.Array .. py:method:: build(epoch) Step epoch initialisation method. Extend :py:attr:`jexplore.steps.step.Step.build` by populating the `betas` attribute. :param epoch: current epoch. .. py:method:: proposal(key, state) Propose a new state. The proposed state is identical to the old one for all chains in inactive models (i.e. models whose mask do not contain the mask of the wrapped step) and correspond to the state proposed by the wrapped step for all other chains. :param key: PRNG key :param state: current state :return: new state and the boolean mask of the chains modified by the step. .. py:class:: InModelSC[Tepoch: jexplore.sampling.EpochMS, Tstate: jexplore.sampling.StateMS, Tsampling: jexplore.sampling.SamplingMS, Tstep: jexplore.steps.single_masked.SingleMasked](steps, stepsargs) Bases: :py:obj:`jexplore.steps.mh.AllChains`\ [\ :py:obj:`Tepoch`\ , :py:obj:`Tstate`\ , :py:obj:`Tsampling`\ ] In model single chain MH step. This is constructed out of a list of single chain proposals each one defined on a subspacei of the corresponding model space. :param steps: optional list of one (single chain MH) step instance for each model. :param stepclass: step class. If `steps` argument is not specified, the `build` method will instantiate one step for each model usng this step constructor. :param stepargs: step instantiation arguments. .. py:attribute:: steps :type: list[type[Tstep] | None] List of steps classes per model. .. py:attribute:: stepsargs :type: list[dict] Step instantiation arguments. .. py:method:: build(epoch) Step epoch initialisation method. Extend :py:attr:`jexplore.steps.step.Step.build` by populating the `betas` attribute. :param epoch: current epoch. .. py:method:: proposal(key, state) In model single chain proposal. :param key: PRNG key :param state: current state :return: the new PRNG key, the proposed state, the transition log probability.