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.

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=-1.0, max=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)}")

# Check the SIMD backend in use
print(f"SIMD Backend: {pyvq.get_simd_backend()}")

Documentation

Visit PyVq's documentation page for more 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.0-pp39-pypy39_pp73-manylinux_2_24_aarch64.whl (376.5 kB view details)

Uploaded PyPymanylinux: glibc 2.24+ ARM64

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

Uploaded CPython 3.10+Windows x86-64

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

Uploaded CPython 3.10+manylinux: glibc 2.24+ ARM64

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

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

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

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for pyvq-0.1.0-pp39-pypy39_pp73-manylinux_2_24_aarch64.whl
Algorithm Hash digest
SHA256 f87d437e6324b10e2e11134653796be22bc811148bfbf2511f61daf3faddb559
MD5 1f6c981d313cb58aba765379b6c08728
BLAKE2b-256 0ee01484c1ffd008e10fad475666b93bccef4ffd53cf340502465cd24874e9d3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyvq-0.1.0-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 707.8 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.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 89c9651f908636577dc699c61c41441ddec8d0dfaf1d9f91251b264a8dd0ce06
MD5 b30eec64e7921f365e66c10ce953bf91
BLAKE2b-256 da81db44f97e3cab14b6755fcfe5b14a19a4422eb397f3586b4d985ada2dd383

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvq-0.1.0-cp310-abi3-manylinux_2_24_aarch64.whl
Algorithm Hash digest
SHA256 2e41490e1c7ba42b37fb0cf6c6de10b8812ebdd1ff61831316aed10251e7d751
MD5 d55e578e48a9f656c543edf9629ce112
BLAKE2b-256 d106854438b7e96bdb5b0d5f541a87c058e65eb33b3e3b61cd70da607d957cc1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvq-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 90368597bd45a030b448687c7b18c14ed8c71e12bbbcb98bef5ed7c1cf692ca3
MD5 75cf5155da5f31e7723254fcfe1c04d4
BLAKE2b-256 acee36d76e40bc2b8eb40f45a1a42211c03e456790ccaa2158b5387a070570ef

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyvq-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 347.2 kB
  • Tags: CPython 3.10+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for pyvq-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8da554420814d633a133e510bfe97b5519fd8329f267eef3f879dded48feb2a7
MD5 44e015b2fda0fccc046a4072fbf9bcc2
BLAKE2b-256 4a474dacfb2044b0ebe28c832f8cbe24ac9607f89a3e472aaaaca282b606f000

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