界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
开发与工程 · SKILL.md

svi-autoguides

svi-autoguides

【开发与工程】Fit and debug NumPyro stochastic variational inference workflows with ELBOs, manual guides, autoguides, optimizers, and enumeration choices.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: svi-autoguides description: "Fit and debug NumPyro stochastic variational inference workflows with ELBOs, manual guides, autoguides, optimizers, and enumeration choices." disable-model-invocation: true metadata: disco-role: operating license: Apache 2.0

svi-autoguides

Use this sub-skill when the task is to fit a NumPyro model with stochastic variational inference (SVI), write or repair a guide, choose an ELBO, use automatic guides, inspect learned parameters and losses, handle discrete latent variables in SVI, or turn SVI results into posterior/predictive samples.

Quick workflow

  1. Confirm model and guide signatures. Model/guide primitive and shape issues route through ../modeling-primitives/ and distribution support issues through ../distributions-transforms/.
  2. Choose a guide path. Use a manual guide for custom variational families or constraints; use references/autoguide-reference.md for AutoNormal, AutoDelta, normal-family autoguides, Laplace, flow guides, DAIS, and guide lists.
  3. Choose an ELBO. Use references/elbo-and-enumeration.md for Trace_ELBO, TraceMeanField_ELBO, TraceGraph_ELBO, TraceEnum_ELBO, RenyiELBO, and discrete enumeration.
  4. Run SVI. Use references/svi-workflows.md for SVI.init, update, run, get_params, evaluate, optimizer selection, and posterior predictive use.
  5. Validate losses and params. Check finite losses, constrained parameter values, expected keys, and posterior predictive shapes.
  6. Run the bundled smoke. scripts/svi_smoke.py is a small synthetic SVI check adapted from NumPyro's minimal example.
  7. Triage failures. Use references/troubleshooting.md for NaN losses, invalid guide values, wrong ELBO for discrete sites, missing optax/funsor, and local-latent guide limitations.

Prefer this sub-skill for

  • SVI(model, guide, optim, loss) setup and update loops.
  • Trace_ELBO, TraceMeanField_ELBO, TraceGraph_ELBO, TraceEnum_ELBO, or RenyiELBO decisions.
  • numpyro.param constraints in guides.
  • AutoNormal, AutoDiagonalNormal, AutoMultivariateNormal, AutoLowRankMultivariateNormal, AutoDelta, AutoGuideList, AutoLaplaceApproximation, AutoIAFNormal, AutoBNAFNormal, AutoDAIS, AutoSemiDAIS, and AutoSurrogateLikelihoodDAIS.
  • Discrete enumeration with config_enumerate, infer={"enumerate": "parallel"}, and TraceEnum_ELBO.
  • Optimizer selection with numpyro.optim or optional Optax optimizers.

Route elsewhere when

Bundled materials

我的收藏