Skip to content

String (and graph) representations in v4 #4494

Closed
@Spaak

Description

@Spaak

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!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions