Skip to content

Commit

Permalink
build based on 160eb19
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Oct 3, 2024
1 parent ad84712 commit 6ffa841
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 51 deletions.
2 changes: 1 addition & 1 deletion previews/PR144/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-10-03T15:53:37","documenter_version":"1.7.0"}}
{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-10-03T15:54:14","documenter_version":"1.7.0"}}
18 changes: 9 additions & 9 deletions previews/PR144/api/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion previews/PR144/design/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
end

return AbstractMCMC.bundle_samples(samples, model, sampler, state, chain_type; kwargs...)
end</code></pre><p>All other default implementations make use of the same structure and in particular call the same methods.</p><h2 id="Sampling-step"><a class="docs-heading-anchor" href="#Sampling-step">Sampling step</a><a id="Sampling-step-1"></a><a class="docs-heading-anchor-permalink" href="#Sampling-step" title="Permalink"></a></h2><p>The only method for which no default implementation is provided (and hence which downstream packages <em>have</em> to implement) is <a href="#AbstractMCMC.step"><code>AbstractMCMC.step</code></a>. It defines the sampling step of the inference method.</p><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="AbstractMCMC.step" href="#AbstractMCMC.step"><code>AbstractMCMC.step</code></a><span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">step(rng, model, sampler[, state; kwargs...])</code></pre><p>Return a 2-tuple of the next sample and the next state of the MCMC <code>sampler</code> for <code>model</code>.</p><p>Samples describe the results of a single step of the <code>sampler</code>. As an example, a sample might include a vector of parameters sampled from a prior distribution.</p><p>When sampling using <a href="../api/#StatsBase.sample-Tuple{AbstractRNG, AbstractMCMC.AbstractModel, AbstractMCMC.AbstractSampler, Any}"><code>sample</code></a>, every <code>step</code> call after the first has access to the current <code>state</code> of the sampler.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/TuringLang/AbstractMCMC.jl/blob/2abf05af2c38590bdaf0e2015b86ec40d00c5a70/src/interface.jl#L63-L73">source</a></section></article><h2 id="Collecting-samples"><a class="docs-heading-anchor" href="#Collecting-samples">Collecting samples</a><a id="Collecting-samples-1"></a><a class="docs-heading-anchor-permalink" href="#Collecting-samples" title="Permalink"></a></h2><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>This section does not apply to the iterator and transducer interface.</p></div></div><p>After the initial sample is obtained, the default implementations for regular and parallel sampling (not for the iterator and the transducer since it is not needed there) create a container for all samples (the initial one and all subsequent samples) using <code>AbstractMCMC.samples</code>.</p><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="AbstractMCMC.samples" href="#AbstractMCMC.samples"><code>AbstractMCMC.samples</code></a><span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">samples(sample, model, sampler[, N; kwargs...])</code></pre><p>Generate a container for the samples of the MCMC <code>sampler</code> for the <code>model</code>, whose first sample is <code>sample</code>.</p><p>The method can be called with and without a predefined number <code>N</code> of samples.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/TuringLang/AbstractMCMC.jl/blob/2abf05af2c38590bdaf0e2015b86ec40d00c5a70/src/interface.jl#L76-L83">source</a></section></article><p>In each step, the sample is saved in the container by <code>AbstractMCMC.save!!</code>. The notation <code>!!</code> follows the convention of the package <a href="https://github.com/JuliaFolds/BangBang.jl">BangBang.jl</a> which is used in the default implementation of <code>AbstractMCMC.save!!</code>. It indicates that the sample is pushed to the container but a &quot;widening&quot; fallback is used if the container type does not allow to save the sample. Therefore <code>AbstractMCMC.save!!</code> <em>always has</em> to return the container.</p><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="AbstractMCMC.save!!" href="#AbstractMCMC.save!!"><code>AbstractMCMC.save!!</code></a><span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">save!!(samples, sample, iteration, model, sampler[, N; kwargs...])</code></pre><p>Save the <code>sample</code> of the MCMC <code>sampler</code> at the current <code>iteration</code> in the container of <code>samples</code>.</p><p>The function can be called with and without a predefined number <code>N</code> of samples. By default, AbstractMCMC uses <code>push!!</code> from the Julia package <a href="https://github.com/tkf/BangBang.jl">BangBang</a> to append to the container, and widen its type if needed.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/TuringLang/AbstractMCMC.jl/blob/2abf05af2c38590bdaf0e2015b86ec40d00c5a70/src/interface.jl#L94-L104">source</a></section></article><p>For most use cases the default implementation of <code>AbstractMCMC.samples</code> and <code>AbstractMCMC.save!!</code> should work out of the box and hence need not to be overloaded in downstream code.</p><h2 id="Creating-chains"><a class="docs-heading-anchor" href="#Creating-chains">Creating chains</a><a id="Creating-chains-1"></a><a class="docs-heading-anchor-permalink" href="#Creating-chains" title="Permalink"></a></h2><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>This section does not apply to the iterator and transducer interface.</p></div></div><p>At the end of the sampling procedure for regular and paralle sampling we transform the collection of samples to the desired output type by calling <code>AbstractMCMC.bundle_samples</code>.</p><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="AbstractMCMC.bundle_samples" href="#AbstractMCMC.bundle_samples"><code>AbstractMCMC.bundle_samples</code></a><span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">bundle_samples(samples, model, sampler, state, chain_type[; kwargs...])</code></pre><p>Bundle all <code>samples</code> that were sampled from the <code>model</code> with the given <code>sampler</code> in a chain.</p><p>The final <code>state</code> of the <code>sampler</code> can be included in the chain. The type of the chain can be specified with the <code>chain_type</code> argument.</p><p>By default, this method returns <code>samples</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/TuringLang/AbstractMCMC.jl/blob/2abf05af2c38590bdaf0e2015b86ec40d00c5a70/src/interface.jl#L22-L31">source</a></section></article><p>The default implementation should be fine in most use cases, but downstream packages could, e.g., save the final state of the sampler as well if they overload <code>AbstractMCMC.bundle_samples</code>.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../api/">« API</a><a class="docs-footer-nextpage" href="../state_interface/">Interface For Sampler <code>state</code> and Gibbs Sampling »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Thursday 3 October 2024 15:53">Thursday 3 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
end</code></pre><p>All other default implementations make use of the same structure and in particular call the same methods.</p><h2 id="Sampling-step"><a class="docs-heading-anchor" href="#Sampling-step">Sampling step</a><a id="Sampling-step-1"></a><a class="docs-heading-anchor-permalink" href="#Sampling-step" title="Permalink"></a></h2><p>The only method for which no default implementation is provided (and hence which downstream packages <em>have</em> to implement) is <a href="#AbstractMCMC.step"><code>AbstractMCMC.step</code></a>. It defines the sampling step of the inference method.</p><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="AbstractMCMC.step" href="#AbstractMCMC.step"><code>AbstractMCMC.step</code></a><span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">step(rng, model, sampler[, state; kwargs...])</code></pre><p>Return a 2-tuple of the next sample and the next state of the MCMC <code>sampler</code> for <code>model</code>.</p><p>Samples describe the results of a single step of the <code>sampler</code>. As an example, a sample might include a vector of parameters sampled from a prior distribution.</p><p>When sampling using <a href="../api/#StatsBase.sample-Tuple{AbstractRNG, AbstractMCMC.AbstractModel, AbstractMCMC.AbstractSampler, Any}"><code>sample</code></a>, every <code>step</code> call after the first has access to the current <code>state</code> of the sampler.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/TuringLang/AbstractMCMC.jl/blob/160eb19f2080dc0ed72613f490be548e1f17ca31/src/interface.jl#L63-L73">source</a></section></article><h2 id="Collecting-samples"><a class="docs-heading-anchor" href="#Collecting-samples">Collecting samples</a><a id="Collecting-samples-1"></a><a class="docs-heading-anchor-permalink" href="#Collecting-samples" title="Permalink"></a></h2><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>This section does not apply to the iterator and transducer interface.</p></div></div><p>After the initial sample is obtained, the default implementations for regular and parallel sampling (not for the iterator and the transducer since it is not needed there) create a container for all samples (the initial one and all subsequent samples) using <code>AbstractMCMC.samples</code>.</p><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="AbstractMCMC.samples" href="#AbstractMCMC.samples"><code>AbstractMCMC.samples</code></a><span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">samples(sample, model, sampler[, N; kwargs...])</code></pre><p>Generate a container for the samples of the MCMC <code>sampler</code> for the <code>model</code>, whose first sample is <code>sample</code>.</p><p>The method can be called with and without a predefined number <code>N</code> of samples.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/TuringLang/AbstractMCMC.jl/blob/160eb19f2080dc0ed72613f490be548e1f17ca31/src/interface.jl#L76-L83">source</a></section></article><p>In each step, the sample is saved in the container by <code>AbstractMCMC.save!!</code>. The notation <code>!!</code> follows the convention of the package <a href="https://github.com/JuliaFolds/BangBang.jl">BangBang.jl</a> which is used in the default implementation of <code>AbstractMCMC.save!!</code>. It indicates that the sample is pushed to the container but a &quot;widening&quot; fallback is used if the container type does not allow to save the sample. Therefore <code>AbstractMCMC.save!!</code> <em>always has</em> to return the container.</p><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="AbstractMCMC.save!!" href="#AbstractMCMC.save!!"><code>AbstractMCMC.save!!</code></a><span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">save!!(samples, sample, iteration, model, sampler[, N; kwargs...])</code></pre><p>Save the <code>sample</code> of the MCMC <code>sampler</code> at the current <code>iteration</code> in the container of <code>samples</code>.</p><p>The function can be called with and without a predefined number <code>N</code> of samples. By default, AbstractMCMC uses <code>push!!</code> from the Julia package <a href="https://github.com/tkf/BangBang.jl">BangBang</a> to append to the container, and widen its type if needed.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/TuringLang/AbstractMCMC.jl/blob/160eb19f2080dc0ed72613f490be548e1f17ca31/src/interface.jl#L94-L104">source</a></section></article><p>For most use cases the default implementation of <code>AbstractMCMC.samples</code> and <code>AbstractMCMC.save!!</code> should work out of the box and hence need not to be overloaded in downstream code.</p><h2 id="Creating-chains"><a class="docs-heading-anchor" href="#Creating-chains">Creating chains</a><a id="Creating-chains-1"></a><a class="docs-heading-anchor-permalink" href="#Creating-chains" title="Permalink"></a></h2><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>This section does not apply to the iterator and transducer interface.</p></div></div><p>At the end of the sampling procedure for regular and paralle sampling we transform the collection of samples to the desired output type by calling <code>AbstractMCMC.bundle_samples</code>.</p><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="AbstractMCMC.bundle_samples" href="#AbstractMCMC.bundle_samples"><code>AbstractMCMC.bundle_samples</code></a><span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">bundle_samples(samples, model, sampler, state, chain_type[; kwargs...])</code></pre><p>Bundle all <code>samples</code> that were sampled from the <code>model</code> with the given <code>sampler</code> in a chain.</p><p>The final <code>state</code> of the <code>sampler</code> can be included in the chain. The type of the chain can be specified with the <code>chain_type</code> argument.</p><p>By default, this method returns <code>samples</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/TuringLang/AbstractMCMC.jl/blob/160eb19f2080dc0ed72613f490be548e1f17ca31/src/interface.jl#L22-L31">source</a></section></article><p>The default implementation should be fine in most use cases, but downstream packages could, e.g., save the final state of the sampler as well if they overload <code>AbstractMCMC.bundle_samples</code>.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../api/">« API</a><a class="docs-footer-nextpage" href="../state_interface/">Interface For Sampler <code>state</code> and Gibbs Sampling »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Thursday 3 October 2024 15:54">Thursday 3 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit 6ffa841

Please sign in to comment.