You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@aseyboldt I installed the current dev version of pytensor as I saw that they had resolved the issue you posted there #pymc-devs/pytensor#1130.
The hurdle-gamma now runs via Nutpie. I tested it on the sample script ##163 (comment) and it ran. However, it drops down into object mode for same parameters and is slower than pymc's native sampler for this sample code and on some proprietary data and model I have (10 seconds via pymc default sampler vs 12 min for nutpie for my prop).
I am not sure if this should go to another issue and this one should be closed. It seems that it is more a problem with the hurdle-gamma implementation in PYMC #pymc-devs/pymc#7630 (comment) . Please let me know if I should close this issue.
Thanks for the update.
I think you are right, there still seems to be a missing implementation for an op in pytensor in the gradient of the log density. I'll open a separate issue for that.
We should also just implement hurdles properly. There's no reason to involve the cdf as it's just a trick for Mixture to work with a Continuous and the DiracDelta(0) components.
We are truncating the continuous component at epsilon, and that's why those Ops show up in the grad.
@ricardoV94 to implement it properly, you mean write the density in a straightforward way instead of using all this Mixture and truncation logic in _hurdle_mixture right?
@ricardoV94 to implement it properly, you mean write the density in a straightforward way instead of using all this Mixture and truncation logic in _hurdle_mixture right?
Activity
aseyboldt commentedon Dec 3, 2024
This looks like an issue with the numba backend of pytensor.
Can you provide an example I can run to further debug this?
In the meantime, you can also give the jax backend a go:
zwelitunyiswa commentedon Dec 3, 2024
Sure. Here is a simple model that replicates the error:
This fails with the same "TypeError: The fgraph of ScalarLoop must be exclusively composed of scalar operations."
zwelitunyiswa commentedon Dec 3, 2024
I tried that with the simple model above and I got this a "RuntimeError: All initialization points failed" error. Image attached.
aseyboldt commentedon Dec 17, 2024
Sorry for the delay.
I opened a pytensor issue for the problem.
zwelitunyiswa commentedon Dec 17, 2024
No worries. Thank you for looking into it and opening the issue.
zwelitunyiswa commentedon Jan 8, 2025
@aseyboldt I installed the current dev version of pytensor as I saw that they had resolved the issue you posted there #pymc-devs/pytensor#1130.
The hurdle-gamma now runs via Nutpie. I tested it on the sample script ##163 (comment) and it ran. However, it drops down into object mode for same parameters and is slower than pymc's native sampler for this sample code and on some proprietary data and model I have (10 seconds via pymc default sampler vs 12 min for nutpie for my prop).
I am not sure if this should go to another issue and this one should be closed. It seems that it is more a problem with the hurdle-gamma implementation in PYMC #pymc-devs/pymc#7630 (comment) . Please let me know if I should close this issue.
aseyboldt commentedon Jan 8, 2025
Thanks for the update.
I think you are right, there still seems to be a missing implementation for an op in pytensor in the gradient of the log density. I'll open a separate issue for that.
ricardoV94 commentedon Jan 8, 2025
We should also just implement hurdles properly. There's no reason to involve the cdf as it's just a trick for Mixture to work with a Continuous and the DiracDelta(0) components.
We are truncating the continuous component at epsilon, and that's why those Ops show up in the grad.
zaxtax commentedon Apr 21, 2025
@ricardoV94 to implement it properly, you mean write the density in a straightforward way instead of using all this Mixture and truncation logic in
_hurdle_mixture
right?ricardoV94 commentedon Apr 21, 2025
Yup 👍
aseyboldt commentedon May 28, 2025
I'll close this here, we still track the underlying issue in pymc-devs/pytensor#1149