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

Merged
merged 81 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 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
93010f7
Fix setparams_varinfo!! for MH
mhauru Nov 7, 2024
1576d21
Stop hard coding the leafcontext for MH setparams_varinfo!!
mhauru Nov 7, 2024
96674f8
Fix setparams_varinfo!! for ESS
mhauru Nov 7, 2024
69f14ce
Fix the context used by setparams_varinfo!! ESS
mhauru Nov 7, 2024
00bcdd8
Add GibbsContext type stability tests
mhauru Nov 7, 2024
dc5b0cf
Apply suggestions from code review
mhauru Nov 12, 2024
9205788
Merge remote-tracking branch 'origin/master' into mhauru/change-gibbs…
mhauru Nov 12, 2024
fa366d3
Add clarifying comment
mhauru Nov 12, 2024
4e99870
Add setparams_varinfo!! type bounds
mhauru Nov 12, 2024
da7342e
Fix an import
mhauru Nov 12, 2024
14decaf
Style improvement
mhauru Nov 12, 2024
a7317e8
Improve GibbsContext type stability test
mhauru Nov 12, 2024
7e75caa
Add comment to constructor tests
mhauru Nov 12, 2024
16ba3f8
Fix a Gibbs test
mhauru Nov 12, 2024
d35cbce
Document the methods of `varinfo` better
mhauru Nov 12, 2024
5fa9458
Check whether a sampler is a valid Gibbs component
mhauru Nov 13, 2024
80cc62f
Move varinfo methods where they belong
mhauru Nov 13, 2024
053ecfc
Fix calling of child context in GibbsContext
mhauru Nov 13, 2024
d53350d
Fix Selectors and type stability of Gibbs
mhauru Nov 15, 2024
5d401e1
Fix broken short circuit in MH
mhauru Nov 15, 2024
d57c97c
Stop unnecessary use of Val in GibbsContext
mhauru Nov 18, 2024
5bebff2
Enforce GibbsContext being next to a leaf
mhauru Nov 18, 2024
fdf1347
Fix setparams_varinfo!! for ESS
mhauru Nov 19, 2024
8e8ed0d
Fix a small Gibbs bug
mhauru Nov 19, 2024
2cced8b
Fix Gibbs sampler test
mhauru Nov 19, 2024
e1dbf6c
Add back tests that were accidentally commented out
mhauru Nov 20, 2024
41b25f8
Relax a test tolerance
mhauru Nov 20, 2024
583d297
Add a Gibbs test for dynamic model with ESS
mhauru Nov 26, 2024
cc9510c
Use ESS in Gibbs DEMO_MODELS tests
mhauru Nov 26, 2024
310bee9
Add Gibbs component call order test
mhauru Nov 27, 2024
519ff02
Fix Gibbs linking bug, add tests
mhauru Nov 28, 2024
f9ed562
Make Gibbs constructor more flexible
mhauru Nov 28, 2024
7b0d12b
Introduce RepeatSampler
mhauru Nov 28, 2024
4beb463
Switch gold standard sample Gibbs test back to HMC
mhauru Nov 28, 2024
1041449
Clean up RepeatSamplerTests preamble
mhauru Nov 28, 2024
d17e6ed
Fix RepeatSampler in Gibbs bug
mhauru Nov 28, 2024
d22df39
Rename a function in Gibbs
mhauru Nov 28, 2024
2025ef9
Test HMCDA in Gibbs tests
mhauru Nov 28, 2024
38ac128
Simplify is_target_varname
mhauru Nov 29, 2024
7d6a983
Add suggestions from code review
mhauru Nov 29, 2024
39c2f21
Add a couple of issue references
mhauru Nov 29, 2024
fa81f83
Merge remote-tracking branch 'origin/master' into mhauru/change-gibbs…
mhauru Nov 29, 2024
ff09591
Restructure Gibbs inference tests and reduce iteration counts
mhauru Nov 29, 2024
1f5432f
Reduce another iter count in Gibbs tests
mhauru Nov 29, 2024
74f6ac7
Merge remote-tracking branch 'origin/master' into mhauru/change-gibbs…
mhauru Dec 2, 2024
5f21c84
Add an info print to Gibbs tests
mhauru Dec 2, 2024
a15ce2f
Use StableRNG, relax test tolerance
mhauru Dec 3, 2024
5cf43b2
Merge branch 'master' into mhauru/change-gibbs-sampler
penelopeysm Dec 18, 2024
96f8dd4
Fix a kwarg
penelopeysm Dec 18, 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 @@ -34,12 +34,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(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())`.

# Release 0.35.0

## Breaking changes
Expand Down
4 changes: 2 additions & 2 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.5"
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 Down
3 changes: 1 addition & 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 @@ -88,7 +87,6 @@ export @model, # modelling
Emcee,
ESS,
Gibbs,
GibbsConditional,
HMC, # Hamiltonian-like sampling
SGLD,
SGHMC,
Expand All @@ -99,6 +97,7 @@ export @model, # modelling
SMC,
CSMC,
PG,
RepeatSampler,
vi, # variational inference
ADVI,
sample, # inference
Expand Down
16 changes: 0 additions & 16 deletions src/experimental/Experimental.jl

This file was deleted.

Loading
Loading