Skip to content

Create value variable on transformed space #6306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

aseyboldt
Copy link
Member

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.

@codecov
Copy link

codecov bot commented Nov 15, 2022

Codecov Report

Merging #6306 (33ce136) into main (24888ac) will increase coverage by 2.88%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6306      +/-   ##
==========================================
+ Coverage   90.89%   93.77%   +2.88%     
==========================================
  Files         111      111              
  Lines       23913    23916       +3     
==========================================
+ Hits        21736    22428     +692     
+ Misses       2177     1488     -689     
Impacted Files Coverage Δ
pymc/model.py 90.22% <100.00%> (+0.04%) ⬆️
pymc/distributions/discrete.py 99.22% <0.00%> (ø)
pymc/distributions/continuous.py 97.50% <0.00%> (ø)
pymc/sampling/mcmc.py 92.27% <0.00%> (+0.45%) ⬆️
pymc/sampling/parallel.py 87.32% <0.00%> (+0.68%) ⬆️
pymc/tests/sampling/test_parallel.py 82.96% <0.00%> (+0.74%) ⬆️
pymc/step_methods/arraystep.py 94.32% <0.00%> (+1.41%) ⬆️
pymc/backends/base.py 87.54% <0.00%> (+1.55%) ⬆️
pymc/smc/sampling.py 86.42% <0.00%> (+5.71%) ⬆️
pymc/smc/kernels.py 97.37% <0.00%> (+21.34%) ⬆️
... and 5 more

@ricardoV94
Copy link
Member

Wanna update the Aesara pin to the latest release to see if anything else broke?

@ricardoV94
Copy link
Member

These are all the places that need to be changed: 1dd5518

@ricardoV94
Copy link
Member

About your question, we only definite value variables on the transformed space and don't assume transforms can be changed after the distribution is defined (not my preference)

@ricardoV94
Copy link
Member

Superseded by #6336

@ricardoV94 ricardoV94 closed this Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants