Add meta-information to measurable variables #183
Replies: 2 comments 2 replies
-
This sounds related to what we effectively tried to do in the beginning: make things fit into the |
Beta Was this translation helpful? Give feedback.
-
I see three benefits to using the existing
This object of type To address Ricardo's second point we could implement objects that represent transformations between measures, which can be of different types Besides the amount of work that this represents I don't see any downside to this approach. Edit: I don't have a clear understanding of how sampling and density relate mathematically, and we may want to keep |
Beta Was this translation helpful? Give feedback.
-
Some of the operations done on measurable variables have implications that are important for other intermediate rewrites. Two come to mind:
Dim-shuffling alters the support dimension of Measurable Variables, and because of this we can only safely measure dimshuffles of pure RandomVariables (as they have a "contract" that support dimensions are always to the right): Only introduce
MeasurableDimShuffle
s when input is aRandomVariable
#164Some operations convert a continuous variable to a "discrete variable" (whose output may however be a float). This happens with censoring (clipping or rounding) where the output of these operations can/must be of float type, but the variable itself is no longer (strictly) continuous. Other rewrites like "find_measurable_transforms" currently only produce correct IR for continuous variables, and they try to naively reject discrete variables by checking the dtype of the input variables:
aeppl/aeppl/transforms.py
Lines 289 to 291 in 46f6775
My suggestion is to add meta-information to our intermediate Measurable Variables, namely whether they are continuous/discrete/mixed and the position of their support dimensions. This should be pretty easy as in most IR we can just say they are the same as those from the measurable inputs.
Beta Was this translation helpful? Give feedback.
All reactions