Skip to content
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

Port SymbolicRandomVariable Op to PyTensor and get rid of many RVs in PyTensor #1221

Open
ricardoV94 opened this issue Feb 19, 2025 · 0 comments

Comments

@ricardoV94
Copy link
Member

Description

In PyMC we have a SymbolicRandomVariable that allows defining an OpFromGraph that looks almost like a RandomVariable but is just built symbolically. This avoids having to define too many Ops (and backend dispatches). We should try to port it to PyTensor and make sure that everything than in PyTensor works with pure RandomVariable also works with the Symbolic counterparts.

From the top of the mind we have to make RandomStreams and RV rewrites compatible.

This is the class (it contains things that don't make sense in PyTensor, like the MeasurableOp):
https://github.com/pymc-devs/pymc/blob/ce5f2a27170a9f422f974fdf9fc415dfe53c35cb/pymc/distributions/distribution.py#L211-L399

Here is an example of how a Symbolic RV is then defined:
https://github.com/pymc-devs/pymc/blob/ce5f2a27170a9f422f974fdf9fc415dfe53c35cb/pymc/distributions/continuous.py#L1217-L1238

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant