Skip to content

Commit

Permalink
Deploy preview for PR 582
Browse files Browse the repository at this point in the history
  • Loading branch information
penelopeysm committed Jan 28, 2025
1 parent e5343df commit 2c658d0
Show file tree
Hide file tree
Showing 42 changed files with 82,361 additions and 83,708 deletions.
6 changes: 3 additions & 3 deletions pr-previews/582/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@
</ul>
<ul class="navbar-nav navbar-nav-scroll ms-auto">
<li class="nav-item dropdown ">
<a class="nav-link dropdown-toggle" href="#" id="nav-menu-v0.35" role="link" data-bs-toggle="dropdown" aria-expanded="false">
<span class="menu-text">v0.35</span>
<a class="nav-link dropdown-toggle" href="#" id="nav-menu-v0.36" role="link" data-bs-toggle="dropdown" aria-expanded="false">
<span class="menu-text">v0.36</span>
</a>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="nav-menu-v0.35">
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="nav-menu-v0.36">
<li>
<a class="dropdown-item" href="https://turinglang.org/docs/changelog.html">
<span class="dropdown-text">Changelog</span></a>
Expand Down
524 changes: 264 additions & 260 deletions pr-previews/582/core-functionality/index.html

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@
</ul>
<ul class="navbar-nav navbar-nav-scroll ms-auto">
<li class="nav-item dropdown ">
<a class="nav-link dropdown-toggle" href="#" id="nav-menu-v0.35" role="link" data-bs-toggle="dropdown" aria-expanded="false">
<span class="menu-text">v0.35</span>
<a class="nav-link dropdown-toggle" href="#" id="nav-menu-v0.36" role="link" data-bs-toggle="dropdown" aria-expanded="false">
<span class="menu-text">v0.36</span>
</a>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="nav-menu-v0.35">
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="nav-menu-v0.36">
<li>
<a class="dropdown-item" href="https://turinglang.org/docs/changelog.html">
<span class="dropdown-text">Changelog</span></a>
Expand Down Expand Up @@ -768,7 +768,7 @@ <h2 class="anchored" data-anchor-id="metadata"><code>Metadata</code></h2>
<li><code>md.idcs</code> is the dictionary that maps each <code>VarName</code> instance to its index in <code>md.vns</code>, <code>md.ranges</code>, <code>md.dists</code>, <code>md.orders</code> and <code>md.flags</code>.</li>
<li><code>md.vns[md.idcs[vn]] == vn</code>.</li>
<li><code>md.dists[md.idcs[vn]]</code> is the distribution of <code>vn</code>.</li>
<li><code>md.gids[md.idcs[vn]]</code> is the set of algorithms used to sample <code>vn</code>. This is used in the Gibbs sampling process.</li>
<li><code>md.gids[md.idcs[vn]]</code> is the set of algorithms used to sample <code>vn</code>. This was used by the Gibbs sampler. Since Turing v0.36 it is unused and will eventually be deleted.</li>
<li><code>md.orders[md.idcs[vn]]</code> is the number of <code>observe</code> statements before <code>vn</code> is sampled.</li>
<li><code>md.ranges[md.idcs[vn]]</code> is the index range of <code>vn</code> in <code>md.vals</code>.</li>
<li><code>md.vals[md.ranges[md.idcs[vn]]]</code> is the linearized vector of values of corresponding to <code>vn</code>.</li>
Expand Down
26 changes: 13 additions & 13 deletions pr-previews/582/developers/compiler/minituring-compiler/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,10 @@
</ul>
<ul class="navbar-nav navbar-nav-scroll ms-auto">
<li class="nav-item dropdown ">
<a class="nav-link dropdown-toggle" href="#" id="nav-menu-v0.35" role="link" data-bs-toggle="dropdown" aria-expanded="false">
<span class="menu-text">v0.35</span>
<a class="nav-link dropdown-toggle" href="#" id="nav-menu-v0.36" role="link" data-bs-toggle="dropdown" aria-expanded="false">
<span class="menu-text">v0.36</span>
</a>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="nav-menu-v0.35">
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="nav-menu-v0.36">
<li>
<a class="dropdown-item" href="https://turinglang.org/docs/changelog.html">
<span class="dropdown-text">Changelog</span></a>
Expand Down Expand Up @@ -790,16 +790,16 @@ <h1>Consider a probabilistic model defined by</h1>
parameters mean std mcse ess_bulk ess_tail rh ⋯
Symbol Float64 Float64 Float64 Float64 Float64 Float ⋯

