Repository navigation
Fix jitter_rvs handling in find_MAP - #791
Closed
raashish1601 wants to merge 1 commit into
Closed
raashish1601 wants to merge 1 commit into
raashish1601 wants to merge 1 commit into
Conversation
Member
|
Work on find_map should move to pymc after pymc-devs/pymc#8429, the one here will just redirect/be deprecated. |
Author
|
Thanks, makes sense. Should I close this one (and #792, which also touches |
Author
|
pymc-devs/pymc#8429 is merged now. Its |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #687
_make_initial_pointhad two problems withjitter_rvs:Nonewas turned into an empty list, so nothing was jittered, while thefind_MAPandfit_laplacedocstrings sayNonejitters all variables.freeze_model=True(the default),find_MAPworks on a frozen copy of the model, but the variables injitter_rvscome from the original model. None of them matched, so an explicit list was ignored too.Now
Nonejitters all free RVs, and an explicit list is matched against the model's free RVs by name.jitter_rvs=[]still means no jitter.With the example from the issue, all three calls now end at
w * z ≈ 0.99instead of staying at thew = z = 0stationary point.Tests: added
test_find_MAP_jitter_rvs(None / all / one variable, frozen and not frozen) andtest_find_MAP_no_jitter. Four of the new cases fail on main. The rest oftests/inference/laplace_approxpasses locally (apart from two JAX-backend cases, since jax isn't installed here), and ruff is clean.