Skip to content

Commit 523428a

Browse files
mhaurupenelopeysm
andauthored
Turing v0.36 and removal of Pathfinder code (#579)
* Bump Turing.jl to 0.36 and update all mentions of Gibbs to match * Replace Pathfinder example code with a link to Pathfinder docs * Update Manifest.toml * Bump Turing compat to 0.36.2 * Regenerate Manifest.toml with TuringBenchmarking.jl v0.5.8 * Update dependencies * Host golf.dat file ourselves --------- Co-authored-by: Penelope Yong <[email protected]>
1 parent c939949 commit 523428a

File tree

12 files changed

+273
-271
lines changed

12 files changed

+273
-271
lines changed

Manifest.toml

Lines changed: 237 additions & 221 deletions
Large diffs are not rendered by default.

Project.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ AdvancedMH = "5b7e9947-ddc0-4b3f-9b55-0d8042f74170"
77
Bijectors = "76274a88-744f-5084-9051-94815aaf08c4"
88
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
99
ComponentArrays = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
10-
DataDeps = "124859b0-ceae-595e-8997-d05f6a7a8dfe"
1110
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
1211
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
1312
DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa"
@@ -39,7 +38,6 @@ Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba"
3938
OptimizationNLopt = "4e6fcdb7-1186-4e1f-a706-475e75c168bb"
4039
OptimizationOptimJL = "36348300-93cb-4f02-beb5-3c3902f8871e"
4140
PDMats = "90014a1f-27ba-587c-ab20-58faa44d9150"
42-
Pathfinder = "b1d3bc72-d0e7-4279-b92f-7fa5d6d2d454"
4341
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
4442
RDatasets = "ce6b1742-4840-55fa-b093-852dadbb1d8b"
4543
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
@@ -55,4 +53,4 @@ UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"
5553
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
5654

5755
[compat]
58-
Turing = "0.35"
56+
Turing = "0.36.2"

_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

core-functionality/index.qmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ We can perform inference by using the `sample` function, the first argument of w
6363
c1 = sample(gdemo(1.5, 2), SMC(), 1000)
6464
c2 = sample(gdemo(1.5, 2), PG(10), 1000)
6565
c3 = sample(gdemo(1.5, 2), HMC(0.1, 5), 1000)
66-
c4 = sample(gdemo(1.5, 2), Gibbs(PG(10, :m), HMC(0.1, 5, :s²)), 1000)
66+
c4 = sample(gdemo(1.5, 2), Gibbs(:m => PG(10), :s² => HMC(0.1, 5)), 1000)
6767
c5 = sample(gdemo(1.5, 2), HMCDA(0.15, 0.65), 1000)
6868
c6 = sample(gdemo(1.5, 2), NUTS(0.65), 1000)
6969
```
@@ -452,7 +452,7 @@ end
452452
453453
simple_choice_f = simple_choice([1.5, 2.0, 0.3])
454454
455-
chn = sample(simple_choice_f, Gibbs(HMC(0.2, 3, :p), PG(20, :z)), 1000)
455+
chn = sample(simple_choice_f, Gibbs(:p => HMC(0.2, 3), :z => PG(20)), 1000)
456456
```
457457

458458
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.

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/gaussian-mixture-models/index.qmd

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

114114
We run a MCMC simulation to obtain an approximation of the posterior distribution of the parameters $\mu$ and $w$ and assignments $k$.
115-
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$).
115+
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$).
116116
We generate multiple chains in parallel using multi-threading.
117117

118118
```{julia}
@@ -123,7 +123,7 @@ setprogress!(false)
123123

124124
```{julia}
125125
#| output: false
126-
sampler = Gibbs(PG(100, :k), HMC(0.05, 10, :μ, :w))
126+
sampler = Gibbs(:k => PG(100), (:μ, :w) => HMC(0.05, 10))
127127
nsamples = 150
128128
nchains = 4
129129
burn = 10
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
distance n y
2+
2 1443 1346
3+
3 694 577
4+
4 455 337
5+
5 353 208
6+
6 272 149
7+
7 256 136
8+
8 240 111
9+
9 217 69
10+
10 200 67
11+
11 237 75
12+
12 202 52
13+
13 192 46
14+
14 174 54
15+
15 167 28
16+
16 201 27
17+
17 195 31
18+
18 191 33
19+
19 147 20
20+
20 152 24

tutorials/gaussian-processes-introduction/index.qmd

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,9 @@ given distance.
3030
### Let's download the data and take a look at it:
3131

3232
```{julia}
33-
using CSV, DataDeps, DataFrames
34-
35-
ENV["DATADEPS_ALWAYS_ACCEPT"] = true
36-
register(
37-
DataDep(
38-
"putting",
39-
"Putting data from BDA",
40-
"http://www.stat.columbia.edu/~gelman/book/data/golf.dat",
41-
"fc28d83896af7094d765789714524d5a389532279b64902866574079c1a977cc",
42-
),
43-
)
44-
45-
fname = joinpath(datadep"putting", "golf.dat")
46-
df = CSV.read(fname, DataFrame; delim=' ', ignorerepeated=true)
33+
using CSV, DataFrames
34+
35+
df = CSV.read("golf.dat", DataFrame; delim=' ', ignorerepeated=true)
4736
df[1:5, :]
4837
```
4938

tutorials/hidden-markov-models/index.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ setprogress!(false)
137137
```
138138

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

usage/automatic-differentiation/index.qmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ end
5757
c = sample(
5858
gdemo(1.5, 2),
5959
Gibbs(
60-
HMC(0.1, 5, :m; adtype=AutoForwardDiff(; chunksize=0)),
61-
HMC(0.1, 5, :s²; adtype=AutoReverseDiff(false)),
60+
:m => HMC(0.1, 5; adtype=AutoForwardDiff(; chunksize=0)),
61+
:s² => HMC(0.1, 5; adtype=AutoReverseDiff(false)),
6262
),
6363
1000,
6464
progress=false,

0 commit comments

Comments
 (0)