Conversation
When a model passes an explicit subsample=idx to pyro.plate but is composed with a guide that draws its own subsample (e.g. an AutoGuide built without create_plates=), ReplayMessenger silently overrode the model's index with the guide's. This decouples the model's and guide's minibatches with no error or warning. ReplayMessenger._pyro_sample now emits a warning when it would override a subsample site whose explicit value differs from the guide's replayed value. Normal subsample_size-based plates and matching subsamples are unaffected. Fixes pyro-ppl#3468.
This branch has not been deployed
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.
Description
Fixes #3417.
The
spline_couplinghelper lacked anorderparameter, unlike theSplineCouplingclass it wraps (and the siblingspline/conditional_splinehelpers). This made it impossible to create a quadratic spline coupling through the helper API.Changes
pyro/distributions/transforms/spline_coupling.py: addorder="linear"keyword tospline_coupling, forward it toSplineCoupling, and buildparam_dimsconditionally — quadratic splines use only widths, heights and derivatives, while linear splines additionally emit the per-bin lambda parameters.tests/distributions/test_transforms.py: extendtest_spline_couplingto cover both"linear"and"quadratic"orders.Verification
pytest tests/distributions/test_transforms.py: 162 passed.