aesara-devs / aeppl

Tools for an Aesara-based PPL.
https://aeppl.readthedocs.io
MIT License
64 stars 20 forks source link

Preserve the identities of value/observed variables #248

Closed brandonwillard closed 1 year ago

brandonwillard commented 1 year ago

This PR changes the IR generation process so that value/observed variables are never rewritten and their identities are necessarily preserved in the log-probability results. Basically, we create dummy variables for them during IR rewriting and replace them with the value variables at the end (i.e. when log-probabilities are constructed). Most of the changes have to do with the special case of transformations, which demand the ability to change transformed value variables after IR rewriting.