-
Notifications
You must be signed in to change notification settings - Fork 2.1k
refactor: move _precition_mv_normal_logp into a seperate function #7895
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
base: main
Are you sure you want to change the base?
Conversation
|
Let's duplicate it in pymc-extras first to see if we really need it refactored. In theory you should be able to introduce a |
@ricardoV94 Thoughts on this having seen the main PR now? Also I'm a little unsure about creating a |
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
@ricardoV94 Just making sure you're ok with the above? |
What I'm saying is that you can already get the logp function wherever it is implemented by following the logp API which is: import pymc as pm
import pytensor.tensor as pt
from pymc.distributions.multivariate import PrecisionMvNormalRV
# There's a bug here, it should be possible to do
# rv = PrecisionMvNormalRV.rv_op(mean=pt.ones(3), tau=pt.eye(3))
# but we wrote the signature wrong
_, rv = PrecisionMvNormalRV.rv_op(mean=pt.ones(3), tau=pt.eye(3)).owner.outputs
logp = pm.logp(rv, pt.zeros(3))
logp.eval() This is the API to access the logp function. It should work just fine for you inside a logp expression. We do it here as well: pymc/pymc/distributions/discrete.py Line 734 in 0960323
|
In either case this PR is fine, I just want to do it after the work on the pymc-extras is ready. Until then just copy the logp function there |
Sounds good - should I just raise an issue for now in that case? |
Just add the code in the same PR where you need it |
Oh yes I see, just done now. |
Addresses #7894 as part of pymc-devs/pymc-extras#532
📚 Documentation preview 📚: https://pymc--7895.org.readthedocs.build/en/7895/