arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1412.5218cs.SEcs.LGstat.ML
收藏

测试MCMC代码

Testing MCMC code

University of Toronto(多伦多大学);Harvard University(哈佛大学)

Roger B. Grosse, David K. Duvenaud

摘要:

马尔可夫链蒙特卡罗(MCMC)算法是概率建模和推理的主力,但很难调试,如果天真地实现,很容易出现无声的失败。我们概述了几种策略来测试MCMC算法的正确性。具体来说,我们提倡以模块化的方式编写代码,其中条件概率计算与采样器的逻辑分离。我们讨论了单元测试和集成测试的策略。作为一个运行的例子,我们展示了如何测试混合高斯模型的吉布斯采样的Python实现。

英文摘要:

Markov Chain Monte Carlo (MCMC) algorithms are a workhorse of probabilistic modeling and inference, but are difficult to debug, and are prone to silent failure if implemented naively. We outline several strategies for testing the correctness of MCMC algorithms. Specifically, we advocate writing code in a modular way, where conditional probability calculations are kept separate from the logic of the sampler. We discuss strategies for both unit testing and integration testing. As a running example, we show how a Python implementation of Gibbs sampling for a mixture of Gaussians model can be tested.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