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

MH Constructor #2037

Merged
merged 33 commits into from
Aug 16, 2023
Merged

MH Constructor #2037

merged 33 commits into from
Aug 16, 2023

Conversation

JaimeRZP
Copy link
Member

@JaimeRZP JaimeRZP commented Jul 14, 2023

Allows the user to construct a MH sampler using the priors of a Turing model as proposals.

Depends on #2018.

Note: external samplers make use of SimpleVarInfo by default.

@yebai
Copy link
Member

yebai commented Jul 14, 2023

This PR requires #2018 to use most recent DynamicPPL release.

src/inference/mh.jl Outdated Show resolved Hide resolved
JaimeRZP and others added 3 commits July 17, 2023 11:40
* CompatHelper: bump compat for Bijectors to 0.13, (keep existing compat)

* Update Project.toml

* Replacement for #2039 (#2040)

* Fix testset for external samplers

* Update abstractmcmc.jl

* Update test/contrib/inference/abstractmcmc.jl

Co-authored-by: Tor Erlend Fjelde <[email protected]>

* Update test/contrib/inference/abstractmcmc.jl

Co-authored-by: Tor Erlend Fjelde <[email protected]>

* Update FillArrays compat to 1.4.1 (#2035)

* Update FillArrays compat to 1.4.0

* Update test compat

* Try to enable ReverseDiff tests

* Update Project.toml

* Update Project.toml

* Bump version

* Revert dependencies on FillArrays (#2042)

* Update Project.toml

* Update Project.toml

* Fix redundant definition of `getstats` (#2044)

* Fix redundant definition of `getstats`

* Update Inference.jl

* Revert "Update Inference.jl"

This reverts commit e4f51c2.

* Bump version

---------

Co-authored-by: Hong Ge <[email protected]>

* Transfer some test utility function into DynamicPPL (#2049)

* Update OptimInterface.jl

* Only run optimisation tests in numerical stage.

* fix function lookup after moving functions

---------

Co-authored-by: Xianda Sun <[email protected]>

* Move Optim support to extension (#2051)

* Move Optim support to extension

* More imports

* Update Project.toml

---------

Co-authored-by: Hong Ge <[email protected]>

---------

Co-authored-by: CompatHelper Julia <[email protected]>
Co-authored-by: haris organtzidis <[email protected]>
Co-authored-by: Tor Erlend Fjelde <[email protected]>
Co-authored-by: David Widmann <[email protected]>
Co-authored-by: Xianda Sun <[email protected]>
Co-authored-by: Cameron Pfiffer <[email protected]>
@yebai
Copy link
Member

yebai commented Jul 27, 2023

#2052 allows us to use the most recent DynamicPPL release. The same AD issues as #2018 will apply, but these are independent of the MH sampler in this PR

@yebai yebai marked this pull request as ready for review July 30, 2023 15:35
@yebai
Copy link
Member

yebai commented Jul 30, 2023

This PR should only be merged after #2018

@yebai yebai mentioned this pull request Jul 30, 2023
@yebai
Copy link
Member

yebai commented Jul 30, 2023

@torfjelde Many test models that run on TypedVarInfo fails after switching to SimpleVarInfo. We can probably switch to TypedVarInfo in this PR. Still, the failure cases on relatively simple test models could be helpful for the "empirical data" you wanted to see.

@torfjelde
Copy link
Member

I'm not certain these failing tests are a good indication of whether there's something wrong with SimpleVarInfo (for example, the models for which it fails are already tested in DPPL) as there are too many moving parts here (for example, it doesn't seem like a good idea to just use SimplevarInfo in the logdensity evaluation, completely disregarding the varinfo present in f).

I'm working on this PR now though, so will push some updates soon.

@torfjelde
Copy link
Member

One identified issue is that external samplers are by default working with linked varinfo, while AMH expects unlinked or linked depending on which sampler is being used.

@torfjelde
Copy link
Member

Issues with RandomWalkProposal should now be fixed.

Copy link
Member

@yebai yebai left a comment

Choose a reason for hiding this comment

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

Thanks, @torfjelde and @JaimeRZP -- excellent work! This PR is ready to merge once CI passes.

@torfjelde
Copy link
Member

Once #2018 is good to go, CI should hopefully pass here too.

Project.toml Outdated Show resolved Hide resolved
@yebai yebai merged commit 4affc28 into master Aug 16, 2023
6 of 11 checks passed
@yebai yebai deleted the MH_constructor branch August 16, 2023 21:45
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