a 0.9743 0.9014 0.0032 80005.9125 120981.7280 1.00 ⋯
b 2.8806 0.4895 0.0012 170933.3061 214936.9604 1.00 ⋯
a 0.9811 0.8994 0.0032 79824.8778 119042.5191 1.00 ⋯
b 2.8813 0.4881 0.0012 171981.0044 210069.8438 1.00 ⋯
2 columns omitted

Quantiles
parameters 2.5% 25.0% 50.0% 75.0% 97.5%
Symbol Float64 Float64 Float64 Float64 Float64

a -0.7898 0.3649 0.9751 1.5815 2.7453
b 1.9207 2.5505 2.8817 3.2099 3.8415</code></pre>
a -0.7862 0.3763 0.9809 1.5870 2.7400
b 1.9244 2.5526 2.8825 3.2092 3.8371</code></pre>
</div>
</div>
<p>We compare these results with Turing.</p>
Expand All @@ -821,25 +821,25 @@ <h1>Consider a probabilistic model defined by</h1>
Iterations = 1:1:1000000
Number of chains = 1
Samples per chain = 1000000
Wall duration = 29.75 seconds
Compute duration = 29.75 seconds
Wall duration = 31.49 seconds
Compute duration = 31.49 seconds
parameters = a, b
internals = lp

Summary Statistics
parameters mean std mcse ess_bulk ess_tail rh ⋯
Symbol Float64 Float64 Float64 Float64 Float64 Float ⋯

a 0.9748 0.9031 0.0032 81108.7748 120188.8699 1.00 ⋯
b 2.8799 0.4889 0.0012 171318.9555 213329.5373 1.00 ⋯
a 0.9743 0.9040 0.0032 81189.5129 121269.8584 1.00 ⋯
b 2.8811 0.4891 0.0012 174601.6868 216651.2495 1.00 ⋯
2 columns omitted

Quantiles
parameters 2.5% 25.0% 50.0% 75.0% 97.5%
Symbol Float64 Float64 Float64 Float64 Float64

a -0.7905 0.3642 0.9740 1.5838 2.7464
b 1.9197 2.5493 2.8800 3.2105 3.8377</code></pre>
a -0.8004 0.3640 0.9756 1.5839 2.7366
b 1.9225 2.5506 2.8809 3.2119 3.8368</code></pre>
</div>
</div>
<p>As you can see, with our simple probabilistic programming language and custom samplers we get similar results as Turing.</p>
Expand Down
22 changes: 11 additions & 11 deletions pr-previews/582/developers/compiler/minituring-contexts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@
</ul>
<ul class="navbar-nav navbar-nav-scroll ms-auto">
<li class="nav-item dropdown ">
<a class="nav-link dropdown-toggle" href="#" id="nav-menu-v0.35" role="link" data-bs-toggle="dropdown" aria-expanded="false">
<span class="menu-text">v0.35</span>
<a class="nav-link dropdown-toggle" href="#" id="nav-menu-v0.36" role="link" data-bs-toggle="dropdown" aria-expanded="false">
<span class="menu-text">v0.36</span>
</a>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="nav-menu-v0.35">
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="nav-menu-v0.36">
<li>
<a class="dropdown-item" href="https://turinglang.org/docs/changelog.html">
<span class="dropdown-text">Changelog</span></a>
Expand Down Expand Up @@ -806,16 +806,16 @@ <h2 class="anchored" data-anchor-id="contexts-within-contexts">Contexts within c
parameters mean std mcse ess_bulk ess_tail rh ⋯
Symbol Float64 Float64 Float64 Float64 Float64 Float ⋯

