tempered(sampler, num_temps; swap_strategy=ReversibleSwap(), kwargs...)</code></pre><p>Return a tempered version of <code>sampler</code> using the provided <code>inverse_temperatures</code> or inverse temperatures generated from <code>num_temps</code> and the <code>swap_strategy</code>.</p><p><strong>Arguments</strong></p><ul><li><code>sampler</code> is an algorithm or sampler object to be used for underlying sampling and to apply tempering to</li><li>The temperature schedule can be defined either explicitly or just as an integer number of temperatures, i.e. as:<ul><li><code>inverse_temperatures</code> containing a sequence of 'inverse temperatures' {β₀, ..., βₙ} where 0 ≤ βₙ < ... < β₁ < β₀ = 1 OR</li><li><code>num_temps</code>, specifying the integer number of inverse temperatures to include in a generated <code>inverse_temperatures</code></li></ul></li></ul><p><strong>Keyword arguments</strong></p><ul><li><code>swap_strategy::AbstractSwapStrategy</code> specifies the method for swapping inverse temperatures between chains</li><li><code>steps_per_swap::Integer</code> steps are carried out between each attempt at a swap</li></ul><p><strong>See also</strong></p><ul><li><a href="#MCMCTempering.TemperedSampler"><code>TemperedSampler</code></a></li><li>For more on the swap strategies:<ul><li><a href="#MCMCTempering.AbstractSwapStrategy"><code>AbstractSwapStrategy</code></a></li><li><a href="#MCMCTempering.ReversibleSwap"><code>ReversibleSwap</code></a></li><li><a href="#MCMCTempering.NonReversibleSwap"><code>NonReversibleSwap</code></a></li><li><a href="#MCMCTempering.SingleSwap"><code>SingleSwap</code></a></li><li><a href="#MCMCTempering.SingleRandomSwap"><code>SingleRandomSwap</code></a></li><li><a href="#MCMCTempering.RandomSwap"><code>RandomSwap</code></a></li><li><a href="#MCMCTempering.NoSwap"><code>NoSwap</code></a></li></ul></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/TuringLang/MCMCTempering.jl/blob/deb96684496f3fbd011b9f70f28c49a161def23f/src/MCMCTempering.jl#L46-L75">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MCMCTempering.TemperedSampler" href="#MCMCTempering.TemperedSampler"><code>MCMCTempering.TemperedSampler</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">TemperedSampler <: AbstractMCMC.AbstractSampler</code></pre><p>A <code>TemperedSampler</code> struct wraps a sampler upon which to apply the Parallel Tempering algorithm.</p><p><strong>Fields</strong></p><ul><li><p><code>sampler</code>: sampler(s) used to target the tempered distributions</p></li><li><p><code>chain_to_beta</code>: collection of inverse temperatures β; β[i] correponds i-th tempered model</p></li><li><p><code>swapstrategy</code>: strategy to use for swapping</p></li><li><p><code>adapt</code>: boolean flag specifying whether or not to adapt</p></li><li><p><code>adaptation_states</code>: adaptation parameters</p></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/TuringLang/MCMCTempering.jl/blob/deb96684496f3fbd011b9f70f28c49a161def23f/src/tempered_sampler.jl#L33-L41">source</a></section></article><p>Under the hood, <a href="#MCMCTempering.TemperedSampler"><code>MCMCTempering.TemperedSampler</code></a> is actually just a "fancy" representation of a composition (represented using a <a href="#MCMCTempering.CompositionSampler"><code>MCMCTempering.CompositionSampler</code></a>) of a <a href="#MCMCTempering.MultiSampler"><code>MCMCTempering.MultiSampler</code></a> and a <a href="#MCMCTempering.SwapSampler"><code>MCMCTempering.SwapSampler</code></a>.</p><p>Roughly speaking, the implementation of <code>AbstractMCMC.step</code> for <a href="#MCMCTempering.TemperedSampler"><code>MCMCTempering.TemperedSampler</code></a> is basically</p><pre><code class="language-julia hljs"># 1. Construct the tempered models.
0 commit comments