Conversation
Add math-flavored docstrings to four more distributions on the pyro-ppl#2187 checklist, following the template from pyro-ppl#2188, pyro-ppl#2192, pyro-ppl#2199 and the recent pyro-ppl#2268-pyro-ppl#2270 series: - `MultinomialProbs` / `MultinomialLogits` — class PMF, `__init__` parameters, `sample`, `log_prob`, `probs`/`logits` conversions, `mean`, `variance`, and `support`. - `BetaBinomial` — class PMF plus `sample`, `log_prob`, `mean`, `variance`, and `support`. - `DirichletMultinomial` — class PMF plus `sample`, `log_prob`, `mean`, `variance`, and `support`. Docstrings only, no logic changes. `ruff check` and `ruff format --check` are clean on both files.
Benchmark reportthis PR - run time: 1 slower, 0 faster
- compile time: 1 slower, 0 fasterSignificant changes (2) ──────── run time ─────── ────── compile time ──────
benchmark baseline this PR Δ baseline this PR Δ
────────────────────────────────────────────────────────────────────────────────────────
- predictive_forward_sampling 671.5 ms 663.9 ms -1.1% 176.4 ms 238.9 ms +35.4%
- svi_autonormal_logistic 678.4 ms 726.6 ms +7.1% 3.27 s 3.18 s -2.8%Red is slower, green is faster; a row is coloured by the worse of its two columns. A delta in parentheses cleared the threshold on a measurement below the resolution floor, so it is shown without being called a change. † marks a benchmark that could not be compared — see below. Full results
|
| baseline | this PR | |
|---|---|---|
| ref | master |
doc-2187-more |
| commit | 0771b92c |
e9bc2e79 |
| numpyro | 0.21.0 | 0.21.0 |
| jax | 0.11.2 | 0.11.2 |
| backend | cpu | cpu |
| python | 3.14.7 | 3.14.7 |
Runner: Linux-6.17.0-1022-azure-x86_64-with-glibc2.39, 4 CPUs.
Produced by this benchmark run.
Adds math-flavored docstrings to four more distributions on the #2187 checklist, following the template from #2188, #2192, #2199 and the recent #2268–#2270 series.
MultinomialProbs/MultinomialLogits— class PMF,__init__parameters,sample,log_prob, theprobs/logitsconversions,mean,variance, andsupport.BetaBinomial— class PMF plussample,log_prob,mean,variance, andsupport.DirichletMultinomial— class PMF plussample,log_prob,mean,variance, andsupport.Docstrings only, no logic changes.
ruff checkandruff format --checkare clean on both files.