a 0.9801 0.8991 0.0032 80302.0693 120963.7357 1.00 ⋯
b 2.8813 0.4882 0.0012 171057.4062 211239.4449 1.00 ⋯
a 0.9713 0.9014 0.0032 80387.2713 119459.5514 1.00 ⋯
b 2.8796 0.4892 0.0012 172170.0034 211488.7837 1.00 ⋯
2 columns omitted

Quantiles
parameters 2.5% 25.0% 50.0% 75.0% 97.5%
Symbol Float64 Float64 Float64 Float64 Float64

a -0.7809 0.3753 0.9800 1.5849 2.7470
b 1.9235 2.5523 2.8808 3.2110 3.8367</code></pre>
a -0.8075 0.3629 0.9732 1.5803 2.7342
b 1.9202 2.5498 2.8803 3.2090 3.8386</code></pre>
</div>
</div>
<p>or we can choose to sample from the prior instead</p>
Expand All @@ -833,16 +833,16 @@ <h2 class="anchored" data-anchor-id="contexts-within-contexts">Contexts within c
parameters mean std mcse ess_bulk ess_tail rha ⋯
Symbol Float64 Float64 Float64 Float64 Float64 Float6 ⋯

a 0.5009 1.0005 0.0040 62561.4267 123775.2029 1.000 ⋯
b 0.5095 2.2395 0.0136 26980.3946 52026.2213 1.000 ⋯
a 0.4977 1.0017 0.0040 64312.4640 127157.3129 1.000 ⋯
b 0.4929 2.2363 0.0135 27644.6544 51960.2825 1.000 ⋯
2 columns omitted

Quantiles
parameters 2.5% 25.0% 50.0% 75.0% 97.5%
Symbol Float64 Float64 Float64 Float64 Float64

a -1.4577 -0.1737 0.5004 1.1752 2.4627
b -3.8849 -0.9977 0.5047 2.0099 4.9284</code></pre>
a -1.4669 -0.1768 0.4980 1.1717 2.4600
b -3.8853 -1.0153 0.4988 2.0051 4.8568</code></pre>
</div>
</div>
<p>Of course, using an MCMC algorithm to sample from the prior is unnecessary and silly (<code>PriorSampler</code> exists, after all), but the point is to illustrate the flexibility of the context system. We could, for instance, use the same setup to implement an <em>Approximate Bayesian Computation</em> (ABC) algorithm.</p>
Expand Down
18 changes: 9 additions & 9 deletions pr-previews/582/developers/compiler/model-manual/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@
</ul>
<ul class="navbar-nav navbar-nav-scroll ms-auto">
<li class="nav-item dropdown ">
<a class="nav-link dropdown-toggle" href="#" id="nav-menu-v0.35" role="link" data-bs-toggle="dropdown" aria-expanded="false">
<span class="menu-text">v0.35</span>
<a class="nav-link dropdown-toggle" href="#" id="nav-menu-v0.36" role="link" data-bs-toggle="dropdown" aria-expanded="false">
<span class="menu-text">v0.36</span>
</a>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="nav-menu-v0.35">
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="nav-menu-v0.36">
<li>
<a class="dropdown-item" href="https://turinglang.org/docs/changelog.html">
<span class="dropdown-text">Changelog</span></a>
Expand Down Expand Up @@ -590,25 +590,25 @@ <h1 class="title">Manually Defining a Model</h1>
Iterations = 501:1:1500
Number of chains = 1
Samples per chain = 1000
Wall duration = 7.04 seconds
Compute duration = 7.04 seconds
Wall duration = 7.59 seconds
Compute duration = 7.59 seconds
parameters = s², m
internals = lp, n_steps, is_accept, acceptance_rate, log_density, hamiltonian_energy, hamiltonian_energy_error, max_hamiltonian_energy_error, tree_depth, numerical_error, step_size, nom_step_size

