Skip to content

Commit 7607955

Browse files
committed
Merge remote-tracking branch 'origin/main' into mhauru/dppl-0.37
2 parents 7948bc5 + add8870 commit 7607955

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1849
-5819
lines changed

.JuliaFormatter.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
style="blue"
22
format_markdown = true
33
import_to_using = false
4+
ignore = ["README.md"]

.github/workflows/Docs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- main
77
tags: '*'
88
pull_request:
9+
merge_group:
10+
types: [checks_requested]
11+
workflow_dispatch:
912

1013
concurrency:
1114
# Skip intermediate builds: always.

.github/workflows/Tests.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
branches:
66
- main
77
pull_request:
8+
merge_group:
9+
types: [checks_requested]
810

911
# Cancel existing tests on the same PR if a new commit is added to a pull request
1012
concurrency:
@@ -26,16 +28,12 @@ jobs:
2628
# not included in the others.
2729
- name: "mcmc/gibbs"
2830
args: "mcmc/gibbs.jl"
29-
- name: "mcmc/hmc"
30-
args: "mcmc/hmc.jl"
31-
- name: "mcmc/abstractmcmc"
32-
args: "mcmc/abstractmcmc.jl"
3331
- name: "mcmc/Inference"
3432
args: "mcmc/Inference.jl"
35-
- name: "mcmc/ess"
36-
args: "mcmc/ess.jl"
33+
- name: "ad"
34+
args: "ad.jl"
3735
- name: "everything else"
38-
args: "--skip mcmc/gibbs.jl mcmc/hmc.jl mcmc/abstractmcmc.jl mcmc/Inference.jl mcmc/ess.jl"
36+
args: "--skip mcmc/gibbs.jl mcmc/Inference.jl ad.jl"
3937
runner:
4038
# Default
4139
- version: '1'

