Skip to content

fix(ensemble): accept blobs from a vectorized log probability - #579

Closed
Cherith1222 wants to merge 2 commits into
dfm:mainfrom
Cherith1222:fix/516-vectorize-blobs
Closed

Cherith1222 wants to merge 2 commits into
dfm:mainfrom
Cherith1222:fix/516-vectorize-blobs

Conversation

@Cherith1222

Copy link
Copy Markdown

Why

vectorize=True calls 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 raised incompatible input dimensions. The ensemble return is now split into one value per walker before that parser runs.

What changed

Scope

  • Covers vectorize=True when the function returns a tuple.
  • A vectorized function that returns only the log probability is unchanged, as is the non-vectorized parser.

Blast Radius

Only the vectorized path that returns blobs. A bare array of log probabilities still takes the previous path.

Verification

Fixes #516

Drafted with Cursor.

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.
@Cherith1222

Copy link
Copy Markdown
Author

Closing this. #463 already edits compute_log_prob, so this change to the same function should wait.

Drafted with Cursor.

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.

Trying to use Blobs with the vectorize=True keyword returns a ValueError("incompatible input dimensions")

1 participant