Skip to main content

A numerically stable implementation of essential HMM algorithms with tutorials on training methods

Project description

Homomorph

Homomorph is yet another implementation of essential HMM algorithms in Python. (Its name is a reference to its similarity to the countless other HMM packages available on PyPI.) What sets Homomorph apart is its focus on flexibility, numerical stability, and clarity of exposition. For example, though hmmlearn is popular, it only natively supports HMMs with normal, mixture normal, or categorical emission distributions. In contrast, Homomorph can directly model states parametrized by arbitrary distributions. Unlike hmmlearn, it does not provide built-in methods for fitting HMMs to data since they would necessarily rely on general-purpose optimization algorithms. Instead, training methods are discussed for specific examples in the training tutorial. It covers many scenarios and approaches, including categorical and normal emission distributions with labeled and unlabeled data. Although the HMM class is fully documented, the HMM tutorial is the recommended introduction to the Homomorph API.

Dependencies

Homomorph is designed to be lightweight and only requires NumPy for array calculations and SciPy for its implementation of random variables. The minimum version for NumPy was set to the most recent at the time of initial release (1.17), but no functionality specific to this release is needed to my knowledge. SciPy, on the other hand, must be at least version 1.9. The reasons for this are highly technical, but the core issue was previous versions of SciPy did not strongly distinguish between discrete and continuous frozen random variables. As a result, reliably extracting the correct probability functions (the pmf and pdf, respectively) was extremely difficult. Although Homomorph does not directly use SciPy in its implementation, its practical use depends so strongly on it that this ambiguity effectively broke Homomorph. Fortunately, versions 1.9 and later have corrected this problem.

Installation

To install Homomorph, run the following command:

pip install homomorph

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

homomorph-0.3.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

homomorph-0.3.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file homomorph-0.3.0.tar.gz.

File metadata

  • Download URL: homomorph-0.3.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 CPython/3.8.13

File hashes

Hashes for homomorph-0.3.0.tar.gz
Algorithm Hash digest
SHA256 69e65389092ea98b3e9b8b4029e2cfaf788e36f8d7b15c6c870802e956de5c2d
MD5 aab91e4cb16cfc6e592d6e9c674018ca
BLAKE2b-256 d8caaf6619abcfda7a7f9d40ee4ff545baaaf3a5cd670f56b632efc47b8ef9d9

See more details on using hashes here.

File details

Details for the file homomorph-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: homomorph-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 CPython/3.8.13

File hashes

Hashes for homomorph-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ec7d1500def7d252928591bdd8fb0ff703978cead81ae4037231fc709c157a0c
MD5 55eb7b228b8c40cbd2b16f5a24823f61
BLAKE2b-256 102fe56d8d2b10ce80d298ccab494a748f40a6fd77b21a74301ae5b5e995dbac

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page