Summary Statistics
parameters mean std mcse ess_bulk ess_tail rhat e ⋯
Symbol Float64 Float64 Float64 Float64 Float64 Float64 ⋯

s² 2.0777 1.9466 0.1232 306.7184 424.2445 1.0002
m 1.1677 0.8662 0.0452 453.0414 200.2843 0.9991
s² 2.3949 4.5577 0.2982 236.3625 313.1934 1.0074
m 1.1687 0.9203 0.0525 353.5452 198.7300 1.0057
1 column omitted

Quantiles
parameters 2.5% 25.0% 50.0% 75.0% 97.5%
Symbol Float64 Float64 Float64 Float64 Float64

s² 0.6060 1.0819 1.5613 2.4002 6.0355
m -0.5374 0.6642 1.1906 1.6918 2.8883</code></pre>
s² 0.5984 1.0413 1.5606 2.4078 7.7236
m -0.9764 0.6446 1.2060 1.7290 3.0094</code></pre>
</div>
</div>
<p>The subsequent pages in this section will show how the <code>@model</code> macro does this behind-the-scenes.</p>
Expand Down
6 changes: 3 additions & 3 deletions pr-previews/582/developers/contributing/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@
</ul>
<ul class="navbar-nav navbar-nav-scroll ms-auto">
<li class="nav-item dropdown ">
<a class="nav-link dropdown-toggle" href="#" id="nav-menu-v0.35" role="link" data-bs-toggle="dropdown" aria-expanded="false">
<span class="menu-text">v0.35</span>
<a class="nav-link dropdown-toggle" href="#" id="nav-menu-v0.36" role="link" data-bs-toggle="dropdown" aria-expanded="false">
<span class="menu-text">v0.36</span>
</a>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="nav-menu-v0.35">
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="nav-menu-v0.36">
<li>
<a class="dropdown-item" href="https://turinglang.org/docs/changelog.html">
<span class="dropdown-text">Changelog</span></a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@
</ul>
<ul class="navbar-nav navbar-nav-scroll ms-auto">
<li class="nav-item dropdown ">
<a class="nav-link dropdown-toggle" href="#" id="nav-menu-v0.35" role="link" data-bs-toggle="dropdown" aria-expanded="false">
<span class="menu-text">v0.35</span>
<a class="nav-link dropdown-toggle" href="#" id="nav-menu-v0.36" role="link" data-bs-toggle="dropdown" aria-expanded="false">
<span class="menu-text">v0.36</span>
</a>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="nav-menu-v0.35">
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="nav-menu-v0.36">
<li>
<a class="dropdown-item" href="https://turinglang.org/docs/changelog.html">
<span class="dropdown-text">Changelog</span></a>
Expand Down
34 changes: 17 additions & 17 deletions pr-previews/582/developers/inference/abstractmcmc-turing/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,10 @@
</ul>
<ul class="navbar-nav navbar-nav-scroll ms-auto">
<li class="nav-item dropdown ">
<a class="nav-link dropdown-toggle" href="#" id="nav-menu-v0.35" role="link" data-bs-toggle="dropdown" aria-expanded="false">
<span class="menu-text">v0.35</span>
<a class="nav-link dropdown-toggle" href="#" id="nav-menu-v0.36" role="link" data-bs-toggle="dropdown" aria-expanded="false">
<span class="menu-text">v0.36</span>
</a>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="nav-menu-v0.35">
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="nav-menu-v0.36">
<li>
<a class="dropdown-item" href="https://turinglang.org/docs/changelog.html">
<span class="dropdown-text">Changelog</span></a>
Expand Down Expand Up @@ -602,29 +602,29 @@ <h2 class="anchored" data-anchor-id="introduction">Introduction</h2>
<div class="cell-output cell-output-display" data-execution_count="1">
<pre><code>Chains MCMC chain (1000×3×1 Array{Float64, 3}):

