libhmm: A Modern C++20 Library for Hidden Markov Models with Correct MLE Emission M-Steps
- URL: http://arxiv.org/abs/2605.29208v1
- Date: Thu, 28 May 2026 00:42:19 GMT
- Title: libhmm: A Modern C++20 Library for Hidden Markov Models with Correct MLE Emission M-Steps
- Abstract summary: libhmm is a C++20 library for model parameter estimation, sequence decoding, and model selection.<n>It addresses two gaps in existing software: absence of a well-maintained, zero-dependency C++ HMM library suitable for embedding in production systems.
- Score: 0.0
- License: http://creativecommons.org/licenses/by/4.0/
- Abstract: 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 continuous and discrete 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. 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 five real-data benchmarks, and discuss the architectural tradeoffs made in the design.
Related papers
- TorchDCM: A Unified PyTorch-Native Package for Discrete Choice Modeling [6.4414601789800505]
We present TorchDCM, an open Python package for discrete choice modeling.<n>It compiles choice data and model specifications into a unified PyTorch-native likelihood engine.<n>TorchDCM completes all 45 synthetic cases, runs fastest in every comparable synthetic case, and satisfies prespecified final-loglikelihood tolerance.
arXiv Detail & Related papers (2026-08-04T09:00:57Z) - TorchKM: A GPU-Oriented Library for Kernel Learning and Model Selection [10.963977296401582]
TorchKM is an open-source library for kernel machines, including support vector machines, kernel logistic regression, and kernel quantile regression.<n>The library features a scikit-learn-style API and is designed to exploit GPU-friendly linear algebra.<n>Code and documentation are available at https://github.com/YikaiZhang95/torchkm, and the package can be easily installed via PyPI.
arXiv Detail & Related papers (2026-06-04T21:56:21Z) - Stdlib or Third-Party? Empirical Performance and Correctness of LLM-Assisted Zero-Dependency Python Libraries [4.178382873374296]
Third-party Python libraries introduce dependency management overhead, supply chain risk, and deployment friction.<n>We address this empirically through zerodep, a growing collection of single-file Python modules alib-only reimplementations of a popular third-party library.<n>Spanning over 40 modules across 12 categories -- including serialization, networking, cryptography, agent protocols, and text processing -- zerodep provides a controlled testbed for two interrelated questions.
arXiv Detail & Related papers (2026-05-20T17:02:54Z) - Reviving Any-Subset Autoregressive Models with Principled Parallel Sampling and Speculative Decoding [55.2480439325792]
In arbitrary-order language models, it is an open question how to sample tokens in parallel from the correct joint distribution.<n>We find that a different class of models, any-subset autoregressive models (AS-ARMs), holds the solution.<n>We show that AS-ARMs achieve state-of-the-art performance among sub-200M parameter models on infilling benchmark tasks, and nearly match the performance of models 50X larger on code generation.
arXiv Detail & Related papers (2025-04-29T06:33:13Z) - Mixture-Models: a one-stop Python Library for Model-based Clustering
using various Mixture Models [4.60168321737677]
textttMixture-Models is an open-source Python library for fitting Gaussian Mixture Models (GMM) and their variants.
It streamlines the implementation and analysis of these models using various first/second order optimization routines.
The library provides user-friendly model evaluation tools, such as BIC, AIC, and log-likelihood estimation.
arXiv Detail & Related papers (2024-02-08T19:34:24Z) - UncertaintyPlayground: A Fast and Simplified Python Library for
Uncertainty Estimation [0.0]
UncertaintyPlayground is a Python library built on PyTorch and GPyTorch for uncertainty estimation in supervised learning tasks.
The library offers fast training for Gaussian and multi-modal outcome distributions.
It can visualize the prediction intervals of one or more instances.
arXiv Detail & Related papers (2023-10-23T18:36:54Z) - Symmetric Equilibrium Learning of VAEs [56.56929742714685]
We view variational autoencoders (VAEs) as decoder-encoder pairs, which map distributions in the data space to distributions in the latent space and vice versa.
We propose a Nash equilibrium learning approach, which is symmetric with respect to the encoder and decoder and allows learning VAEs in situations where both the data and the latent distributions are accessible only by sampling.
arXiv Detail & Related papers (2023-07-19T10:27:34Z) - ProbVLM: Probabilistic Adapter for Frozen Vision-Language Models [69.50316788263433]
We propose ProbVLM, a probabilistic adapter that estimates probability distributions for the embeddings of pre-trained vision-language models.
We quantify the calibration of embedding uncertainties in retrieval tasks and show that ProbVLM outperforms other methods.
We present a novel technique for visualizing the embedding distributions using a large-scale pre-trained latent diffusion model.
arXiv Detail & Related papers (2023-07-01T18:16:06Z) - PyHHMM: A Python Library for Heterogeneous Hidden Markov Models [63.01207205641885]
PyHHMM is an object-oriented Python implementation of Heterogeneous-Hidden Markov Models (HHMMs)
PyHHMM emphasizes features not supported in similar available frameworks: a heterogeneous observation model, missing data inference, different model order selection criterias, and semi-supervised training.
PyHHMM relies on the numpy, scipy, scikit-learn, and seaborn Python packages, and is distributed under the Apache-2.0 License.
arXiv Detail & Related papers (2022-01-12T07:32:36Z) - MRCpy: A Library for Minimax Risk Classifiers [10.380882297891272]
Python library, MRCpy, implements minimax risk classifiers (MRCs) based on the robust risk minimization (RRM) approach.
MRCpy follows the standards of popular Python libraries, such as scikit-learn, facilitating readability and easy usage together with a seamless integration with other libraries.
arXiv Detail & Related papers (2021-08-04T10:31:20Z) - BayesSimIG: Scalable Parameter Inference for Adaptive Domain
Randomization with IsaacGym [59.53949960353792]
BayesSimIG is a library that provides an implementation of BayesSim integrated with the recently released NVIDIA IsaacGym.
BayesSimIG provides an integration with NVIDIABoard to easily visualize slices of high-dimensional posteriors.
arXiv Detail & Related papers (2021-07-09T16:21:31Z) - Picasso: A Sparse Learning Library for High Dimensional Data Analysis in
R and Python [77.33905890197269]
We describe a new library which implements a unified pathwise coordinate optimization for a variety of sparse learning problems.
The library is coded in R++ and has user-friendly sparse experiments.
arXiv Detail & Related papers (2020-06-27T02:39:24Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.