Skip to content

Commit c30e8ac

Browse files
committed
Bump Turing.jl to 0.36 and update all mentions of Gibbs to match
1 parent 0fd362b commit c30e8ac

File tree

8 files changed

+11
-12
lines changed

8 files changed

+11
-12
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"
5555
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
5656

5757
[compat]
58-
Turing = "0.35"
58+
Turing = "0.36"

_quarto.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ website:
3232
text: Team
3333
right:
3434
# Current version
35-
- text: "v0.35"
35+
- text: "v0.36"
3636
menu:
3737
- text: Changelog
3838
href: https://turinglang.org/docs/changelog.html

developers/compiler/design-overview/index.qmd

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,7 @@ not. Let `md` be an instance of `Metadata`:
291291
`md.vns`, `md.ranges`, `md.dists`, `md.orders` and `md.flags`.
292292
- `md.vns[md.idcs[vn]] == vn`.
293293
- `md.dists[md.idcs[vn]]` is the distribution of `vn`.
294-
- `md.gids[md.idcs[vn]]` is the set of algorithms used to sample `vn`. This is used in
295-
the Gibbs sampling process.
294+
- `md.gids[md.idcs[vn]]` is the set of algorithms used to sample `vn`. This was used by the Gibbs sampler. Since Turing v0.36 it is unused and will eventually be deleted.
296295
- `md.orders[md.idcs[vn]]` is the number of `observe` statements before `vn` is sampled.
297296
- `md.ranges[md.idcs[vn]]` is the index range of `vn` in `md.vals`.
298297
- `md.vals[md.ranges[md.idcs[vn]]]` is the linearized vector of values of corresponding to `vn`.

tutorials/01-gaussian-mixture-model/index.qmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ model = gaussian_mixture_model(x);
110110
```
111111

112112
We run a MCMC simulation to obtain an approximation of the posterior distribution of the parameters $\mu$ and $w$ and assignments $k$.
113-
We use a `Gibbs` sampler that combines a [particle Gibbs](https://www.stats.ox.ac.uk/%7Edoucet/andrieu_doucet_holenstein_PMCMC.pdf) sampler for the discrete parameters (assignments $k$) and a Hamiltonion Monte Carlo sampler for the continuous parameters ($\mu$ and $w$).
113+
We use a `Gibbs` sampler that combines a [particle Gibbs](https://www.stats.ox.ac.uk/%7Edoucet/andrieu_doucet_holenstein_PMCMC.pdf) sampler for the discrete parameters (assignments $k$) and a Hamiltonian Monte Carlo sampler for the continuous parameters ($\mu$ and $w$).
114114
We generate multiple chains in parallel using multi-threading.
115115

116116
```{julia}
@@ -121,7 +121,7 @@ setprogress!(false)
121121

122122
```{julia}
123123
#| output: false
124-
sampler = Gibbs(PG(100, :k), HMC(0.05, 10, :μ, :w))
124+
sampler = Gibbs(:k => PG(100), (:μ, :w) => HMC(0.05, 10))
125125
nsamples = 150
126126
nchains = 4
127127
burn = 10

tutorials/04-hidden-markov-model/index.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ setprogress!(false)
135135
```
136136

137137
```{julia}
138-
g = Gibbs(HMC(0.01, 50, :m, :T), PG(120, :s))
138+
g = Gibbs((:m, :T) => HMC(0.01, 50), :s => PG(120))
139139
chn = sample(BayesHmm(y, 3), g, 1000);
140140
```
141141

tutorials/docs-10-using-turing-autodiff/index.qmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ end
5555
c = sample(
5656
gdemo(1.5, 2),
5757
Gibbs(
58-
HMC(0.1, 5, :m; adtype=AutoForwardDiff(; chunksize=0)),
59-
HMC(0.1, 5, :s²; adtype=AutoReverseDiff(false)),
58+
:m => HMC(0.1, 5; adtype=AutoForwardDiff(; chunksize=0)),
59+
:s² => HMC(0.1, 5; adtype=AutoReverseDiff(false)),
6060
),
6161
1000,
6262
progress=false,

tutorials/docs-12-using-turing-guide/index.qmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ We can perform inference by using the `sample` function, the first argument of w
6161
c1 = sample(gdemo(1.5, 2), SMC(), 1000)
6262
c2 = sample(gdemo(1.5, 2), PG(10), 1000)
6363
c3 = sample(gdemo(1.5, 2), HMC(0.1, 5), 1000)
64-
c4 = sample(gdemo(1.5, 2), Gibbs(PG(10, :m), HMC(0.1, 5, :s²)), 1000)
64+
c4 = sample(gdemo(1.5, 2), Gibbs(:m => PG(10), :s² => HMC(0.1, 5)), 1000)
6565
c5 = sample(gdemo(1.5, 2), HMCDA(0.15, 0.65), 1000)
6666
c6 = sample(gdemo(1.5, 2), NUTS(0.65), 1000)
6767
```
@@ -450,7 +450,7 @@ end
450450
451451
simple_choice_f = simple_choice([1.5, 2.0, 0.3])
452452
453-
chn = sample(simple_choice_f, Gibbs(HMC(0.2, 3, :p), PG(20, :z)), 1000)
453+
chn = sample(simple_choice_f, Gibbs(:p => HMC(0.2, 3), :z => PG(20)), 1000)
454454
```
455455

456456
The `Gibbs` sampler can be used to specify unique automatic differentiation backends for different variable spaces. Please see the [Automatic Differentiation]({{<meta using-turing-autodiff>}}) article for more.

tutorials/docs-15-using-turing-sampler-viz/index.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ setprogress!(false)
115115
Gibbs sampling tends to exhibit a "jittery" trajectory. The example below combines `HMC` and `PG` sampling to traverse the posterior.
116116

117117
```{julia}
118-
c = sample(model, Gibbs(HMC(0.01, 5, :s²), PG(20, :m)), 1000)
118+
c = sample(model, Gibbs(:s² => HMC(0.01, 5), :m => PG(20)), 1000)
119119
plot_sampler(c)
120120
```
121121

0 commit comments

Comments
 (0)