Repository navigation
fix(ensemble): accept blobs from a vectorized log probability - #579
Closed
Cherith1222 wants to merge 2 commits into
Closed
Cherith1222 wants to merge 2 commits into
Cherith1222 wants to merge 2 commits into
Conversation
Issue 516 returns one log probability and one blob for the whole ensemble. The sampler currently reads that pair as two walkers.
A vectorized log probability returns one tuple for the ensemble. Parsing that tuple as walker results made the log probability length 2 and rejected the step.
Author
|
Closing this. Drafted with Cursor. |
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.
Why
vectorize=Truecalls the log probability once for the whole ensemble. A return of(log_prob, blob)was parsed as two walker results, so the log probability had length 2 and sampling raisedincompatible input dimensions. The ensemble return is now split into one value per walker before that parser runs.What changed
compute_log_probsplits a vectorized(log_prob, *blobs)tuple into per-walker returns.Scope
vectorize=Truewhen the function returns a tuple.Blast Radius
Only the vectorized path that returns blobs. A bare array of log probabilities still takes the previous path.
Verification
ValueError: incompatible input dimensions.compute_log_probreturned log-probability shape(2,)and blob shape(2, 31).(10, 32, 5)and blob shape(10, 32).python -m pytest src/emcee/tests/unitpassed 66 tests and skipped 6. The skips are HDF5 backends, because h5py is not installed here.Fixes #516
Drafted with Cursor.