-
Notifications
You must be signed in to change notification settings - Fork 78
Allow Prior to create pymc.dims variables #643
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
base: main
Are you sure you want to change the base?
Conversation
0f03f4e to
5dc08d7
Compare
0714a3a to
5284433
Compare
juanitorduz
left a comment
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.
Great 🚀
| if isinstance(value.type, pt.TensorType): | ||
| value = value.eval() | ||
|
|
||
| # Avoid XTensor import warnings, remove this when the warnings are gone |
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.
Do we wanna create an issue?
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.
yeah
williambdean
left a comment
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.
Overall looks pretty good.
| if xdist: | ||
| import pytensor.xtensor as ptx | ||
|
|
||
| for module in (ptx.math, ptx.linalg, ptx.signal, ptx): |
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.
This seems to be causing some errors in the CI/CD
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.
signal is not released yet I guess
| prior = dist.sample_prior(coords=coords) | ||
| """ | ||
| # TODO: Why do we need a sample_prior function? |
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.
sample_prior was to allow for VariableFactory instances to have sample_prior
functionality. User doesn't need to define a method.
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.
Oh I didn't mean to leave the comment, sorry
|
|
||
| def test_custom_transform() -> None: | ||
| new_transform_name = "foo_bar" | ||
| dist = Prior("Normal", transform=new_transform_name) |
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.
So this raises later now?
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.
We could raise for tensor, it's unlikely it doesn't exist for that but it exists for xtensor. We also check for pymc distribution even though it may not be used at all
Add an
xdistboolean flag to createpymc.dimsvariables instead.This is a breaking change, existing custom classes will need to accept
xdistflag increate_variable.Local/odd imports are inplace until we remove experimental warnings from importing pymc.dims or pytensor.xtensor