-
-
Notifications
You must be signed in to change notification settings - Fork 20
Add support for power transforms #210
base: main
Are you sure you want to change the base?
Conversation
d87ef92 to
ed2161d
Compare
|
Just a note that #184 originally introduced a rewrite for
Another arguments in favor of propagating domain information; we shouldn't have to make assumptions here. |
| return -2 * at.log(value) | ||
| from aeppl.logprob import xlogy0 | ||
|
|
||
| power = self.transform_args_fn(*inputs) |
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.
Don't you need to use inv_power = at.reciprocal(power) instead of power in the expression of the jacobian?
|
|
||
| def transform(measurable_input, *other_inputs): | ||
| return ReciprocalTransform(), (measurable_input,) | ||
| new_node = at.power(node.inputs[0], at.as_tensor(-1)).owner |
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.
What's the advantage of using pow to represent reciprocal here (besides a few less lines of code)? I feel such equivalences should be handled at the Aesara-level, either by aliasing or a canonicalization pass.
This PR adds support for general power transforms and replaces #184. It uses a positive support in cases of ambiguity.
In its current form, it appears to work as a replacement for$Z = X^2$ , where $X \sim \operatorname{N}\left(0, 1\right)$ , test example fails.
at.reciprocal, but the