Skip to content

Commit c699b8c

Browse files
committed
DynamicPPL 0.36
1 parent fc32e10 commit c699b8c

File tree

4 files changed

+26
-7
lines changed

4 files changed

+26
-7
lines changed

HISTORY.md

+20
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
# Release 0.37.2
2+
3+
DynamicPPL compatibility has been bumped to 0.36.
4+
This brings with it a number of changes: the ones most likely to affect you are submodel prefixing and conditioning.
5+
Variables in submodels are now represented correctly with field accessors.
6+
For example:
7+
8+
```julia
9+
using Turing
10+
@model inner() = x ~ Normal()
11+
@model outer() = a ~ to_submodel(inner())
12+
```
13+
14+
`keys(VarInfo(outer()))` now returns `[@varname(a.x)]` instead of `[@varname(var"a.x")]`
15+
16+
Furthermore, you can now either condition on the outer model like `outer() | (@varname(a.x) => 1.0)`, or the inner model like `inner() | (@varname(x) => 1.0)`.
17+
If you use the conditioned inner model as a submodel, the conditioning will still apply correctly.
18+
19+
Please see [the DynamicPPL release notes](https://github.com/TuringLang/DynamicPPL.jl/releases/tag/v0.36.0) for fuller details.
20+
121
# Release 0.37.1
222

323
`maximum_a_posteriori` and `maximum_likelihood` now perform sanity checks on the model before running the optimisation.

Project.toml

+2-2
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.37.1"
3+
version = "0.37.2"
44

55
[deps]
66
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
@@ -62,7 +62,7 @@ Distributions = "0.25.77"
6262
DistributionsAD = "0.6"
6363
DocStringExtensions = "0.8, 0.9"
6464
DynamicHMC = "3.4"
65-
DynamicPPL = "0.35"
65+
DynamicPPL = "0.36"
6666
EllipticalSliceSampling = "0.5, 1, 2"
6767
ForwardDiff = "0.10.3"
6868
Libtask = "0.8.8"

src/mcmc/Inference.jl

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ using ..Essential
44
using DynamicPPL:
55
Metadata,
66
VarInfo,
7-
TypedVarInfo,
87
# TODO(mhauru) all_varnames_grouped_by_symbol isn't exported by DPPL, because it is only
9-
# implemented for TypedVarInfo. It is used by mh.jl. Either refactor mh.jl to not use it
8+
# implemented for NTVarInfo. It is used by mh.jl. Either refactor mh.jl to not use it
109
# or implement it for other VarInfo types and export it from DPPL.
1110
all_varnames_grouped_by_symbol,
1211
syms,
@@ -161,7 +160,7 @@ function externalsampler(
161160
end
162161

163162
# TODO: make a nicer `set_namedtuple!` and move these functions to DynamicPPL.
164-
function DynamicPPL.unflatten(vi::TypedVarInfo, θ::NamedTuple)
163+
function DynamicPPL.unflatten(vi::DynamicPPL.NTVarInfo, θ::NamedTuple)
165164
set_namedtuple!(deepcopy(vi), θ)
166165
return vi
167166
end

test/Project.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"
4040

4141
[compat]
4242
AbstractMCMC = "5"
43-
AbstractPPL = "0.9, 0.10"
43+
AbstractPPL = "0.9, 0.10, 0.11"
4444
AdvancedMH = "0.6, 0.7, 0.8"
4545
AdvancedPS = "=0.6.0"
4646
AdvancedVI = "0.2"
@@ -52,7 +52,7 @@ Combinatorics = "1"
5252
Distributions = "0.25"
5353
DistributionsAD = "0.6.3"
5454
DynamicHMC = "2.1.6, 3.0"
55-
DynamicPPL = "0.35"
55+
DynamicPPL = "0.36"
5656
FiniteDifferences = "0.10.8, 0.11, 0.12"
5757
ForwardDiff = "0.10.12 - 0.10.32, 0.10"
5858
HypothesisTests = "0.11"

0 commit comments

Comments
 (0)