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

String (and graph) representations in v4 #4494

Closed
Spaak opened this issue Mar 1, 2021 · 1 comment · Fixed by #4849
Closed

String (and graph) representations in v4 #4494

Spaak opened this issue Mar 1, 2021 · 1 comment · Fixed by #4849

Comments

@Spaak
Copy link
Member

Spaak commented Mar 1, 2021

With v4 (see #4463), we move away from Distribution in favour of aesara's RandomVariable. The current machinery for generating human-readable str representations depends on some OOP stuff in Distribution and subclasses. These string representations were also used in generating GraphViz graphs.

I'm opening this issue to discuss the best way to maintain current str and graph functionality when moving forward to v4. I'm happy to do the coding, but will need some input from @brandonwillard (and others) first.

For now I have two (probably naive) questions that should hopefully allow me to get this started:

  1. If I have x = pm.Normal('x', mu=0, sigma=1.0), what is the best way to access x's parameters after instantation? Right now (v3) I can just do x.distribution.mu, but this no longer works when x is a TensorVariable. I know that these parameters are TensorConstants somewhere in x's parent hierarchy, but so far I've not found a convenient way to access them using their parameter names.
    2. I saw that there are _print_name properties in aesara.tensor.random.basic.NormalRV etc., but so far these appear unused, is that correct? Found their use in symbolic-pymc I think!
@brandonwillard
Copy link
Contributor

There is a Theano/Aesara-based random variable printer in symbolic_pymc.theano.printing that uses Theano/Aesara's built-in printing framework. It produces both text-based and LaTeX output (e.g. here's a text example and here's a LaTeX example). We can always use/adapt that code.

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

Successfully merging a pull request may close this issue.

3 participants