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

Implement logprob for SpecifyShape #171

Open
ricardoV94 opened this issue Sep 1, 2022 · 0 comments
Open

Implement logprob for SpecifyShape #171

ricardoV94 opened this issue Sep 1, 2022 · 0 comments
Labels
help wanted Extra attention is needed op-probability Involves the implementation of log-probabilities for Aesara `Op`s

Comments

@ricardoV94
Copy link
Contributor

ricardoV94 commented Sep 1, 2022

Similar to the Dimshuffle case, the best is to let canonicalization move SpecifyShape's out of the way (and improve Aesara if there are obvious missing cases), and only apply a logprob rewrite as the last resort.

The logprob rewrite should be pretty simple

def logprob_specify_shape(op, values, inner_rv, *shapes, **kwargs):
  (value,) = values
  # transfer specify_shape from rv to value
  value = at.specify_shape(value, shapes)
  return logprob(inner_rv, value)
@brandonwillard brandonwillard added help wanted Extra attention is needed op-probability Involves the implementation of log-probabilities for Aesara `Op`s labels Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed op-probability Involves the implementation of log-probabilities for Aesara `Op`s
Projects
None yet
Development

No branches or pull requests

2 participants