Replies: 5 comments
-
We had some exceptions and—later—warnings to this effect, but those approaches inherently restricted one's ability to intentionally include random sampling in the resulting log-probability graphs, and we don't want to trade those kinds of fundamental limitations for high-level reporting conveniences. Simply put, Regarding the general design of this library, a keyword like Nevertheless, there's nothing preventing one from creating an interface to It might make sense to allow additional Really, we want things to be as configurable/malleable as possible, but we don't want to invent and maintain new interfaces and APIs if/when we don't need to. Instead, we need to use and improve the existing ones. This also helps the project focus on its core functionality and avoid over-extending itself into marginal use-case territories. |
Beta Was this translation helpful? Give feedback.
-
I think the main point is what would be the most useful thing aeppl could (try) to do when you call: aeppl.joint_logprob({b: b_val}, Right now what we do (and document) is that Having the library try to marginalize the variable of |
Beta Was this translation helpful? Give feedback.
-
Also worth noting that we don't interpret x_rv = at.random.normal()
y_rv = at.random.normal()
z_rv = x_rv + y_rv
z_vv = z_rv.clone()
joint_logprob({z_rv: z_vv}) As being a stochastic graph of both x_rv and y_rv (or one centered on the other), even though z_rv follows exactly the same distribution as in the graph below: x_rv = at.random.normal()
z_rv = at.random.normal(x_rv)
z_vv = z_rv.clone()
joint_logprob({z_rv: z_vv}) |
Beta Was this translation helpful? Give feedback.
-
I don't follow; are we assuming that the convolution |
Beta Was this translation helpful? Give feedback.
-
Yeah, I am assuming that's what aeppl would try to do if we had already implemented the convolution rewrite (which I think was discussed as a future feature) |
Beta Was this translation helpful? Give feedback.
-
During discussion of pymc-devs/pymc#5155 we (@ricardoV94 and I) also talked a bit about the API for
aeppl.factorized_joint_logprob
and how it deals with random variables that are not specified at all.I think it might be better to change the api a bit so that all random variables in the graph have to be specified somehow. That would make it more future proof (eg implement marginalization using closed form solution or some kind of numerical integration) and also make it closer to the math notation and harder for users to shoot themselves into the foot.
Let's say we have a graph like this:
We could now be interested in those values (math notation):
If we call
aeppl.factorized_joint_logprob(all_vars)
, we get all the conditional logps:{key_var: P(key_var = key_val | all_remaining) for (key_var, key_val) in all_vars}
, which seems fine to me (although I might only be interested in some of those in the first place, but I think this is fine anyway).If we call
aeppl.factorized_joint_logprob({b: b_val})
however, we actually get the random variable instead of the marginal logp, even though the call looks almost like the math notation of the marginal logp.We could make this choice explicit by switching this use case to an api like this:
Which we could later extend to marginalization using something those:
Beta Was this translation helpful? Give feedback.
All reactions