You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: HISTORY.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,19 @@
1
+
# Release 0.35.0
2
+
3
+
## Breaking changes
4
+
5
+
0.35.0 introduces a new Gibbs sampler. It's been included in several previous releases as `Turing.Experimental.Gibbs`, but now takes over the old Gibbs sampler, which gets removed completely.
6
+
7
+
The new Gibbs sampler supports the same user-facing interface as the old one. However, given
8
+
that the internals of it having been completely rewritten in a very different manner, there
9
+
may be accidental breakage that we haven't anticipated. Please report any you find.
10
+
11
+
`GibbsConditional` has also been removed. It was never very user-facing, but it was exported, so technically this is breaking.
12
+
13
+
The old Gibbs constructor relied on being called with several subsamplers, and each of the constructors of the subsamplers would take as arguments the symbols for the variables that they are to sample, e.g. `Gibbs(HMC(:x), MH(:y))`. This constructor has been deprecated, and will be removed in the future. The new constructor works by assigning samplers to either symbols or `VarNames`, e.g. `Gibbs(; x=HMC(), y=MH())` or `Gibbs(@varname(x) => HMC(), @varname(y) => MH())`. This allows more granular specification of which sampler to use for which variable.
14
+
15
+
Likewise, the old constructor for calling one subsampler more often than another, `Gibbs((HMC(:x), 2), (MH(:y), 1))` has been deprecated. The new way to achieve this effect is to list the same sampler multiple times, e.g. as `hmc = HMC(); mh = MH(); Gibbs(@varname(x) => hmc, @varname(x) => hmc, @varname(y) => mh)`.
# The below constructor only serves to provide backwards compatibility with the constructor
283
-
#of the old Gibbs sampler. It is deprecated and will be removed in the future.
282
+
# The below two constructors only provide backwards compatibility with the constructor of
283
+
# the old Gibbs sampler. They are deprecated and will be removed in the future.
284
284
functionGibbs(algs::InferenceAlgorithm...)
285
-
alg_dict =Dict{Any,InferenceAlgorithm}()
286
-
for alg in algs
285
+
varnames =map(algs) do alg
287
286
space =getspace(alg)
288
-
space_vns =if (space isa Symbol ||space isa VarName)
287
+
if (space isa VarName)
289
288
space
289
+
elseif (space isa Symbol)
290
+
VarName{space}()
290
291
else
291
292
tuple((s isa Symbol ?VarName{s}() : s for s in space)...)
292
293
end
293
-
alg_dict[space_vns] = alg
294
294
end
295
-
Base.depwarn(
296
-
"Specifying which sampler to use with which variable using syntax like `Gibbs(NUTS(:x), MH(:y))` is deprecated and will be removed in the future. Please use `Gibbs(; x=NUTS(), y=MH())` instead.",
297
-
:Gibbs,
295
+
msg = (
296
+
"Specifying which sampler to use with which variable using syntax like "*
297
+
"`Gibbs(NUTS(:x), MH(:y))` is deprecated and will be removed in the future. "*
298
+
"Please use `Gibbs(; x=NUTS(), y=MH())` instead. If you want different iteration "*
0 commit comments