pyro-ppl / pyro-ppl/numpyro

[FR] Render models to a LaTex formula

Open
#1,563 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
2.8k
Forks
316
Avg merge
3d 9h
Merged PRs (30d)
27

Description

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)$

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the existing render_model entry point and inspect how it represents a model. Resolve whether the factorized or distribution-named LaTeX output is required, then define and test render_to_latex_formula against the example model.

Written by the indexing model from the issue text.

Assessment

Tech stack
latex, python
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.