Skip to main content

Python bindings for the Vq library

Project description

PyVq

Python version PyPI version Documentation License: MIT

PyVq provides Python bindings for Vq vector quantization library.

[!IMPORTANT] PyVq is in early development, so breaking changes and bugs are expected. Please report bugs on GitHub issues.

Installation

pip install pyvq

Quickstart

import numpy as np
import pyvq

# Binary Quantization
bq = pyvq.BinaryQuantizer(threshold=0.0, low=0, high=1)
vector = np.array([-0.5, 0.0, 0.5, 1.0], dtype=np.float32)
codes = bq.quantize(vector)
print(f"Binary codes: {codes}")  # [0, 1, 1, 1]

# Scalar Quantization  
sq = pyvq.ScalarQuantizer(min_val=-1.0, max_val=1.0, levels=256)
quantized = sq.quantize(vector)
reconstructed = sq.dequantize(quantized)
print(f"Reconstructed: {reconstructed}")

# Distance Computation
dist = pyvq.Distance.euclidean()
a = np.array([1.0, 2.0, 3.0], dtype=np.float32)
b = np.array([4.0, 5.0, 6.0], dtype=np.float32)
print(f"Distance: {dist.compute(a, b)}")

Documentation

Visit PyVq's documentation page for detailed information including examples and API references.

License

PyVq is licensed under the MIT License.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

pyvq-0.1.0a1-pp39-pypy39_pp73-manylinux_2_24_aarch64.whl (375.9 kB view details)

Uploaded PyPymanylinux: glibc 2.24+ ARM64

pyvq-0.1.0a1-cp310-abi3-win_amd64.whl (706.2 kB view details)

Uploaded CPython 3.10+Windows x86-64

pyvq-0.1.0a1-cp310-abi3-manylinux_2_24_aarch64.whl (375.3 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.24+ ARM64

pyvq-0.1.0a1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (387.7 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

pyvq-0.1.0a1-cp310-abi3-macosx_11_0_arm64.whl (347.0 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

Details for the file pyvq-0.1.0a1-pp39-pypy39_pp73-manylinux_2_24_aarch64.whl.

File metadata

File hashes

Hashes for pyvq-0.1.0a1-pp39-pypy39_pp73-manylinux_2_24_aarch64.whl
Algorithm Hash digest
SHA256 2e21e884f8802e8e0fa8d43323d64d77945aa4f31188cbcf882989dedd510d3e
MD5 638cd7ab94bd66ce367b759492c7fcb6
BLAKE2b-256 e15a6ba858283c276b14651495575548977837d410a0d697e28e1f6bd0563fa6

See more details on using hashes here.

File details

Details for the file pyvq-0.1.0a1-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: pyvq-0.1.0a1-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 706.2 kB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for pyvq-0.1.0a1-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 a0991043c940e1020f4745ec9690fc4a8f365c36404b795ac31a1144c43d4361
MD5 972b5e5667c1cdbf3712234aa14d8037
BLAKE2b-256 b6213946c2cc56016d5ed825dd0cf6aafc9eeb582b2b206c86b7ca86a913f6bc

See more details on using hashes here.

File details

Details for the file pyvq-0.1.0a1-cp310-abi3-manylinux_2_24_aarch64.whl.

File metadata

File hashes

Hashes for pyvq-0.1.0a1-cp310-abi3-manylinux_2_24_aarch64.whl
Algorithm Hash digest
SHA256 7bfd79b83e1edf806fbc3566a24520fc7c1d852d042f3a14dd64a7efc3e3c94c
MD5 95c6ccba7a3b392d1fce2f5392efdde0
BLAKE2b-256 5f54c70c5f16eaa3ba4d14e36676c0e57e436cc265d8902afb7da0f11a629dad

See more details on using hashes here.

File details

Details for the file pyvq-0.1.0a1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyvq-0.1.0a1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 71b52ce403f7b3da8cc7494b150056162947d394bd1eef3042c1bfcb93a79b2f
MD5 ddd8e3e2d280a63692f0a4b15f7e9e73
BLAKE2b-256 661c2c3d0817e3fba0b6adc960c43ba605a730f7b0d03c1b65a8136916ab6a54

See more details on using hashes here.

File details

Details for the file pyvq-0.1.0a1-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyvq-0.1.0a1-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8eaee286ebdb26c68d987c6c662de8e5a22db285cf521c043b4c9753906ccc3b
MD5 6b217956a5b6ca043c78ecd637fced05
BLAKE2b-256 6d36d11597c5b79c83f9b27716eae5e760be821d752b39db48d31aa7d9475aff

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