Skip to content

Commit c7eacc8

Browse files
fix-merge-conflicts
2 parents e9e14d5 + 7452ca3 commit c7eacc8

File tree

7 files changed

+188
-12
lines changed

7 files changed

+188
-12
lines changed

library/index.qmd

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,58 @@ title: "Turing Libraries"
33
search: false
44
toc: false
55
include-in-header:
6-
- text: |
7-
<style>a {text-decoration: none;}a:hover {text-decoration: underline;}</style>
6+
- text: |
7+
<style>
8+
/* links */
9+
a { text-decoration: none; }
10+
a:hover { text-decoration: underline; }
11+
</style>
12+
13+
<style>
14+
/* responsive wrapper */
15+
.table-responsive {
16+
overflow-x: auto;
17+
margin-bottom: 1rem;
18+
}
19+
20+
/* default (light-mode) table styling */
21+
.packages-table {
22+
width: 100%;
23+
border-collapse: collapse;
24+
background-color: #ffffff;
25+
color: #212529;
26+
}
27+
.packages-table th,
28+
.packages-table td {
29+
padding: 0.75rem 1rem;
30+
text-align: left;
31+
border-bottom: 1px solid #eee;
32+
}
33+
.packages-table thead {
34+
background-color: #f8f8f8;
35+
}
36+
.packages-table tbody tr:nth-child(odd) {
37+
background-color: #fafafa;
38+
}
39+
.packages-table tbody tr:hover {
40+
background-color: #eef9ff;
41+
}
42+
.packages-table th {
43+
font-weight: 600;
44+
}
45+
46+
/* deprecated badge */
47+
.badge.deprecated {
48+
display: inline-block;
49+
margin-left: 0.5em;
50+
padding: 0.2em 0.4em;
51+
font-size: 0.75em;
52+
font-weight: 600;
53+
color: #721c24;
54+
background-color: #f8d7da;
55+
border-radius: 0.2em;
56+
}
57+
</style>
858
listing:
959
- id: libraries-main
1060
template: table.ejs

library/main.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,11 @@
8383
description: "Convenient callbacks for sampling in Turing.jl"
8484
category: utilities
8585
- name: TuringBenchmarking
86-
api: https://turinglang.org/TuringBenchmarking.jl/
87-
github: https://github.com/TuringLang/TuringBenchmarking.jl
86+
api: https://turinglang.org/Deprecated/TuringBenchmarking/
87+
github: https://github.com/TuringLang/Deprecated/tree/main/TuringBenchmarking
8888
description: "Tools to benchmark and check Turing models"
8989
category: utilities
90+
status: deprecated
9091

9192
- name: MCMCChains
9293
api: https://turinglang.org/MCMCChains.jl/

library/table.ejs

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
1-
<table width="100%">
1+
<div class="table-responsive">
2+
<table class="packages-table">
3+
<thead>
4+
<tr>
5+
<th>Package</th>
6+
<th>API</th>
7+
<th>GitHub</th>
8+
<th>Description</th>
9+
</tr>
10+
</thead>
211
<tbody>
312
<% for (const item of items) { %>
413
<tr>
5-
<td style="padding: 5px 5px 5px 0"><span style="font-weight: bold"><%- item.name %></span></td>
6-
<% if (item.api !== "") { %>
7-
<td style="padding: 5px 5px"><a href="<%- item.api %>" target="_blank">API</a></td>
8-
<% } %>
9-
<td style="padding: 5px 5px"><a href="<%- item.github %>" target="_blank">GitHub</a></td>
10-
<td style="padding: 5px 0 5px 5px"><%- item.description %></td>
14+
<td data-label="Package"><%- item.name %><% if(item.status==="deprecated"){ %><span class="badge deprecated">Deprecated</span><% } %></td>
15+
<td data-label="API"><% if(item.api){ %><a href="<%- item.api %>" target="_blank">API</a><% } else { %><% } %></td>
16+
<td data-label="GitHub"><a href="<%- item.github %>" target="_blank">GitHub</a></td>
17+
<td data-label="Description"><%- item.description %></td>
1118
</tr>
1219
<% } %>
1320
</tbody>
1421
</table>
22+
</div>