Log evidence = -3.79041840250214
Log evidence = -3.805955617828886
Iterations = 1:1:1000
Number of chains = 1
Samples per chain = 1000
Wall duration = 2.53 seconds
Compute duration = 2.53 seconds
Wall duration = 2.7 seconds
Compute duration = 2.7 seconds
parameters = s², m
internals = lp

Summary Statistics
parameters mean std mcse ess_bulk ess_tail rhat e ⋯
Symbol Float64 Float64 Float64 Float64 Float64 Float64 ⋯

2.9640 4.3249 0.1392 975.5271 979.4315 1.0010
m -0.0293 1.6493 0.0562 866.3817 980.8705 1.0010
3.0977 5.7971 0.1850 995.4593 922.2937 1.0014
m 0.0581 1.7188 0.0625 793.8558 863.4556 1.0009
1 column omitted

Quantiles
parameters 2.5% 25.0% 50.0% 75.0% 97.5%
Symbol Float64 Float64 Float64 Float64 Float64

s² 0.5183 1.0963 1.7600 3.1232 13.4226
m -3.4965 -0.9105 0.0040 0.8461 3.2891</code></pre>
s² 0.5130 1.0629 1.6565 3.1671 13.2194
m -3.1368 -0.8680 -0.0056 0.7927 3.5133</code></pre>
</div>
</div>
<p>The function <code>sample</code> is part of the AbstractMCMC interface. As explained in the <a href="../../../developers/inference/abstractmcmc-interface">interface guide</a>, building a sampling method that can be used by <code>sample</code> consists in overloading the structs and functions in <code>AbstractMCMC</code>. The interface guide also gives a standalone example of their implementation, <a href=""><code>AdvancedMH.jl</code></a>.</p>
Expand Down Expand Up @@ -657,7 +657,7 @@ <h2 class="anchored" data-anchor-id="define-a-sampler">1. Define a Sampler</h2>
<div class="cell-output cell-output-display" data-execution_count="1">
<pre><code>Chains MCMC chain (1000×3×1 Array{Float64, 3}):

Log evidence = -3.7603844570199443
Log evidence = -3.6700896131575105
Iterations = 1:1:1000
Number of chains = 1
Samples per chain = 1000
Expand All @@ -667,19 +667,19 @@ <h2 class="anchored" data-anchor-id="define-a-sampler">1. Define a Sampler</h2>
internals = lp

Summary Statistics
parameters mean std mcse ess_bulk ess_tail rhat e
Symbol Float64 Float64 Float64 Float64 Float64 Float64
parameters mean std mcse ess_bulk ess_tail rhat ⋯
Symbol Float64 Float64 Float64 Float64 Float64 Float64 ⋯

s² 2.8716 4.3335 0.1365 936.9000 872.3115 1.0006
m 0.0662 1.7199 0.0568 930.5433 915.3549 1.0000
s² 2.8215 3.9624 0.1205 1056.2117 945.3040 1.0001
m 0.1542 1.6332 0.0520 984.4045 1058.1464 1.0045
1 column omitted

Quantiles
parameters 2.5% 25.0% 50.0% 75.0% 97.5%
Symbol Float64 Float64 Float64 Float64 Float64

s² 0.5286 1.1210 1.7494 3.0363 12.4567
m -2.9889 -0.8848 -0.0387 0.8799 3.7250</code></pre>
s² 0.5414 1.0923 1.7377 3.0253 11.6395
m -2.8622 -0.7685 0.0629 1.0064 3.5412</code></pre>
</div>
</div>
<p>Here <code>sample</code> takes as arguments a <strong>model</strong> <code>mod</code>, an <strong>algorithm</strong> <code>alg</code>, and a <strong>number of samples</strong> <code>n_samples</code>, and returns an instance <code>chn</code> of <code>Chains</code> which can be analysed using the functions in <code>MCMCChains</code>.</p>
Expand Down
Loading

0 comments on commit 2c658d0

Please sign in to comment.