viterbi_trellis
Library to compute the best path through a trellis graph using the Viterbi algorithm.
The source for this project is available here.
This library provides the class ViterbiTrellis. At present it can only do one thing: compute the best path through a trellis graph. The user must provide three inputs:
Trellis layer structure, specified as a list of lists. Each inner list corresponds to a single layer of the trellis. The first item in the outer list is the start layer, while the final item is the end layer. Each innermost item is an object representing the state. This could be a primitive type such as an int, or it could be a tuple or user-defined class.
A cost function giving the cost for being in a given state.
A transition function giving the cost of transitioning between two particular states.
The best path is chosen by globally minimizing the sum of the state costs and transitions via the Viterbi algorithm.
Example usage:
from viterbi_trellis import ViterbiTrellis v = ViterbiTrellis([[2, 6, 4], [4, 6], [0, 2, 6]], lambda x: x / 2.0, lambda x, y: abs(y - x)) best_path = v.viterbi_best_path()
The return value in best_path is a list of indices of the states in the best path:
>>> best_path [2, 0, 1]
This result corresponds to the states labeled [4, 4, 2] in the input trellis.
Metadata
Release files for viterbi-trellis 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| viterbi_trellis-0.0.3.tar.gz | 5.9 kB | Without provenance | Details for viterbi_trellis-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| viterbi_trellis-0.0.3-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for viterbi_trellis-0.0.3-py2.py3-none-any.whl |
Total release size: 13.0 kB
Release files / viterbi_trellis-0.0.3.tar.gz
| Download URL | viterbi_trellis-0.0.3.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
93ec0be923da7143a73c186e3b5322980b131ba209f666679ae8718f1f7e1bf6
|
|
BLAKE2b-256 checksum How to use checksums |
0305ad07dce92829f59a695f9c2b3474fdbb8e5032f183c81ca7f078a801c6fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / viterbi_trellis-0.0.3-py2.py3-none-any.whl
| Download URL | viterbi_trellis-0.0.3-py2.py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
76417a1c6c032392f91ee816be31202087954834006a5758f4244ffdefa92b71
|
|
BLAKE2b-256 checksum How to use checksums |
9bd9ebcecf39ea01767aa9eb1a268acd5d2eeaf55a6039f24257ba5e14ad5a52
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for viterbi-trellis 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.