news/posts/2025-03-14-newsletter-2/index.qmd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ Separately, we are planning to merge the benchmarking utilities in [TuringBenchm
1717

1818
**SSMProblems**
1919

20-
The SSMProblems.jl and GeneralisedFilters.jl packages have now been merged into a single repository: https://github.com/TuringLang/SSMProblems.jl. This won't affect you if you are using the packages from the Julia General registry, but if you're looking to develop off the main branch you may have to use a different URL, or specify a subdirectory in `Pkg.add`.
20+
The SSMProblems.jl and GeneralisedFilters.jl packages have now been merged into a single repository: [https://github.com/TuringLang/SSMProblems.jl](https://github.com/TuringLang/SSMProblems.jl). This won't affect you if you are using the packages from the Julia General registry, but if you're looking to develop off the main branch you may have to use a different URL, or specify a subdirectory in `Pkg.add`.
2121

2222
**Smaller bits**
2323

2424
Other code changes that have been merged:
25+
2526
- Some old code in AdvancedHMC.jl has been cleaned up quite a bit. See the [0.7.0 release](https://github.com/TuringLang/AdvancedHMC.jl/releases/tag/v0.7.0) for more information.
2627
- Turing's Gibbs sampler [now supports warmup steps properly](https://github.com/TuringLang/Turing.jl/pull/2502). We're still thinking about how to properly encode the scenario where different sub-samplers have different numbers of warmup steps, if you have any ideas, do get in touch on that PR.
2728
- We are going to formally remove support for Zygote as an AD backend. We don't test it thoroughly in Turing's test suite. You can of course still use Zygote yourself, simply load `ADTypes.AutoZygote()` — although we can't guarantee that we will fix any bugs that arise.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: Turing.jl Newsletter 5
3+
description: The fortnightly newsletter for the Turing.jl probabilistic programming language
4+
categories:
5+
- Newsletter
6+
author:
7+
- name: The TuringLang team
8+
url: /team/
9+
date: 2025-04-25
10+
---
11+
12+
**DynamicPPL 0.36**
13+
14+
A new minor version of DynamicPPL brings with it a few changes especially to the behaviour of submodels. These have not yet percolated up to Turing.jl, but will soon be. Firstly, prefixing behaviour is changed: consider these models
15+
16+
```julia
17+
@model function inner()
18+
x ~ Normal()
19+
end
20+
@model function outer()
21+
a = [0.0]
22+
a[1] ~ to_submodel(inner())
23+
end
24+
```
25+
26+
If you ran this model, you would find that the single random variable was called `a[1].x` — but this isn't the `x` field of the `1`st element of `a`, it's actually a variable whose name is literally just `Symbol("a[1].x")`. DynamicPPL changes this behaviour such that the variable is correctly recognised as the `x` field of the `1`st element of `a`. This means that if you are trying to, for example, condition on the variable, you can do:
27+
28+
```julia
29+
outer() | (@varname(a[1].x) => 1.0)
30+
```
31+
32+
On the topic of conditioning, you can now also correctly condition or fix variables in a model before using it as a submodel, as this example demonstrates:
33+
34+
```julia
35+
@model function inner()
36+
x ~ Normal()
37+
end
38+
@model function outer()
39+
a ~ to_submodel(inner() | (@varname(x) => 1))
40+
end
41+
```
42+
43+
Previously, if you wanted to do this, you would have to condition on `@varname(a.x)`, meaning that you'd need to know the prefix before conditioning it. The current system allows for more modular construction of nested models.
44+
45+
For more complete details, please see [the release notes](https://github.com/TuringLang/DynamicPPL.jl/releases/tag/v0.36.0).
46+
47+
**TuringBenchmarking.jl**
48+
49+
DynamicPPL 0.36 also brings new functionality that can be used for testing and benchmarking automatic differentiation on Turing models. This is what powers the [ADTests table](https://turinglang.org/ADTests/), which we shared last time round. (Psst — there are more examples now than before!)
50+
51+
For more information, see the docstring of `DynamicPPL.TestUtils.AD.run_ad` in [the DynamicPPL docs](https://turinglang.org/DynamicPPL.jl/stable/api/#DynamicPPL.TestUtils.AD.run_ad).
52+
53+
As a corollary of this, the AD benchmarking functionalities in TuringBenchmarking.jl are not really needed anymore. If you are using this package, we recommend that you switch over to use the functionality that's directly built into DynamicPPL.
54+
55+
**AdvancedHMC compatibility with ComponentArrays**
56+
57+
AdvancedHMC had a fairly long-standing issue where it couldn't always be used with ComponentArrays as the position / momentum. This has now been fixed; you can take a look at [the test suite](https://github.com/TuringLang/AdvancedHMC.jl/blob/459ebb8a10cc1bc7dbbc27ed79afa796c607697a/test/hamiltonian.jl#L77-L100) to see examples of how they can be used together.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: Turing.jl Newsletter 6
3+
description: The fortnightly newsletter for the Turing.jl probabilistic programming language
4+
categories:
5+
- Newsletter
6+
author:
7+
- name: The TuringLang team
8+
url: /team/
9+
date: 2025-05-09
10+
---
11+
12+
Turing v0.38 has just been released and incorporates the changes from DynamicPPL which were mentioned [in the last newsletter](/news/posts/2025-04-25-newsletter-5). It also contains a fix for the Gibbs sampler, so that you can now specify arbitrary VarNames for each sampler (previously, you could only specify single-symbol VarNames). For example, you can now specify the `a.x` and `b.x` VarNames here:
13+
14+
```julia
15+
@model function inner()
16+
x ~ Normal()
17+
end
18+
@model function outer()
19+
a ~ to_submodel(inner())
20+
b ~ to_submodel(inner())
21+
end
22+
sample(outer(), Gibbs(@varname(a.x) => MH(), @varname(b.x) => MH()), 100)
23+
```
24+
25+
It is theoretically possible that this will be slow for VarNames that involve indexing (e.g. `x[1]`), although we don't have an example of this yet. If you find anything you think should be faster, let us know.
26+
27+
One other minor point: [on ADTests](https://turinglang.org/ADTests/) you can now hover over a model name to see its definition.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: Turing.jl Newsletter 7
3+
description: The fortnightly newsletter for the Turing.jl probabilistic programming language
4+
categories:
5+
- Newsletter
6+
author:
7+
- name: The TuringLang team
8+
url: /team/
9+
date: 2025-05-23
10+
---
11+
12+
**MCMCChains@7**
13+
14+
There's a new major version of [MCMCChains.jl](https://github.com/TuringLang/MCMCChains.jl).
15+
From a user point of view, the main difference is that summary statistics and quantiles aren't automatically calculated by default (so, printing a `Chains` object in a REPL will only show the parameter names and sizes).
16+
To get the summary statistics and quantiles you will have to run `describe(chain)`.
17+
The main reason for this is because the summary stats would often take quite a while to compute — if you wish to preserve the old behaviour you can stick to MCMCChains@6.
18+
19+
**JuliaBUGS `@model`**
20+
21+
[JuliaBUGS.jl](https://github.com/TuringLang/JuliaBUGS.jl) recently implemented a `@model` macro which, in terms of its syntax, looks somewhat similar to Turing.jl's own macro, but under the hood constructs a BUGS model.
22+
Perhaps of interest is the way that parameters are initialised using `@parameters struct ... end`; this currently helps to initialise all parameter values to placeholders, and offers an alternative to explicitly specifying this with NamedTuples or arrays.
23+
This hasn't yet been released but for more information and a demonstration, there's [a documentation page](https://github.com/TuringLang/JuliaBUGS.jl/blob/main/docs/src/julia_syntax.md) that describes the design of this macro.
24+
The existing `@bugs` macro will still be retained.
25+
26+
**Libtask**
27+
28+
[Libtask.jl](https://github.com/TuringLang/Libtask.jl), the library that Turing’s particle Gibbs sampler is built on, was recently rewritten for its core parts by Will Tebbutt ([#179](https://github.com/TuringLang/Libtask.jl/pull/179).
29+
Libtask implements copyable, resumable tasks (coroutines) in pure Julia, and the new version is much faster and better documented.
30+
The new implementation is based on source code transformations, using tools and techniques from [Mooncake.jl](https://github.com/chalk-lab/Mooncake.jl).
31+
[Work](https://github.com/TuringLang/AdvancedPS.jl/pull/114) is ongoing to adapt AdvancedPS.jl to work with the new Libtask version, and once that is done we should expect a performance boost for Turing’s particle Gibbs sampler.
32+
We’ll let you know once that’s out.

0 commit comments

Comments
 (0)