Create value variable on transformed space #6306
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm not sure if this really is a PR as of yet, or possibly more a discussion:
In the source I can't really find a distinction between a value variable for on the untransformed and on the transformed spaces. Instead, it seems that value variables are reused on both depending on context.
I think this leads to problems however: I don't think there is a reason to expect those to even have the same type. If the shape is statically known, then their (static) shapes would often be different for instance. Or they could even have different ranks.
I ran into this with a development version of aesara, where ZeroSumNormal stopped working, because shape inference improved. The new shape inference was smart enough to figure out that the shape the rv was
(10,)
, but the code then would assume that the transformed value variable would have the same shape, which is incorrect (it should have shape(9,)
.The current PR contains some code that fixes this specific issue by creating the value variable with the type of the tranformed variable, but I think this is also not really correct. It seems to me we should have separate value variables for transformed and untransformed spaces.