Python bindings for the Vq library
Project description
PyVq
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)}")
Documentation
Visit PyVq's documentation page for more information including examples and API references.
License
PyVq is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyvq-0.1.0a3-pp39-pypy39_pp73-manylinux_2_24_aarch64.whl.
File metadata
- Download URL: pyvq-0.1.0a3-pp39-pypy39_pp73-manylinux_2_24_aarch64.whl
- Upload date:
- Size: 376.4 kB
- Tags: PyPy, manylinux: glibc 2.24+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95b4b353a7bd15d8026c3949e4b75acae06112c3b5e39b10ddb52e020d0fba4e
|
|
| MD5 |
aabeab29bf2f8ea3b2b50dfd99e5452f
|
|
| BLAKE2b-256 |
6f617c06e32fe49be40b7cea44e1d591fb96db618dc67dece1d0fcf175604fce
|
File details
Details for the file pyvq-0.1.0a3-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: pyvq-0.1.0a3-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 707.7 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dccea48c31e247f1df13b4a61cfcc8611cd325685ae1417b8fdd8a1148b24d8e
|
|
| MD5 |
50aaf8ebf9324d579f8a585d5b42c603
|
|
| BLAKE2b-256 |
29ef9329d70eb5fa226820ceb5ef0c457051e91d96e3d840db104880c570576a
|
File details
Details for the file pyvq-0.1.0a3-cp310-abi3-manylinux_2_24_aarch64.whl.
File metadata
- Download URL: pyvq-0.1.0a3-cp310-abi3-manylinux_2_24_aarch64.whl
- Upload date:
- Size: 375.7 kB
- Tags: CPython 3.10+, manylinux: glibc 2.24+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eeaf528d1842c9a77fe05712428eadeefc02e1287db80943f0a18b11e9e2f1cd
|
|
| MD5 |
fb60f90a15eec81314ce5ab8700943ca
|
|
| BLAKE2b-256 |
2f0e25c0c2b5ada36809ea4f4ca7d890eec1ba2463a21b21958335a1828ec043
|
File details
Details for the file pyvq-0.1.0a3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: pyvq-0.1.0a3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 388.5 kB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d826b96b56624975bbbda4bec4d14152fcb409468d2045664f6a24a65d3d66bd
|
|
| MD5 |
9d55c3e612ed1f2c487b2a9e457f1675
|
|
| BLAKE2b-256 |
670abbb22d3e53dea6940af6e3a52be78124e0c6040d81a19aba66e927bf2cfe
|
File details
Details for the file pyvq-0.1.0a3-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: pyvq-0.1.0a3-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68938df498a58e3b89e0007b77ecb66d8d519994c4073f67281f702ac21b335a
|
|
| MD5 |
ce4041bb21b6db7c2ddfc3972e0e1ff5
|
|
| BLAKE2b-256 |
d961dbecd30ca9f620fa416957c7e8f1c9ef3d0b72ee6ba03f48d0dfa46580bf
|