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

Add getparams and setparams!! following AbstractMCMC v5.5 and v5.6 #103

Merged
merged 7 commits into from
Oct 31, 2024

Conversation

sunxd3
Copy link
Member

@sunxd3 sunxd3 commented Oct 21, 2024

@sunxd3
Copy link
Member Author

sunxd3 commented Oct 22, 2024

the test is failing because an numerical test (https://github.com/TuringLang/AdvancedMH.jl/actions/runs/11434545096/job/31870916921?pr=103#step:5:353)
should we relax the atol, and is this new?

@yebai
Copy link
Member

yebai commented Oct 22, 2024

@sunxd3 thansk for the PR. Please feel free to relax the assertation bound a bit.

src/AdvancedMH.jl Outdated Show resolved Hide resolved
src/AdvancedMH.jl Show resolved Hide resolved
@sunxd3 sunxd3 requested a review from torfjelde October 22, 2024 19:02
Copy link
Member

@penelopeysm penelopeysm left a comment

Choose a reason for hiding this comment

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

The PRNG generates different numbers on different Julia versions even if the seed is set the same, so I guess 1234 was just an unlucky choice and we learnt about it when the tests were run on 1.11 😅

test/runtests.jl Outdated Show resolved Hide resolved
Co-authored-by: Penelope Yong <[email protected]>
@penelopeysm
Copy link
Member

Oh, one more thing, should it be 0.9.0 rather than 0.8.4? Since we're introducing new functions.

@sunxd3
Copy link
Member Author

sunxd3 commented Oct 23, 2024

I am not certain here: these functions are not exported, but it's true that through AbstractMCMC they become a part of the public interface (but in a softer sense). Not sure what's the right approach, maybe @torfjelde knows better than me on this.

@torfjelde
Copy link
Member

Oh, one more thing, should it be 0.9.0 rather than 0.8.4? Since we're introducing new functions.

It's a bit weird, but basically, at least to my understanding, when we haven't reached version 1 yet, we use minor version as what is considered "breaking" and patch version for everything that isn't. Once we have non-zero major version, then we bump minor version when we introduce new (even non-breaking) functionality. Sooo in this case, I say we stick with bumping patch version.

Copy link
Member

@torfjelde torfjelde left a comment

Choose a reason for hiding this comment

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

This PR suffers from the same issues I've raised in AdvancedHMC.jl: gradient information will be out of sync.

This means that if you do something like

AbstractMCMC.step(model, sampler, setparams!!(state, new_params))

you'll use the incorrect gradient in the MH step, resulting in the incorrect chain. I've outlined what I think we should do here: TuringLang/AdvancedHMC.jl#378 (review)

src/MALA.jl Outdated Show resolved Hide resolved
@sunxd3 sunxd3 changed the title Add getparams and setparams!! following AbstractMCMC v5.5 Add getparams and setparams!! following AbstractMCMC v5.5 and v5.6 Oct 28, 2024
@sunxd3 sunxd3 self-assigned this Oct 28, 2024
@sunxd3 sunxd3 requested a review from torfjelde October 31, 2024 09:13
Copy link
Member

@torfjelde torfjelde left a comment

Choose a reason for hiding this comment

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

Looks good! Just need to remove the BangBang.jl references.

Project.toml Outdated Show resolved Hide resolved
src/AdvancedMH.jl Outdated Show resolved Hide resolved
@sunxd3
Copy link
Member Author

sunxd3 commented Oct 31, 2024

good call! now removed, thanks a lot for reviewing this all these times

@sunxd3 sunxd3 merged commit 98a1041 into master Oct 31, 2024
17 checks passed
@sunxd3 sunxd3 deleted the sunxd/add_getparams branch October 31, 2024 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants