jexplore.steps.tswap ==================== .. py:module:: jexplore.steps.tswap .. autoapi-nested-parse:: This module defines the class for a Metropolis-Hasting temperature swap step. Classes ------- .. autoapisummary:: jexplore.steps.tswap.TSwap Module Contents --------------- .. py:class:: TSwap[Tepoch: jexplore.sampling.mh.EpochMH, Tstate: jexplore.sampling.mh.StateMH, Tsampling: jexplore.sampling.mh.SamplingMH](ngroups = -1, permute = False, duplicate = False, adjust = False) Bases: :py:obj:`jexplore.steps.colored.ColoredMH`\ [\ :py:obj:`Tepoch`\ , :py:obj:`Tstate`\ , :py:obj:`Tsampling`\ ] Class for MH temperature swap step :param ngroups: number of groups. If -1 (default) the temperature swapping is fully serial. :param permute: when true permute values before each iteration :param duplicate: duplicate chains in group to make colors groups even :param adjust: adjust the number of group to have even colors groups .. py:method:: grouping() Defines colors chain groups by grouping temperatures. The :math:`i` th color group contains chains for all walkers and with temperature indices :math:`t \mod G = i + 1` and for each of these chains the complementary group of chains contains the chain with temperature :math:`t - 1`. :return: indexes of the chains of each color, indexes of the complementary chains for each color. .. py:method:: colored_step(key, state, group, cgroup) Temperature swap step for a single color. Propose a swap of two consecutive temperatures and accept/reject it according to MH condition. :param key: PRNG key :param state: current state :param group: indexes of the color chains :param cgroup: indexes of the complementary chains for this color. :return: new state and boolean mask of the changed chains