- Notifications
You must be signed in to change notification settings - Fork2.2k
Support PyTensor deterministic operations as observations#7656
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
ricardoV94 commentedJan 25, 2025
We need to tell InferenceData converter how to get the data values to put in |
ricardoV94 commentedJan 25, 2025
I don't consider this a bugfix, it's behavior that was explicitly forbidden for conservative reasons (more like a NotImplementedError) |
williambdean commentedJan 25, 2025
Where does this happen in the code? |
williambdean commentedJan 25, 2025
I think the MiniBatch tests will still fail. Any thoughts on how that should behave? |
williambdean commentedJan 25, 2025
Also, feel free to choose a better title! I couldn't express it too well |
Uh oh!
There was an error while loading.Please reload this page.
ricardoV94 commentedJan 25, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Line 63 infa43eba
Line 152 infa43eba
We should be able to just use constant_fold (also in pytensor) for it |
williambdean commentedJan 25, 2025
I have an implementation before this suggestion. I need a little help understanding this. Feel free to put suggestion |
ricardoV94 commentedJan 26, 2025
What do you mean? My suggestion is to simply call constant_fold on the observed variable |
williambdean commentedJan 28, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I am not able to make this work with either |
ricardoV94 commentedJan 28, 2025
From pymc.pytensorf. There's a |
ricardoV94 commentedJan 28, 2025
Ah if it's a SharedVariable like |
ricardoV94 commentedJan 28, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
frompytensor.compile.modeimportModeimportpymcaspmwithpm.Model(coords={"date": [0,1,2]})asm:data=pm.Data("data", [0,1,2],dims="date")x=pm.Normal("x")y=pm.Normal("y",x,observed=data,dims="date")cheap_eval_mode=Mode(linker="py",optimizer=None)m.rvs_to_values[y].eval(mode=cheap_eval_mode)# array([0., 1., 2.]) |
williambdean commentedJan 28, 2025
Thanks for the suggestion. I've used mode on the random variable directly. Is it different to get the rvs_to_values from the model? it currently isn't accessed from the function at the moment. |
williambdean commentedJan 28, 2025
Could you point me to similar tests for this? |
williambdean commentedJan 28, 2025
I've just added to associated pytensorf test suite |
* Use RV Op name when provided* More robust detection of observed data variables (afterpymc-devs#7656 arbitrary graphs are allowed)* Remove self loops explicitly (closespymc-devs#7722)
* Use RV Op name when provided* More robust detection of observed data variables (afterpymc-devs#7656 arbitrary graphs are allowed)* Remove self loops explicitly (closespymc-devs#7722)
* Use RV Op name when provided* More robust detection of observed data variables (afterpymc-devs#7656 arbitrary graphs are allowed)* Remove self loops explicitly (closespymc-devs#7722)
* Use RV Op name when provided* More robust detection of observed data variables (afterpymc-devs#7656 arbitrary graphs are allowed)* Remove self loops explicitly (closespymc-devs#7722)
* Use RV Op name when provided* More robust detection of observed data variables (afterpymc-devs#7656 arbitrary graphs are allowed)* Remove self loops explicitly (closespymc-devs#7722)
* Use RV Op name when provided* More robust detection of observed data variables (afterpymc-devs#7656 arbitrary graphs are allowed)* Remove self loops explicitly (closespymc-devs#7722)
* Use RV Op name when provided* More robust detection of observed data variables (afterpymc-devs#7656 arbitrary graphs are allowed)* Remove self loops explicitly (closespymc-devs#7722)
* Use RV Op name when provided* More robust detection of observed data variables (afterpymc-devs#7656 arbitrary graphs are allowed)* Remove self loops explicitly (closespymc-devs#7722)
* Use RV Op name when provided* More robust detection of observed data variables (afterpymc-devs#7656 arbitrary graphs are allowed)* Remove self loops explicitly (closespymc-devs#7722)
* Use RV Op name when provided* More robust detection of observed data variables (afterpymc-devs#7656 arbitrary graphs are allowed)* Remove self loops explicitly (closespymc-devs#7722)
* Use RV Op name when provided* More robust detection of observed data variables (afterpymc-devs#7656 arbitrary graphs are allowed)* Remove self loops explicitly (closespymc-devs#7722)
* Use RV Op name when provided* More robust detection of observed data variables (afterpymc-devs#7656 arbitrary graphs are allowed)* Remove self loops explicitly (closespymc-devs#7722)
* Use RV Op name when provided* More robust detection of observed data variables (afterpymc-devs#7656 arbitrary graphs are allowed)* Remove self loops explicitly (closespymc-devs#7722)
* Use RV Op name when provided* More robust detection of observed data variables (afterpymc-devs#7656 arbitrary graphs are allowed)* Remove self loops explicitly (closespymc-devs#7722)
* Use RV Op name when provided* More robust detection of observed data variables (afterpymc-devs#7656 arbitrary graphs are allowed)* Remove self loops explicitly (closespymc-devs#7722)
* Use RV Op name when provided* More robust detection of observed data variables (afterpymc-devs#7656 arbitrary graphs are allowed)* Remove self loops explicitly (closespymc-devs#7722)
* Use RV Op name when provided* More robust detection of observed data variables (afterpymc-devs#7656 arbitrary graphs are allowed)* Remove self loops explicitly (closespymc-devs#7722)
* Use RV Op name when provided* More robust detection of observed data variables (afterpymc-devs#7656 arbitrary graphs are allowed)* Remove self loops explicitly (closespymc-devs#7722)
* Use RV Op name when provided* More robust detection of observed data variables (afterpymc-devs#7656 arbitrary graphs are allowed)* Remove self loops explicitly (closespymc-devs#7722)
* Use RV Op name when provided* More robust detection of observed data variables (afterpymc-devs#7656 arbitrary graphs are allowed)* Remove self loops explicitly (closespymc-devs#7722)
* Use RV Op name when provided* More robust detection of observed data variables (afterpymc-devs#7656 arbitrary graphs are allowed)* Remove self loops explicitly (closespymc-devs#7722)
* Use RV Op name when provided* More robust detection of observed data variables (afterpymc-devs#7656 arbitrary graphs are allowed)* Remove self loops explicitly (closespymc-devs#7722)
* Use RV Op name when provided* More robust detection of observed data variables (afterpymc-devs#7656 arbitrary graphs are allowed)* Remove self loops explicitly (closespymc-devs#7722)
* Use RV Op name when provided* More robust detection of observed data variables (afterpymc-devs#7656 arbitrary graphs are allowed)* Remove self loops explicitly (closespymc-devs#7722)
* Use RV Op name when provided* More robust detection of observed data variables (afterpymc-devs#7656 arbitrary graphs are allowed)* Remove self loops explicitly (closespymc-devs#7722)
Uh oh!
There was an error while loading.Please reload this page.
Description
Will need some help on this implementation and how to best test this.
Related Issue
Checklist
Type of change
📚 Documentation preview 📚:https://pymc--7656.org.readthedocs.build/en/7656/