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

Introduction of SwapSampler + make TemperedSampler a fancy version of CompositionSampler #152

Merged
merged 90 commits into from
Mar 11, 2023
Merged
Changes from 1 commit
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
6d8e752
split the transitions and states field in TemperedState
torfjelde Mar 3, 2023
9dcc810
improved internals of CompositionSampler
torfjelde Mar 3, 2023
767d559
ongoing work
torfjelde Mar 4, 2023
58c0376
added swap sampler
torfjelde Mar 4, 2023
0487135
added ordering specification and a TemperedComposition
torfjelde Mar 6, 2023
3e9dbe4
integrated work on TemperedComposition into TemperedSampler and
torfjelde Mar 6, 2023
d7b8096
reorederd stuff so it actually works
torfjelde Mar 6, 2023
86866ac
fixed bug in swapping computation
torfjelde Mar 6, 2023
1006fd8
added length implementation for MultiModel
torfjelde Mar 6, 2023
4f2e20c
improved construct for TemperedSampler and added some convenience met…
torfjelde Mar 6, 2023
8c7a9fd
fixed bundle_samples for Chains and TemperedTransition
torfjelde Mar 6, 2023
53b7df8
fixed breaking bug in setparams_and_logprob!! for SwapState
torfjelde Mar 6, 2023
4ca60ed
remove usage of adapted HMC in tests
torfjelde Mar 6, 2023
92e54de
remove doubling of iterations when testing tempering
torfjelde Mar 6, 2023
8bc5872
fixed bugs with MALA and tempering
torfjelde Mar 7, 2023
940332d
relax atol a bit for HMC
torfjelde Mar 7, 2023
da47bbc
relax another atol
torfjelde Mar 7, 2023
08cf069
TemperedComposition is now truly just a wrapper around a CompositionS…
torfjelde Mar 8, 2023
56e709a
added method for computing roundtrips
torfjelde Mar 8, 2023
e4a15ec
fixed testing + added test for roundtrips
torfjelde Mar 8, 2023
3371002
added docs for roundtrips method
torfjelde Mar 8, 2023
a1e4b7d
added some tests for SwapSampler without tempering
torfjelde Mar 8, 2023
4956fd7
remove ordering from SwapSampler since it should only interact with P…
torfjelde Mar 8, 2023
70f5d8c
simplified the sorting according to chains and processes
torfjelde Mar 8, 2023
a11f1ee
added some comments
torfjelde Mar 8, 2023
ee38580
some minor refactoring
torfjelde Mar 8, 2023
18f8600
some refactoring + TemperedSampler now orders the samplers correctly
torfjelde Mar 9, 2023
8d49045
remove expected_ordering and make ordering assumptions more explicit
torfjelde Mar 9, 2023
fd70d0e
relax type-constraints in state_for_chain so it also works with Tempe…
torfjelde Mar 9, 2023
dac7b06
removed redundant implementations of swap_attempt
torfjelde Mar 9, 2023
2097bb1
rename swap_betas! to swap!
torfjelde Mar 9, 2023
6ceacff
moved swap_attempt as it now requires definition of SwapSampler
torfjelde Mar 9, 2023
b06ddcf
removed unnecessary setparams_and_logprob!! that should never be hit
torfjelde Mar 9, 2023
c7c8f63
removed expected_order
torfjelde Mar 9, 2023
1715eea
Apply suggestions from code review
torfjelde Mar 9, 2023
8c42b82
removed unnecessary variable in tests
torfjelde Mar 9, 2023
a411362
Merge branch 'torfjelde/tempered-sampler-rewamp' of github.com:Turing…
torfjelde Mar 9, 2023
ef97a94
Update src/sampler.jl
torfjelde Mar 9, 2023
ed804c6
Apply suggestions from code review
torfjelde Mar 10, 2023
762fb3b
removed burn-in from step in prep for AbstractMCMC improvements
torfjelde Mar 10, 2023
7883f2a
remove getparams_and_logprob implementation for SwapState as it's
torfjelde Mar 10, 2023
a9bb0de
Merge branch 'torfjelde/tempered-sampler-rewamp' of github.com:Turing…
torfjelde Mar 10, 2023
cf0b27e
split the transitions and states field in TemperedState
torfjelde Mar 3, 2023
96f76b6
improved internals of CompositionSampler
torfjelde Mar 3, 2023
8e9af89
ongoing work
torfjelde Mar 4, 2023
d9424cc
added swap sampler
torfjelde Mar 4, 2023
25d3518
added ordering specification and a TemperedComposition
torfjelde Mar 6, 2023
61d29b2
integrated work on TemperedComposition into TemperedSampler and
torfjelde Mar 6, 2023
a4c2815
reorederd stuff so it actually works
torfjelde Mar 6, 2023
cf166d0
fixed bug in swapping computation
torfjelde Mar 6, 2023
d444975
added length implementation for MultiModel
torfjelde Mar 6, 2023
746f3cf
improved construct for TemperedSampler and added some convenience met…
torfjelde Mar 6, 2023
6df54a2
fixed bundle_samples for Chains and TemperedTransition
torfjelde Mar 6, 2023
2b627bd
fixed breaking bug in setparams_and_logprob!! for SwapState
torfjelde Mar 6, 2023
1b89157
remove usage of adapted HMC in tests
torfjelde Mar 6, 2023
8d9e466
remove doubling of iterations when testing tempering
torfjelde Mar 6, 2023
a8e317a
fixed bugs with MALA and tempering
torfjelde Mar 7, 2023
71b39c7
relax atol a bit for HMC
torfjelde Mar 7, 2023
d3d044c
relax another atol
torfjelde Mar 7, 2023
1830c79
TemperedComposition is now truly just a wrapper around a CompositionS…
torfjelde Mar 8, 2023
4af0e67
added method for computing roundtrips
torfjelde Mar 8, 2023
63c2724
fixed testing + added test for roundtrips
torfjelde Mar 8, 2023
929573f
added docs for roundtrips method
torfjelde Mar 8, 2023
54f043a
added some tests for SwapSampler without tempering
torfjelde Mar 8, 2023
1458e64
remove ordering from SwapSampler since it should only interact with P…
torfjelde Mar 8, 2023
ebb402b
simplified the sorting according to chains and processes
torfjelde Mar 8, 2023
b27d8cf
added some comments
torfjelde Mar 8, 2023
6621ce7
some minor refactoring
torfjelde Mar 8, 2023
972c2b3
some refactoring + TemperedSampler now orders the samplers correctly
torfjelde Mar 9, 2023
4d9def9
remove expected_ordering and make ordering assumptions more explicit
torfjelde Mar 9, 2023
7115dad
relax type-constraints in state_for_chain so it also works with Tempe…
torfjelde Mar 9, 2023
05e8521
removed redundant implementations of swap_attempt
torfjelde Mar 9, 2023
e062ae3
rename swap_betas! to swap!
torfjelde Mar 9, 2023
b816459
moved swap_attempt as it now requires definition of SwapSampler
torfjelde Mar 9, 2023
9466fe0
removed unnecessary setparams_and_logprob!! that should never be hit
torfjelde Mar 9, 2023
442f1d1
removed expected_order
torfjelde Mar 9, 2023
8e25d63
removed unnecessary variable in tests
torfjelde Mar 9, 2023
c344ad6
Apply suggestions from code review
torfjelde Mar 9, 2023
6359e31
removed burn-in from step in prep for AbstractMCMC improvements
torfjelde Mar 10, 2023
1a437f4
remove getparams_and_logprob implementation for SwapState as it's
torfjelde Mar 10, 2023
262995a
Apply suggestions from code review
torfjelde Mar 10, 2023
49ea8db
Merge branch 'torfjelde/tempered-sampler-rewamp' of github.com:Turing…
torfjelde Mar 10, 2023
f99809e
added CompositionTransition + quite a few bundle_samples with a
torfjelde Mar 10, 2023
42294a1
more samples
torfjelde Mar 10, 2023
a0e2732
reduce requirement for ess comparison for AHMC a bit
torfjelde Mar 11, 2023
15ce587
significant improvements to the simple Gaussian example, now testing
torfjelde Mar 11, 2023
66ee3a7
trying to debug these tests
torfjelde Mar 11, 2023
7030fce
more debug
torfjelde Mar 11, 2023
3e88f9e
fixed typy
torfjelde Mar 11, 2023
6aa3d09
reduce significance even further
torfjelde Mar 11, 2023
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
Prev Previous commit
Next Next commit
relax type-constraints in state_for_chain so it also works with Tempe…
…redState
torfjelde committed Mar 9, 2023
commit fd70d0e54fdccf828e6c226d3befcec328d2895a
2 changes: 1 addition & 1 deletion src/MCMCTempering.jl
Original file line number Diff line number Diff line change
@@ -61,7 +61,7 @@ function AbstractMCMC.bundle_samples(
ts_actual,
model,
sampler_for_chain(sampler, state, 1),
state_for_chain(state.swapstate),
state_for_chain(state, 1),
HarrisonWilde marked this conversation as resolved.
Show resolved Hide resolved
MCMCChains.Chains;
kwargs...
)
4 changes: 2 additions & 2 deletions src/state.jl
Original file line number Diff line number Diff line change
@@ -160,8 +160,8 @@ chain_to_process(chain2proc, I...) = chain2proc[I...]
Return the state corresponding to the chain indexed by `I...`.
If `I...` is not specified, the state corresponding to `β=1.0` will be returned.
"""
state_for_chain(state::SwapState) = state_for_chain(state, 1)
state_for_chain(state::SwapState, I...) = state_for_process(state, chain_to_process(state, I...))
state_for_chain(state) = state_for_chain(state, 1)
state_for_chain(state, I...) = state_for_process(state, chain_to_process(state, I...))

"""
state_for_process(state, I...)