-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
calculation with tensor run errors #5694
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
Comments
Even though I can't see the imports, it seems like you might be using Theano/Theano-pymc functions inside those helper functions and not Aesara ones. You need to change any |
There is a short guide here that might be useful: https://www.pymc-labs.io/blog-posts/the-quickest-migration-guide-ever-from-pymc3-to-pymc-v40/ |
Thank you @ricardoV94 for the clarification. It does pass now once I changed all the theano functions to aesara. much appreciated. when running the
I get:
not sure why? should I raise another issue for it? Thanks |
Yes that's expected. Unfortunately the JAX backend does not currently work with Scans |
There is an issue for that here: aesara-devs/aesara#710 |
@ricardoV94 what would you recommend me do as a workaround? or simply sampling_jax is not functioning at the moment? |
sampling_jax is working but not for all types of models, including those using scans. You can write the correct jax code directly and wrap it in a new Op if that's worth the trouble for you. There's a WIP guide here: pymc-devs/pymc-examples#302 |
thanks @ricardoV94 , I will look into it. I will close this issue as you have addressed it well. appreciate it :) |
Description of your problem
I was building models on big datasets on pymc3 which were going fine but the run time was either too long or the kernel would simply, so I turned to pymc4 to utilize the GPU power. But there seems to be an error when building a model, that requires data transformation using tensors, that otherwise were working fine on pymc3. I am sharing a dummy code from slava kisilevich example on github https://github.com/slavakx/bayesian_mmm . But here I try to modify to run it using pymc4;
The project is around creating a marketing mix model where the bayesian model is aimed to estimate the adstock and saturation variables (theta, alpha, and gamma).
These functions that cause the error
And this is how the model piece look like;
and that is the error I get:
if I declare the variables inside the functions as tensor.fvector or tensor.scalar it passes the calculation part but throws this error;
I go into a series of attempts changing the channel_b then the response_mean , and the intercept to tensor vectors to pass the same errors I am getting but I end up with the below error when calculating the likelihood that I can't seem to overcome;
if I remove the
adstock_geometric_theano_pymc3()
&saturation_hill_pymc3()
from the calculation within the model building section, it runs normally, but then defeats the whole purpose of the model..I am not very familiar with tensor so I am not sure my bug fixing tactics were right...
appreciate any guidance on how to fix the bugs or any guidance on how to use the GPU power with pymc3, I have a deadline coming soon and in a time crunch..
thank you.
Versions and main components
The text was updated successfully, but these errors were encountered: