-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Incorporate RV meta information in intermediate MeasurableVariables #6360
Comments
Hey @ricardoV94 . I would like to work on this issue. From what I understand, we will need to pass meta-information all Measurable ops like MeasurableClip, MeasurableROund, MeasurableDimShuffle, etc using an |
Yes. And the meta-info we want (at least for now) is: |
We probably will want to further specify the In general supporting the change of "constrained" multivariate variables (Like Dirichlet or ZeroSumNormal) would require something like https://proceedings.mlr.press/v130/radul21a.html, which is what tfp does. More context in the discussion surrounding #6808 |
Description
This pertains to the
logprob
submodule. During logprob derivation of an expression likeWe create a
MeasurableClip
that replacesx
, when we identify we can derive the logprob as a simple censored pdf. This MeasurableClip however does not retain any of the meta-information about the type of RV that it encapsulates (ndim_supp, dtype, support axis).pymc/pymc/logprob/censoring.py
Lines 61 to 67 in a0d6ba0
If we wanted to further compose the graph, we would find issues when some operation needs to know this information
This happens because to infer the logprob of a transposed (dimshuffled) variable, we need to know the original support dimensionality and support axis (which is always the rightmost for pure distributions):
pymc/pymc/logprob/tensor.py
Lines 285 to 298 in a0d6ba0
If we propagated that information to the MeasurableClip (ndim_supp=0, support_axis=None, dtype="mixed"), the
Dimshuffle
rewrite could be safely used and we could derive the logp for the second example. This is also useful for other rewrites...More context in aesara-devs/aeppl#183
The text was updated successfully, but these errors were encountered: