计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
bbvi_variance_reduction【效率与协作】Compute BBVI Rao-Blackwellized and score-function control-variate gradient estimators with variance diagnostics.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this skill after forming BBVI score-function terms when you can identify local model terms for a variational factor or want to apply the paper's score-function control variate. It preserves black-box behavior because it requires only local log-density values and score functions.
Do not use it to update parameters or to claim variance reduction without numeric diagnostics.
score: sample-by-parameter score values for one variational factor.local_signal: per-sample local learning signal for that factor.full_signal: optional per-sample full learning signal for naive comparison.rao_blackwell_terms and rao_blackwell_estimate.control_variate_scale and control_variate_estimate.variance: naive, Rao-Blackwellized, and control-variate empirical variances.variance_reduction_ratio: naive variance divided by control-variate variance when available.score * local_signal.a_hat * score.Run:
python tests/test_variance_reduction.py
The caller must supply valid local terms. This skill does not infer a Markov blanket from an arbitrary model graph.