arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.29208cs.MScs.LG
收藏

libhmm:一个用于隐马尔可夫模型的现代C++20库,具有正确的MLE发射M步

libhmm: A Modern C++20 Library for Hidden Markov Models with Correct MLE Emission M-Steps

Independent Researcher(独立研究者)

Gary Wolfman

AI总结:

本文介绍libhmm,一个C++20库,用于隐马尔可夫模型参数估计、序列解码和模型选择,解决了现有软件中缺乏零依赖C++ HMM库以及Baum-Welch算法发射分布M步中广泛使用矩估计近似的问题,实现了十六种连续和离散发射分布的正确最大似然估计。

摘要:

我们描述了libhmm,一个用于隐马尔可夫模型参数估计、序列解码和模型选择的C++20库。libhmm解决了现有软件中的两个空白:缺乏一个维护良好、零依赖的C++ HMM库,适合嵌入到生产系统中;以及在Baum-Welch算法的发射分布M步中广泛使用矩估计近似。该库实现了十六种连续和离散发射分布的正确最大似然估计,包括用于位置-尺度Student-t分布的ECME算法、用于Gamma、Beta、Weibull和负二项分布的Newton-Raphson最大化,以及用于圆形数据的von Mises分布。所有前向-后向和Viterbi计算都在全对数空间中运行。通过编译时分派和标量回退,为AVX-512、AVX2、SSE2和ARM NEON提供了SIMD加速。通过配套包pylibhmm提供Python绑定。我们将libhmm与现有的C和C++ HMM库以及已发布的R参考包在五个真实数据基准上进行比较,并讨论了设计中做出的架构权衡。

英文摘要:

We describe libhmm, a C++20 library for Hidden Markov Model parameter estimation, sequence decoding, and model selection. libhmm addresses two gaps in existing software: the absence of a well-maintained, zero-dependency C++ HMM library suitable for embedding in production systems, and the widespread use of method-of-moments (MOM) approximations in the emission distribution M-step of the Baum-Welch algorithm. The library implements correct maximum likelihood estimators for sixteen scalar emission distributions, including an ECME algorithm for the location-scale Student-t distribution, Newton-Raphson maximization for Gamma, Beta, Weibull, and Negative Binomial distributions, and the von Mises distribution for circular data. All forward-backward and Viterbi calculations operate in full log-space. SIMD acceleration is provided for AVX-512, AVX2, SSE2, and ARM NEON via compile-time dispatch with scalar fallback. Version 4 adds multivariate observation support via the BasicHmm<Obs> template, with three multivariate emission families (diagonal Gaussian, full-covariance Gaussian, and independent components) each with correct weighted MLE M-steps. Python bindings are available via the companion package pylibhmm. We compare libhmm against established C and C++ HMM libraries and against published R reference packages on seven real-data benchmarks, and discuss the architectural tradeoffs made in the design.

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

↑