Support consumed dims in Prior for distributions like Categorical#675
Open
williambdean wants to merge 4 commits intopymc-devs:mainfrom
Open
Support consumed dims in Prior for distributions like Categorical#675williambdean wants to merge 4 commits intopymc-devs:mainfrom
williambdean wants to merge 4 commits intopymc-devs:mainfrom
Conversation
Distributions such as Categorical(p)->() consume the parameter dimension entirely without re-emitting it in the output. Prior previously raised UnsupportedShapeError for these cases. - Add _get_dist_param_names and _get_consumed_dims helpers - Fix _param_dims_work to exclude consumed dims from subset check - Fix handle_dims to append core dim indices and handle all-consumed case - Auto-compute core_dims from rv_op metadata when not explicitly set - Fix xdist path to pass core_dims=None (not ()) when absent - Add TestConsumedDims with 8 tests covering Categorical, Interpolated, MvNormal cov, and the guard for non-consumed incompatible dims Closes pymc-devs#499
Member
|
I assume this was not a problem at all with xdist=True? |
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 #499.
Distributions like
Categorical(p)->()consume a parameter dimension entirely without re-emitting it in the output.Priorpreviously raisedUnsupportedShapeErrorfor these cases.Changes
_get_dist_param_namesand_get_consumed_dimshelpers usingrv_opmetadata_param_dims_workto exclude consumed dims from the subset checkhandle_dimsto preserve consumed dims as trailing axes for the distribution opcore_dimsfromrv_opwhen not explicitly setTests
8 new tests in
TestConsumedDimscoveringCategorical,Interpolated,MvNormalcov, and a guard for non-consumed incompatible dims.