-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrap DensityDist's random with generate_samples #3554
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
0dfa4c0
Fix for 3553. Wrapped random with generate_samples. Added tests and e…
lucianopaz cc010c3
Add to RELEASE-NOTES.md
lucianopaz 8009439
Possible fix for glm utils test
lucianopaz 84789ed
Extended the docstring.
rpgoldman 3d6d0ba
Updated note
lucianopaz 2261a0b
Ensure new docstrings appear in docs.
rpgoldman 04e6ef3
Added multidimensional dist tests that fail
lucianopaz 740e6fe
Added fix and documented it
lucianopaz fdf7a65
Updated release notes
lucianopaz 8f74ea9
Remove pymc3_size_interpretation kwarg
lucianopaz 16a1d76
Added point parameter to rand call
lucianopaz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ Distributions | |
distributions/multivariate | ||
distributions/mixture | ||
distributions/timeseries | ||
distributions/utilities |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
******************************************* | ||
Distribution utility classes and functions | ||
******************************************* | ||
|
||
.. currentmodule:: pymc3.distributions | ||
.. autosummary:: | ||
|
||
Distribution | ||
Discrete | ||
Continuous | ||
NoDistribution | ||
DensityDist | ||
TensorType | ||
|
||
draw_values | ||
generate_samples | ||
|
||
|
||
.. autoclass:: Distribution | ||
.. autoclass:: Discrete | ||
.. autoclass:: Continuous | ||
.. autoclass:: NoDistribution | ||
.. autoclass:: DensityDist | ||
:members: | ||
.. autofunction:: TensorType | ||
|
||
.. autofunction:: draw_values | ||
.. autofunction:: generate_samples | ||
|
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NICE!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The one question I have -- and this is not a question about your change -- is whether we should have a default
shape
that is notNone
(i.e., that records the fact that the programmer did not specify shape).I'm sure that the shape is most likely
()
, but worried about the case where it isn't, and the programmer/modeler has not realized that they need to specify the shape.But this is a different issue, and should not delay merging this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say no, we shouldn't add a special empty shape value. Ideally, the default random variable's shape should be deduced from its parameters. We are far from this goal. At the moment the shape information must be explicitly supplied to every distribution in pymc3, not just
DensityDist
. The default behavior package wise is to assume a scalar distribution.When we start to move towards a more symbolic handling of shapes, we should address whether to reserve a special empty value or not.