CITATION.bib

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
1-
@inproceedings{ge2018t,
2-
author = {Hong Ge and
3-
Kai Xu and
4-
Zoubin Ghahramani},
5-
title = {Turing: a language for flexible probabilistic inference},
6-
booktitle = {International Conference on Artificial Intelligence and Statistics,
7-
{AISTATS} 2018, 9-11 April 2018, Playa Blanca, Lanzarote, Canary Islands,
8-
Spain},
9-
pages = {1682--1690},
10-
year = {2018},
11-
url = {http://proceedings.mlr.press/v84/ge18b.html},
12-
biburl = {https://dblp.org/rec/bib/conf/aistats/GeXG18},
1+
@article{10.1145/3711897,
2+
author = {Fjelde, Tor Erlend and Xu, Kai and Widmann, David and Tarek, Mohamed and Pfiffer, Cameron and Trapp, Martin and Axen, Seth D. and Sun, Xianda and Hauru, Markus and Yong, Penelope and Tebbutt, Will and Ghahramani, Zoubin and Ge, Hong},
3+
title = {Turing.jl: a general-purpose probabilistic programming language},
4+
year = {2025},
5+
publisher = {Association for Computing Machinery},
6+
address = {New York, NY, USA},
7+
url = {https://doi.org/10.1145/3711897},
8+
doi = {10.1145/3711897},
9+
note = {Just Accepted},
10+
journal = {ACM Trans. Probab. Mach. Learn.},
11+
month = feb,
12+
}
13+
14+
@InProceedings{pmlr-v84-ge18b,
15+
title = {Turing: A Language for Flexible Probabilistic Inference},
16+
author = {Ge, Hong and Xu, Kai and Ghahramani, Zoubin},
17+
booktitle = {Proceedings of the Twenty-First International Conference on Artificial Intelligence and Statistics},
18+
pages = {1682--1690},
19+
year = {2018},
20+
editor = {Storkey, Amos and Perez-Cruz, Fernando},
21+
volume = {84},
22+
series = {Proceedings of Machine Learning Research},
23+
month = {09--11 Apr},
24+
publisher = {PMLR},
25+
pdf = {http://proceedings.mlr.press/v84/ge18b/ge18b.pdf},
26+
url = {https://proceedings.mlr.press/v84/ge18b.html},
1327
}

HISTORY.md

Lines changed: 91 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,78 @@
1-
# Release 0.38.0
1+
# 0.39.5
2+
3+
Fixed a bug where sampling with an `externalsampler` would not set the log probability density inside the resulting chain.
4+
Note that there are still potentially bugs with the log-Jacobian term not being correctly included.
5+
A fix is being worked on.
6+
7+
# 0.39.4
8+
9+
Bumped compatibility of AbstractPPL to include 0.12.
10+
11+
# 0.39.3
12+
13+
Improved the performance of `Turing.Inference.getparams` when called with an untyped VarInfo as the second argument, by first converting to a typed VarInfo.
14+
This makes, for example, the post-sampling Chains construction for `Prior()` run much faster.
15+
16+
# 0.39.2
17+
18+
Fixed a bug in the support of `OrderedLogistic` (by changing the minimum from 0 to 1).
19+
20+
# 0.39.1
21+
22+
No changes from 0.39.0 — this patch is released just to re-trigger a Documenter.jl run.
23+
24+
# 0.39.0
25+
26+
## Update to the AdvancedVI interface
27+
28+
Turing's variational inference interface was updated to match version 0.4 version of AdvancedVI.jl.
29+
30+
AdvancedVI v0.4 introduces various new features:
31+
32+
- location-scale families with dense scale matrices,
33+
- parameter-free stochastic optimization algorithms like `DoG` and `DoWG`,
34+
- proximal operators for stable optimization,
35+
- the sticking-the-landing control variate for faster convergence, and
36+
- the score gradient estimator for non-differentiable targets.
37+
38+
Please see the [Turing API documentation](https://turinglang.org/Turing.jl/stable/api/#Variational-inference), and [AdvancedVI's documentation](https://turinglang.org/AdvancedVI.jl/stable/), for more details.
39+
40+
## Removal of Turing.Essential
41+
42+
The Turing.Essential module has been removed.
43+
Anything exported from there can be imported from either `Turing` or `DynamicPPL`.
44+
45+
## `@addlogprob!`
46+
47+
The `@addlogprob!` macro is now exported from Turing, making it officially part of the public interface.
48+
49+
# 0.38.6
50+
51+
Added compatibility with AdvancedHMC 0.8.
52+
53+
# 0.38.5
54+
55+
Added compatibility with ForwardDiff v1.
56+
57+
# 0.38.4
58+
59+
The minimum Julia version was increased to 1.10.2 (from 1.10.0).
60+
On versions before 1.10.2, `sample()` took an excessively long time to run (probably due to compilation).
61+
62+
# 0.38.3
63+
64+
`getparams(::Model, ::AbstractVarInfo)` now returns an empty `Float64[]` if the VarInfo contains no parameters.
65+
66+
# 0.38.2
67+
68+
Bump compat for `MCMCChains` to `7`.
69+
By default, summary statistics and quantiles for chains are no longer printed; to access these you should use `describe(chain)`.
70+
71+
# 0.38.1
72+
73+
The method `Bijectors.bijector(::DynamicPPL.Model)` was moved to DynamicPPL.jl.
74+
75+
# 0.38.0
276

377
## DynamicPPL version
478

@@ -38,12 +112,12 @@ Performance for the cases which used to previously work (i.e. `VarName`s like `x
38112
It is possible that `VarNames` with indexing (e.g. `x[1]`) may be slower (although this is still an improvement over not working at all!).
39113
If you find any cases where you think the performance is worse than it should be, please do file an issue.
40114

41-
# Release 0.37.1
115+
# 0.37.1
42116

43117
`maximum_a_posteriori` and `maximum_likelihood` now perform sanity checks on the model before running the optimisation.
44118
To disable this, set the keyword argument `check_model=false`.
45119

46-
# Release 0.37.0
120+
# 0.37.0
47121

48122
## Breaking changes
49123

@@ -84,7 +158,7 @@ On the other hand, we have added a few more exports:
84158
- `DynamicPPL.returned` and `DynamicPPL.prefix` are exported (for use with submodels).
85159
- `LinearAlgebra.I` is exported for convenience.
86160

87-
# Release 0.36.0
161+
# 0.36.0
88162

89163
## Breaking changes
90164

@@ -98,7 +172,7 @@ The old Gibbs constructor relied on being called with several subsamplers, and e
98172

99173
Likewise, the old constructor for calling one subsampler more often than another, `Gibbs((HMC(0.01, 4, :x), 2), (MH(:y), 1))` has been deprecated. The new way to do this is to use `RepeatSampler`, also introduced at this version: `Gibbs(@varname(x) => RepeatSampler(HMC(0.01, 4), 2), @varname(y) => MH())`.
100174

101-
# Release 0.35.0
175+
# 0.35.0
102176

103177
## Breaking changes
104178

@@ -109,7 +183,7 @@ You can use Mooncake.jl by passing `adbackend=AutoMooncake(; config=nothing)` to
109183

110184
Support for Tracker.jl as an AD backend has been removed.
111185

112-
# Release 0.33.0
186+
# 0.33.0
113187

114188
## Breaking changes
115189

@@ -126,21 +200,21 @@ The same functionality is now offered by the new exported functions
126200
- `maximum_likelihood`
127201
- `maximum_a_posteriori`
128202

129-
# Release 0.30.5
203+
# 0.30.5
130204

131205
- `essential/ad.jl` is removed, `ForwardDiff` and `ReverseDiff` integrations via `LogDensityProblemsAD` are moved to `DynamicPPL` and live in corresponding package extensions.
132206
- `LogDensityProblemsAD.ADgradient(ℓ::DynamicPPL.LogDensityFunction)` (i.e. the single argument method) is moved to `Inference` module. It will create `ADgradient` using the `adtype` information stored in `context` field of ``.
133207
- `getADbackend` function is renamed to `getADType`, the interface is preserved, but packages that previously used `getADbackend` should be updated to use `getADType`.
134208
- `TuringTag` for ForwardDiff is also removed, now `DynamicPPLTag` is defined in `DynamicPPL` package and should serve the same [purpose](https://www.stochasticlifestyle.com/improved-forwarddiff-jl-stacktraces-with-package-tags/).
135209

136-
# Release 0.30.0
210+
# 0.30.0
137211

138212
- [`ADTypes.jl`](https://github.com/SciML/ADTypes.jl) replaced Turing's global AD backend. Users should now specify the desired `ADType` directly in sampler constructors, e.g., `HMC(0.1, 10; adtype=AutoForwardDiff(; chunksize))`, or `HMC(0.1, 10; adtype=AutoReverseDiff(false))` (`false` indicates not to use compiled tape).
139213
- Interface functions such as `ADBackend`, `setadbackend`, `setadsafe`, `setchunksize`, and `setrdcache` are deprecated and will be removed in a future release.
140214
- Removed the outdated `verifygrad` function.
141215
- Updated to a newer version of `LogDensityProblemsAD` (v1.7).
142216

143-
# Release 0.12.0
217+
# 0.12.0
144218

145219
- The interface for defining new distributions with constrained support and making them compatible with `Turing` has changed. To make a custom distribution type `CustomDistribution` compatible with `Turing`, the user needs to define the method `bijector(d::CustomDistribution)` that returns an instance of type `Bijector` implementing the `Bijectors.Bijector` API.
146220
- `~` is now thread-safe when used for observations, but not assumptions (non-observed model parameters) yet.
@@ -153,7 +227,7 @@ The same functionality is now offered by the new exported functions
153227
- The macros `@varinfo`, `@logpdf`, and `@sampler` are removed. Instead, one can access the internal variables `_varinfo`, `_model`, `_sampler`, and `_context` in the `@model` definition.
154228
- Additional constructors for `SMC` and `PG` make it easier to choose the resampling method and threshold.
155229

156-
# Release 0.11.0
230+
# 0.11.0
157231

158232
- Removed some extraneous imports and dependencies ([#1182](https://github.com/TuringLang/Turing.jl/pull/1182))
159233
- Minor backend changes to `sample` and `psample`, which now use functions defined upstream in AbstractMCMC.jl ([#1187](https://github.com/TuringLang/Turing.jl/pull/1187))
@@ -165,11 +239,11 @@ The same functionality is now offered by the new exported functions
165239
- Updates to allow AdvancedHMC 0.2.23 ([#1218](https://github.com/TuringLang/Turing.jl/pull/1218))
166240
- Add more informative error messages for SMC ([#900](https://github.com/TuringLang/Turing.jl/pull/900))
167241

168-
# Release 0.10.1
242+
# 0.10.1
169243

170244
- Fix bug where arrays with mixed integers, floats, and missing values were not being passed to the `MCMCChains.Chains` constructor properly [#1180](https://github.com/TuringLang/Turing.jl/pull/1180).
171245

172-
# Release 0.10.0
246+
# 0.10.0
173247

174248
- Update elliptical slice sampling to use [EllipticalSliceSampling.jl](https://github.com/TuringLang/EllipticalSliceSampling.jl) on the backend. [#1145](https://github.com/TuringLang/Turing.jl/pull/1145). Nothing should change from a front-end perspective -- you can still call `sample(model, ESS(), 1000)`.
175249
- Added default progress loggers in [#1149](https://github.com/TuringLang/Turing.jl/pull/1149).
@@ -180,7 +254,7 @@ The same functionality is now offered by the new exported functions
180254
- Fix bug in VI where the bijectors where being inverted incorrectly [#1168](https://github.com/TuringLang/Turing.jl/pull/1168).
181255
- The Gibbs sampler handles state better by passing `Transition` structs to the local samplers ([#1169](https://github.com/TuringLang/Turing.jl/pull/1169) and [#1166](https://github.com/TuringLang/Turing.jl/pull/1166)).
182256

183-
# Release 0.4.0-alpha
257+
# 0.4.0-alpha
184258

185259
- Fix compatibility with Julia 0.6 [#341, #330, #293]
186260
- Support of Stan interface [#343, #326]
@@ -193,7 +267,7 @@ The same functionality is now offered by the new exported functions
193267
- Add type alias CSMC for PG [#333]
194268
- Fix progress meter [#317]
195269

196-
# Release 0.3
270+
# 0.3
197271

198272
- NUTS implementation #188
199273
- HMC: Transforms of ϵ for each variable #67 (replace with introducing mass matrix)
@@ -205,21 +279,21 @@ The same functionality is now offered by the new exported functions
205279
- Refactoring code: Unify VarInfo, Trace, TaskLocalStorage #96
206280
- Refactoring code: Better gradient interface #97
207281

208-
# Release 0.2
282+
# 0.2
209283

210284
- Gibbs sampler ([#73])
211285
- HMC for constrained variables ([#66]; no support for varying dimensions)
212286
- Added support for `Mamba.Chain` ([#90]): describe, plot etc.
213287
- New interface design ([#55]), ([#104])
214288
- Bugfixes and general improvements (e.g. `VarInfo` [#96])
215289

216-
# Release 0.1.0
290+
# 0.1.0
217291

218292
- Initial support for Hamiltonian Monte Carlo (no support for discrete/constrained variables)
219293
- Require Julia 0.5
220294
- Bugfixes and general improvements
221295

222-
# Release 0.0.1-0.0.4
296+
# 0.0.1-0.0.4
223297

224298
The initial releases of Turing.
225299

Project.toml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
name = "Turing"
22
uuid = "fce5fe82-541a-59a6-adf8-730c64b5f9a0"
3-
version = "0.38.0"
3+
version = "0.39.5"
44

55
[deps]
66
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
77
AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001"
8+
AbstractPPL = "7a57a42e-76ec-4ea3-a279-07e840d6d9cf"
89
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
910
AdvancedHMC = "0bf59076-c3b1-5ca4-86bd-e02cd72cde3d"
1011
AdvancedMH = "5b7e9947-ddc0-4b3f-9b55-0d8042f74170"
@@ -49,11 +50,12 @@ TuringOptimExt = "Optim"
4950
[compat]
5051
ADTypes = "1.9"
5152
AbstractMCMC = "5.5"
53+
AbstractPPL = "0.11, 0.12"
5254
Accessors = "0.1"
53-
AdvancedHMC = "0.3.0, 0.4.0, 0.5.2, 0.6, 0.7"
55+
AdvancedHMC = "0.3.0, 0.4.0, 0.5.2, 0.6, 0.7, 0.8"
5456
AdvancedMH = "0.8"
5557
AdvancedPS = "0.6.0"
56-
AdvancedVI = "0.2"
58+
AdvancedVI = "0.4"
5759
BangBang = "0.4.2"
5860
Bijectors = "0.14, 0.15"
5961
Compat = "4.15.0"
@@ -64,11 +66,11 @@ DocStringExtensions = "0.8, 0.9"
6466
DynamicHMC = "3.4"
6567
DynamicPPL = "0.37"
6668
EllipticalSliceSampling = "0.5, 1, 2"
67-
ForwardDiff = "0.10.3"
69+
ForwardDiff = "0.10.3, 1"
6870
Libtask = "0.8.8"
6971
LinearAlgebra = "1"
7072
LogDensityProblems = "2"
71-
MCMCChains = "5, 6"
73+
MCMCChains = "5, 6, 7"
7274
NamedArrays = "0.9, 0.10"
7375
Optim = "1"
7476
Optimization = "3, 4"
@@ -83,7 +85,7 @@ Statistics = "1.6"
8385
StatsAPI = "1.6"
8486
StatsBase = "0.32, 0.33, 0.34"
8587
StatsFuns = "0.8, 0.9, 1"
86-
julia = "1.10"
88+
julia = "1.10.2"
8789

8890
[extras]
8991
DynamicHMC = "bbc10e6e-7c05-544b-b16e-64fede858acb"

0 commit comments

Comments
 (0)