Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace old Gibbs sampler with the experimental one. #2328

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5948253
Replace old Gibbs sampler with the experimental one.
mhauru Sep 23, 2024
5a3e4a6
Remove dead references to experimental
mhauru Sep 23, 2024
09c739d
Remove mention of experimental from JuliaFormatter conf
mhauru Sep 23, 2024
58ebb25
Add tests for deprecated constructor
mhauru Sep 24, 2024
7715732
Fix deprecated Gibbs constructors. Add HISTORY entry.
mhauru Sep 24, 2024
672f7d9
Bump version to 0.35.0
mhauru Sep 24, 2024
7bf5abe
Add Gibbs constructor test for repeat samplers
mhauru Sep 24, 2024
85bcfa5
Fix typo in test/mcmc/ess.jl
mhauru Sep 24, 2024
6f9679a
Use provided rng to initialise VarInfo in Gibbs
mhauru Sep 24, 2024
f247ad9
Fix a typo in GibbsContext
mhauru Oct 8, 2024
a790363
Merge remote-tracking branch 'origin/master' into mhauru/change-gibbs…
mhauru Oct 11, 2024
d19afe1
Fix the Gibbs sampler
mhauru Oct 11, 2024
19598c4
Fix the Gibbs sampler more
mhauru Oct 17, 2024
71f26ca
Remove mentions of old Gibbs sampler from MH docs
mhauru Oct 18, 2024
2454cf1
Merge remote-tracking branch 'origin/master' into mhauru/change-gibbs…
mhauru Oct 21, 2024
d0f57ac
Bump DPPL to 0.28.6
mhauru Oct 21, 2024
1bd0794
Merge remote-tracking branch 'origin/master' into mhauru/change-gibbs…
mhauru Oct 24, 2024
6f5b273
Merge remote-tracking branch 'origin/master' into mhauru/change-gibbs…
mhauru Oct 24, 2024
74b57e7
Redesign GibbsContext, work in progress
mhauru Oct 28, 2024
b16daf5
Fixing new Gibbs, adding a broken test
mhauru Oct 28, 2024
de9e7da
Merge remote-tracking branch 'origin/master' into mhauru/change-gibbs…
mhauru Oct 28, 2024
af802dc
Document and clean up GibbsContext
mhauru Oct 28, 2024
e58d935
Code style and docs improvements to Gibbs
mhauru Oct 28, 2024
b8c3dcd
Change how AdvancedHMC Gibbs state treats momenta
mhauru Oct 29, 2024
da0b740
Remove unnecessary invlinking
mhauru Oct 29, 2024
d984d2b
Change how AdvancedHMC Gibbs state treats momenta, again
mhauru Oct 29, 2024
410d74d
Merge remote-tracking branch 'origin/master' into mhauru/change-gibbs…
mhauru Oct 29, 2024
15ee270
Merge remote-tracking branch 'origin/master' into mhauru/change-gibbs…
mhauru Oct 30, 2024
d52af52
Use setparams!! rather than reset_state!!
mhauru Nov 1, 2024
508ac61
Don't overload setparams\!\! with VarInfo
mhauru Nov 4, 2024
6ff7c59
A fix for ESS in Gibbs
mhauru Nov 5, 2024
934c03e
Remove recompute_logprob!!
mhauru Nov 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
style="blue"
format_markdown = true
import_to_using = false
# TODO
# We ignore these files because when formatting was first put in place they were being worked on.
# These ignores should be removed once the relevant PRs are merged/closed.
ignore = [
# https://github.com/TuringLang/Turing.jl/pull/2328/files
"src/experimental/gibbs.jl",
"test/experimental/gibbs.jl",
]
4 changes: 1 addition & 3 deletions .github/workflows/Tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,10 @@ jobs:
args: "mcmc/abstractmcmc.jl"
- name: "mcmc/Inference"
args: "mcmc/Inference.jl"
- name: "experimental/gibbs"
args: "experimental/gibbs.jl"
- name: "mcmc/ess"
args: "mcmc/ess.jl"
- name: "everything else"
args: "--skip essential/ad.jl mcmc/gibbs.jl mcmc/hmc.jl mcmc/abstractmcmc.jl mcmc/Inference.jl experimental/gibbs.jl mcmc/ess.jl"
args: "--skip essential/ad.jl mcmc/gibbs.jl mcmc/hmc.jl mcmc/abstractmcmc.jl mcmc/Inference.jl mcmc/ess.jl"
runner:
# Default
- version: '1'
Expand Down
16 changes: 16 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# Release 0.36.0

## Breaking changes

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

The new Gibbs sampler supports the same user-facing interface as the old one. However, given
that the internals of it having been completely rewritten in a very different manner, there
may be accidental breakage that we haven't anticipated. Please report any you find.

`GibbsConditional` has also been removed. It was never very user-facing, but it was exported, so technically this is breaking.

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.

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)`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gibbs(@varname(x) => hmc, @varname(x) => hmc, @varname(y) => mh)

This looks rather awkward. Can we introduce a simple wrapper, Repeated and support:

Gibbs(@varname(x) => Repeated(hmc, n), @varname(y) => mh)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. We had a chat about a closely related issue with @torfjelde too, I'll rework the interface around this a bit.


# Release 0.35.0

## Breaking changes
Expand Down
6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Turing"
uuid = "fce5fe82-541a-59a6-adf8-730c64b5f9a0"
version = "0.35.1"
version = "0.36.0"

[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
Expand Down Expand Up @@ -49,7 +49,7 @@ TuringOptimExt = "Optim"

[compat]
ADTypes = "1.9"
AbstractMCMC = "5.2"
AbstractMCMC = "5.5"
Accessors = "0.1"
AdvancedHMC = "0.3.0, 0.4.0, 0.5.2, 0.6"
AdvancedMH = "0.8"
Expand All @@ -63,7 +63,7 @@ Distributions = "0.23.3, 0.24, 0.25"
DistributionsAD = "0.6"
DocStringExtensions = "0.8, 0.9"
DynamicHMC = "3.4"
DynamicPPL = "0.29, 0.30.2"
DynamicPPL = "0.30.2"
EllipticalSliceSampling = "0.5, 1, 2"
ForwardDiff = "0.10.3"
Libtask = "0.8.8"
Expand Down
2 changes: 0 additions & 2 deletions src/Turing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ using .Variational
include("optimisation/Optimisation.jl")
using .Optimisation

include("experimental/Experimental.jl")
include("deprecated.jl") # to be removed in the next minor version release

###########
Expand Down Expand Up @@ -86,7 +85,6 @@ export @model, # modelling
Emcee,
ESS,
Gibbs,
GibbsConditional,
HMC, # Hamiltonian-like sampling
SGLD,
SGHMC,
Expand Down
16 changes: 0 additions & 16 deletions src/experimental/Experimental.jl

This file was deleted.

Loading
Loading