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

[FR] Render models to a LaTex formula #1563

Open
ordabayevy opened this issue Mar 26, 2023 · 0 comments
Open

[FR] Render models to a LaTex formula #1563

ordabayevy opened this issue Mar 26, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@ordabayevy
Copy link
Member

Similar to render_model but render to a LaTex formula. Example:

def model(data):
    m = pyro.sample("m", dist.Normal(0, 1))
    sd = pyro.sample("sd", dist.LogNormal(m, 1))
    with pyro.plate("N", len(data)):
        pyro.sample("obs", dist.Normal(m, sd), obs=data)

render_to_latex_formula(model, model_args=(data,))

Possible outputs:

  1. Specify the factorization of the log-joint: $p(m) p(sd \mid m) \prod_{N} p(obs=data \mid m, sd)$
  2. Specify distribution names too: $\mathrm{Normal}(m) \mathrm{LogNormal}(sd \mid m) \prod_{N} \mathrm{Normal}(obs=data \mid m, sd)$
@fehiepsi fehiepsi added the enhancement New feature or request label Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants