Skip to content

Commit e4cd6a2

Browse files
mhaurupenelopeysmyebaigithub-actions[bot]
authored
Release v0.37 (#2487)
* Bump minor version to v0.37 * Remove selector/space stuff (#2458) * Remove selector stuff from ESS * Remove selector stuff from MH * Remove selector stuff from HMC * Remove selector stuff from Emcee * Remove selector stuff from IS * Add missing getspace methods * Remove selector stuff for particle methods * Fix an HMC selector bug * Code style * Fix Emcee selector bug * Fix typo in ESS tests * Fix some constructor overwrites * Remove unnecessary tests * Remove selector stuff from SGHMC * Remove drop_space and other non-longer-necessary deprecation measures * Bump minor version 0.37. Add a HISTORY.md entry * Apply suggestions from code review Co-authored-by: Penelope Yong <[email protected]> * Remove unnecessary type parameters Co-authored-by: Penelope Yong <[email protected]> * Simplify constructors in particle_mcmc.jl * Remove calls to setgid and updategid --------- Co-authored-by: Penelope Yong <[email protected]> * Bump Mooncake compat to 0.4.95 * Support for DynamicPPL v0.35 (#2488) * Progress towards compat with DPPL v0.35 * More fixing of DPPL v0.35 stuff * Fix LogDensityFunction argument order * More minor bugfixes * [TEMP] Commit Manifest pointing to DynamicPPL#release-0.35 * remove LogDensityProblemsAD (#2490) * Remove LogDensityProblemsAD, part 1 * update Optimisation code to not use LogDensityProblemsAD * Fix field name change * Don't put chunksize=0 * Remove LogDensityProblemsAD dep * Improve OptimLogDensity docstring * Remove unneeded model argument to _optimize * Fix more tests * Remove essential/ad from the list of CI groups * Fix HMC function * more test fixes (#2491) * Remove LogDensityProblemsAD, part 1 * update Optimisation code to not use LogDensityProblemsAD * Fix field name change * Don't put chunksize=0 * Remove LogDensityProblemsAD dep * Improve OptimLogDensity docstring * Remove unneeded model argument to _optimize * Fix more tests * Remove essential/ad from the list of CI groups * Fix HMC function * More test fixes * Remove Manifest * More fixes for DynamicPPL 0.35 (#2494) * Remove test/dynamicppl/compiler.jl * Remove old regression tests * Remove vdemo2 * Fix last test * Add HISTORY.md entry about DPPL 0.35 * Allow ESS to sample variables with different symbols * Update a TODO note --------- Co-authored-by: Penelope Yong <[email protected]> * Fix call to DynamicPPL.initialize_parameters!! * Remove `Zygote` (#2505) * Remove `Zygote`; fix #2504 * Update test/test_utils/ad_utils.jl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Add HISTORY.md entry about removing support for Zygote --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Markus Hauru <[email protected]> Co-authored-by: Penelope Yong <[email protected]> Co-authored-by: Markus Hauru <[email protected]> * Fix a Gibbs test * Clean up exports (#2474) * Regroup exports by package * Export DynamicPPL.returned and DynamicPPL.prefix * Stop exporting @logprob_str and @prob_str * Remove DynamicPPL module export * Remove DynamicPPL.LogDensityFunction re-export * Remove BernoulliLogit, drop support for Distributions < 0.25.77 * Stop blanket re-exporting Libtask and Bijectors * Manually specify AbstractMCMC exports * Format Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Remove Bijectors.ordered export * Re-export LinearAlgebra.I * Replace Turing.Model -> DynamicPPL.Model * Format * Keep exporting LogDensityFunction * Add note in docs * Align Turing exports with docs API page * Fix things like `predict` on docs API page * Fix a Gibbs test * Format * Fix missing Bijectors import * Update docs/src/api.md Co-authored-by: Markus Hauru <[email protected]> * Update docs/src/api.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Clean up broken docs links, remove unneeded deps * Format * Add changelog entry for exports * Clean up exports in essential/Essential * Apply suggestions from code review Co-authored-by: Markus Hauru <[email protected]> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Markus Hauru <[email protected]> Co-authored-by: Markus Hauru <[email protected]> --------- Co-authored-by: Penelope Yong <[email protected]> Co-authored-by: Hong Ge <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 38fa2d6 commit e4cd6a2

Some content is hidden

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

44 files changed

+611
-1827
lines changed

Diff for: .github/workflows/Tests.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ jobs:
2424
test:
2525
# Run some of the slower test files individually. The last one catches everything
2626
# not included in the others.
27-
- name: "essential/ad"
28-
args: "essential/ad.jl"
2927
- name: "mcmc/gibbs"
3028
args: "mcmc/gibbs.jl"
3129
- name: "mcmc/hmc"
@@ -37,7 +35,7 @@ jobs:
3735
- name: "mcmc/ess"
3836
args: "mcmc/ess.jl"
3937
- name: "everything else"
40-
args: "--skip essential/ad.jl mcmc/gibbs.jl mcmc/hmc.jl mcmc/abstractmcmc.jl mcmc/Inference.jl mcmc/ess.jl"
38+
args: "--skip mcmc/gibbs.jl mcmc/hmc.jl mcmc/abstractmcmc.jl mcmc/Inference.jl mcmc/ess.jl"
4139
runner:
4240
# Default
4341
- version: '1'

Diff for: HISTORY.md

+41
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,44 @@
1+
# Release 0.37.0
2+
3+
## Breaking changes
4+
5+
### Gibbs constructors
6+
7+
0.37 removes the old Gibbs constructors deprecated in 0.36.
8+
9+
### Remove Zygote support
10+
11+
Zygote is no longer officially supported as an automatic differentiation backend, and `AutoZygote` is no longer exported. You can continue to use Zygote by importing `AutoZygote` from ADTypes and it may well continue to work, but it is no longer tested and no effort will be expended to fix it if something breaks.
12+
13+
[Mooncake](https://github.com/compintell/Mooncake.jl/) is the recommended replacement for Zygote.
14+
15+
### DynamicPPL 0.35
16+
17+
Turing.jl v0.37 uses DynamicPPL v0.35, which brings with it several breaking changes:
18+
19+
- The right hand side of `.~` must from now on be a univariate distribution.
20+
- Indexing `VarInfo` objects by samplers has been removed completely.
21+
- The order in which nested submodel prefixes are applied has been reversed.
22+
- The arguments for the constructor of `LogDensityFunction` have changed. `LogDensityFunction` also now satisfies the `LogDensityProblems` interface, without needing a wrapper object.
23+
24+
For more details about all of the above, see the changelog of DynamicPPL [here](https://github.com/TuringLang/DynamicPPL.jl/releases/tag/v0.35.0).
25+
26+
### Export list
27+
28+
Turing.jl's export list has been cleaned up a fair bit. This affects what is imported into your namespace when you do an unqualified `using Turing`. You may need to import things more explicitly than before.
29+
30+
- The `DynamicPPL` and `AbstractMCMC` modules are no longer exported. You will need to `import DynamicPPL` or `using DynamicPPL: DynamicPPL` (likewise `AbstractMCMC`) yourself, which in turn means that they have to be made available in your project environment.
31+
32+
- `@logprob_str` and `@prob_str` have been removed following a long deprecation period.
33+
- We no longer re-export everything from `Bijectors` and `Libtask`. To get around this, add `using Bijectors` or `using Libtask` at the top of your script (but we recommend using more selective imports).
34+
35+
+ We no longer export `Bijectors.ordered`. If you were using `ordered`, even Bijectors does not (currently) export this. You will have to manually import it with `using Bijectors: ordered`.
36+
37+
On the other hand, we have added a few more exports:
38+
39+
- `DynamicPPL.returned` and `DynamicPPL.prefix` are exported (for use with submodels).
40+
- `LinearAlgebra.I` is exported for convenience.
41+
142
# Release 0.36.0
243

344
## Breaking changes

Diff for: Project.toml

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "Turing"
22
uuid = "fce5fe82-541a-59a6-adf8-730c64b5f9a0"
3-
version = "0.36.3"
3+
version = "0.37.0"
44

55
[deps]
66
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
@@ -23,7 +23,6 @@ ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
2323
Libtask = "6f1fad26-d15e-5dc8-ae53-837a1d7b8c9f"
2424
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
2525
LogDensityProblems = "6fdf6af0-433a-55f7-b3ed-c6c6e0b8df7c"
26-
LogDensityProblemsAD = "996a588d-648d-4e1f-a8f0-a84b347e47b1"
2726
MCMCChains = "c7f686f2-ff18-58e9-bc7b-31028e88f75d"
2827
NamedArrays = "86f7a689-2022-50b4-a561-43c23ac3c673"
2928
Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba"
@@ -59,17 +58,16 @@ BangBang = "0.4.2"
5958
Bijectors = "0.14, 0.15"
6059
Compat = "4.15.0"
6160
DataStructures = "0.18"
62-
Distributions = "0.23.3, 0.24, 0.25"
61+
Distributions = "0.25.77"
6362
DistributionsAD = "0.6"
6463
DocStringExtensions = "0.8, 0.9"
6564
DynamicHMC = "3.4"
66-
DynamicPPL = "0.34.1"
65+
DynamicPPL = "0.35"
6766
EllipticalSliceSampling = "0.5, 1, 2"
6867
ForwardDiff = "0.10.3"
6968
Libtask = "0.8.8"
7069
LinearAlgebra = "1"
7170
LogDensityProblems = "2"
72-
LogDensityProblemsAD = "1.7.0"
7371
MCMCChains = "5, 6"
7472
NamedArrays = "0.9, 0.10"
7573
Optim = "1"

Diff for: docs/Project.toml

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
[deps]
2-
Bijectors = "76274a88-744f-5084-9051-94815aaf08c4"
3-
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
42
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
53
DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
6-
DynamicPPL = "366bfd00-2699-11ea-058f-f148b4cae6d8"
74
Turing = "fce5fe82-541a-59a6-adf8-730c64b5f9a0"

Diff for: docs/make.jl

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,32 @@
11
using Documenter
22
using Turing
3-
# Need to import Distributions and Bijectors to generate docs for functions
4-
# from those packages.
5-
using Distributions
6-
using Bijectors
7-
using DynamicPPL
83

94
using DocumenterInterLinks
105

116
links = InterLinks(
127
"DynamicPPL" => "https://turinglang.org/DynamicPPL.jl/stable/objects.inv",
13-
"AbstractPPL" => "https://turinglang.org/AbstractPPL.jl/dev/objects.inv",
8+
"AbstractPPL" => "https://turinglang.org/AbstractPPL.jl/stable/objects.inv",
9+
"LinearAlgebra" => "https://docs.julialang.org/en/v1/objects.inv",
10+
"AbstractMCMC" => "https://turinglang.org/AbstractMCMC.jl/stable/objects.inv",
1411
"ADTypes" => "https://sciml.github.io/ADTypes.jl/stable/objects.inv",
1512
"AdvancedVI" => "https://turinglang.org/AdvancedVI.jl/v0.2.8/objects.inv",
1613
"DistributionsAD" => "https://turinglang.org/DistributionsAD.jl/stable/objects.inv",
14+
"OrderedCollections" => "https://juliacollections.github.io/OrderedCollections.jl/stable/objects.inv",
1715
)
1816

1917
# Doctest setup
2018
DocMeta.setdocmeta!(Turing, :DocTestSetup, :(using Turing); recursive=true)
2119

2220
makedocs(;
2321
sitename="Turing",
24-
modules=[Turing, Distributions, Bijectors],
22+
modules=[Turing],
2523
pages=[
2624
"Home" => "index.md",
2725
"API" => "api.md",
2826
"Submodule APIs" =>
2927
["Inference" => "api/Inference.md", "Optimisation" => "api/Optimisation.md"],
3028
],
3129
checkdocs=:exports,
32-
# checkdocs_ignored_modules=[Turing, Distributions, DynamicPPL, AbstractPPL, Bijectors],
3330
doctest=false,
3431
warnonly=true,
3532
plugins=[links],

Diff for: docs/src/api.md

+32-44
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@ Turing.jl directly re-exports the entire public API of the following packages:
66

77
- [Distributions.jl](https://juliastats.org/Distributions.jl)
88
- [MCMCChains.jl](https://turinglang.org/MCMCChains.jl)
9-
- [AbstractMCMC.jl](https://turinglang.org/AbstractMCMC.jl)
10-
- [Bijectors.jl](https://turinglang.org/Bijectors.jl)
11-
- [Libtask.jl](https://github.com/TuringLang/Libtask.jl)
129

1310
Please see the individual packages for their documentation.
1411

1512
## Individual exports and re-exports
1613

17-
**All** of the following symbols are exported unqualified by Turing, even though the documentation suggests that many of them are qualified.
14+
In this API documentation, for the sake of clarity, we have listed the module that actually defines each of the exported symbols.
15+
Note, however, that **all** of the following symbols are exported unqualified by Turing.
1816
That means, for example, you can just write
1917

2018
```julia
@@ -37,17 +35,22 @@ even though [`Prior()`](@ref) is actually defined in the `Turing.Inference` modu
3735

3836
### Modelling
3937

40-
| Exported symbol | Documentation | Description |
41-
|:--------------- |:----------------------------------- |:-------------------------------------------- |
42-
| `@model` | [`DynamicPPL.@model`](@extref) | Define a probabilistic model |
43-
| `@varname` | [`AbstractPPL.@varname`](@extref) | Generate a `VarName` from a Julia expression |
44-
| `to_submodel` | [`DynamicPPL.to_submodel`](@extref) | Define a submodel |
38+
| Exported symbol | Documentation | Description |
39+
|:-------------------- |:------------------------------------------ |:-------------------------------------------------------------------------------------------- |
40+
| `@model` | [`DynamicPPL.@model`](@extref) | Define a probabilistic model |
41+
| `@varname` | [`AbstractPPL.@varname`](@extref) | Generate a `VarName` from a Julia expression |
42+
| `to_submodel` | [`DynamicPPL.to_submodel`](@extref) | Define a submodel |
43+
| `prefix` | [`DynamicPPL.prefix`](@extref) | Prefix all variable names in a model with a given symbol |
44+
| `LogDensityFunction` | [`DynamicPPL.LogDensityFunction`](@extref) | A struct containing all information about how to evaluate a model. Mostly for advanced users |
4545

4646
### Inference
4747

48-
| Exported symbol | Documentation | Description |
49-
|:--------------- |:------------------------------------------------------------------------------------------------ |:------------------- |
50-
| `sample` | [`StatsBase.sample`](https://turinglang.org/AbstractMCMC.jl/stable/api/#Sampling-a-single-chain) | Sample from a model |
48+
| Exported symbol | Documentation | Description |
49+
|:----------------- |:------------------------------------------------------------------------------------------------ |:---------------------------------- |
50+
| `sample` | [`StatsBase.sample`](https://turinglang.org/AbstractMCMC.jl/stable/api/#Sampling-a-single-chain) | Sample from a model |
51+
| `MCMCThreads` | [`AbstractMCMC.MCMCThreads`](@extref) | Run MCMC using multiple threads |
52+
| `MCMCDistributed` | [`AbstractMCMC.MCMCDistributed`](@extref) | Run MCMC using multiple processes |
53+
| `MCMCSerial` | [`AbstractMCMC.MCMCSerial`](@extref) | Run MCMC using without parallelism |
5154

5255
### Samplers
5356

@@ -68,6 +71,7 @@ even though [`Prior()`](@ref) is actually defined in the `Turing.Inference` modu
6871
| `SMC` | [`Turing.Inference.SMC`](@ref) | Sequential Monte Carlo |
6972
| `PG` | [`Turing.Inference.PG`](@ref) | Particle Gibbs |
7073
| `CSMC` | [`Turing.Inference.CSMC`](@ref) | The same as PG |
74+
| `RepeatSampler` | [`Turing.Inference.RepeatSampler`](@ref) | A sampler that runs multiple times on the same variable |
7175
| `externalsampler` | [`Turing.Inference.externalsampler`](@ref) | Wrap an external sampler for use in Turing |
7276

7377
### Variational inference
@@ -88,7 +92,6 @@ See the [AD guide](https://turinglang.org/docs/tutorials/docs-10-using-turing-au
8892
|:----------------- |:------------------------------------ |:---------------------- |
8993
| `AutoForwardDiff` | [`ADTypes.AutoForwardDiff`](@extref) | ForwardDiff.jl backend |
9094
| `AutoReverseDiff` | [`ADTypes.AutoReverseDiff`](@extref) | ReverseDiff.jl backend |
91-
| `AutoZygote` | [`ADTypes.AutoZygote`](@extref) | Zygote.jl backend |
9295
| `AutoMooncake` | [`ADTypes.AutoMooncake`](@extref) | Mooncake.jl backend |
9396

9497
### Debugging
@@ -109,52 +112,37 @@ OrderedLogistic
109112
LogPoisson
110113
```
111114

112-
`BernoulliLogit` is part of Distributions.jl since version 0.25.77.
113-
If you are using an older version of Distributions where this isn't defined, Turing will export the same distribution.
114-
115-
```@docs
116-
Distributions.BernoulliLogit
117-
```
118-
119115
### Tools to work with distributions
120116

121117
| Exported symbol | Documentation | Description |
122118
|:--------------- |:-------------------------------------- |:-------------------------------------------------------------- |
119+
| `I` | [`LinearAlgebra.I`](@extref) | Identity matrix |
123120
| `filldist` | [`DistributionsAD.filldist`](@extref) | Create a product distribution from a distribution and integers |
124121
| `arraydist` | [`DistributionsAD.arraydist`](@extref) | Create a product distribution from an array of distributions |
125122
| `NamedDist` | [`DynamicPPL.NamedDist`](@extref) | A distribution that carries the name of the variable |
126123

127124
### Predictions
128125

129-
```@docs
130-
DynamicPPL.predict
131-
```
126+
| Exported symbol | Documentation | Description |
127+
|:--------------- |:--------------------------------------------------------------------------------- |:------------------------------------------------------- |
128+
| `predict` | [`StatsAPI.predict`](https://turinglang.org/DynamicPPL.jl/stable/api/#Predicting) | Generate samples from posterior predictive distribution |
132129

133130
### Querying model probabilities and quantities
134131

135132
Please see the [generated quantities](https://turinglang.org/docs/tutorials/usage-generated-quantities/) and [probability interface](https://turinglang.org/docs/tutorials/usage-probability-interface/) guides for more information.
136133

137-
| Exported symbol | Documentation | Description |
138-
|:-------------------------- |:--------------------------------------------------------------------------------------------------------------------------------- |:--------------------------------------------------------------- |
139-
| `generated_quantities` | [`DynamicPPL.generated_quantities`](@extref) | Calculate additional quantities defined in a model |
140-
| `pointwise_loglikelihoods` | [`DynamicPPL.pointwise_loglikelihoods`](@extref) | Compute log likelihoods for each sample in a chain |
141-
| `logprior` | [`DynamicPPL.logprior`](@extref) | Compute log prior probability |
142-
| `logjoint` | [`DynamicPPL.logjoint`](@extref) | Compute log joint probability |
143-
| `LogDensityFunction` | [`DynamicPPL.LogDensityFunction`](@extref) | Wrap a Turing model to satisfy LogDensityFunctions.jl interface |
144-
| `condition` | [`AbstractPPL.condition`](@extref) | Condition a model on data |
145-
| `decondition` | [`AbstractPPL.decondition`](@extref) | Remove conditioning on data |
146-
| `conditioned` | [`DynamicPPL.conditioned`](@extref) | Return the conditioned values of a model |
147-
| `fix` | [`DynamicPPL.fix`](@extref) | Fix the value of a variable |
148-
| `unfix` | [`DynamicPPL.unfix`](@extref) | Unfix the value of a variable |
149-
| `OrderedDict` | [`OrderedCollections.OrderedDict`](https://juliacollections.github.io/OrderedCollections.jl/dev/ordered_containers/#OrderedDicts) | An ordered dictionary |
150-
151-
### Extra re-exports from Bijectors
152-
153-
Note that Bijectors itself does not export `ordered`.
154-
155-
```@docs
156-
Bijectors.ordered
157-
```
134+
| Exported symbol | Documentation | Description |
135+
|:-------------------------- |:---------------------------------------------------------------------------------------------------------------------------- |:-------------------------------------------------- |
136+
| `returned` | [`DynamicPPL.returned`](https://turinglang.org/DynamicPPL.jl/stable/api/#DynamicPPL.returned-Tuple%7BModel,%20NamedTuple%7D) | Calculate additional quantities defined in a model |
137+
| `pointwise_loglikelihoods` | [`DynamicPPL.pointwise_loglikelihoods`](@extref) | Compute log likelihoods for each sample in a chain |
138+
| `logprior` | [`DynamicPPL.logprior`](@extref) | Compute log prior probability |
139+
| `logjoint` | [`DynamicPPL.logjoint`](@extref) | Compute log joint probability |
140+
| `condition` | [`AbstractPPL.condition`](@extref) | Condition a model on data |
141+
| `decondition` | [`AbstractPPL.decondition`](@extref) | Remove conditioning on data |
142+
| `conditioned` | [`DynamicPPL.conditioned`](@extref) | Return the conditioned values of a model |
143+
| `fix` | [`DynamicPPL.fix`](@extref) | Fix the value of a variable |
144+
| `unfix` | [`DynamicPPL.unfix`](@extref) | Unfix the value of a variable |
145+
| `OrderedDict` | [`OrderedCollections.OrderedDict`](@extref) | An ordered dictionary |
158146

159147
### Point estimates
160148

0 commit comments

Comments
 (0)