Skip to main content

Aligner - PyTorch

Project description

Sequence alignement methods with helpers for PyTorch.

Install

pip install aligner-pytorch

PyPI - Python Version

Usage

MAS

MAS (Monotonic Alignment Search) from GlowTTS. This can be used to get the alignment of any (similarity) matrix. Implementation in optimized Cython.

from aligner_pytorch import mas 

sim = torch.rand(1, 4, 6) # [batch_size, m_rows, n_cols]
alignment = mas(x)

"""
sim = tensor([[
    [0.2, 0.8, 0.9, 0.9, 0.9, 0.4],
    [0.6, 0.8, 0.9, 0.7, 0.1, 0.4],
    [1.0, 0.4, 0.4, 0.2, 1.0, 0.7],
    [0.1, 0.3, 0.1, 0.7, 0.6, 0.9]
]])

alignment = tensor([[
    [1, 0, 0, 0, 0, 0],
    [0, 1, 1, 1, 0, 0],
    [0, 0, 0, 0, 1, 0],
    [0, 0, 0, 0, 0, 1]
]], dtype=torch.int32)
"""

Citations

Monotonic Alignment Search

@misc{2005.11129,
Author = {Jaehyeon Kim and Sungwon Kim and Jungil Kong and Sungroh Yoon},
Title = {Glow-TTS: A Generative Flow for Text-to-Speech via Monotonic Alignment Search},
Year = {2020},
Eprint = {arXiv:2005.11129},
}

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

aligner-pytorch-0.0.1.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

aligner_pytorch-0.0.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file aligner-pytorch-0.0.1.tar.gz.

File metadata

  • Download URL: aligner-pytorch-0.0.1.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for aligner-pytorch-0.0.1.tar.gz
Algorithm Hash digest
SHA256 dce3d2e94188cf88021b8a9412eb9fe3dd8589991892e7830a76e88e49e0f52f
MD5 5e87cf39b10f07b904eb61cbd2691c15
BLAKE2b-256 f20ced2f11dbaf53c7c6b3e47c2a02fa4b8ffc78512d5ebd2e9d53a8e7d516b1

See more details on using hashes here.

File details

Details for the file aligner_pytorch-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for aligner_pytorch-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0b981ac14bb6b8362f6d99dc53306c432f8ac3b557aec532936a24a2d27502d0
MD5 6343df2b3c6e235f6202afc94f96c718
BLAKE2b-256 7169a0c29fcbc6894635138fd83ab9ff7cf95bb31941afa8add8dadcfca03050

See more details on using hashes here.

Supported by

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