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)}")
# 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.
Metadata
Release files for pyvq 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| pyvq-0.2.0-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details |
| pyvq-0.2.0-cp310-abi3-manylinux_2_24_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.24+ ARM64 | Details |
| pyvq-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| pyvq-0.2.0-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details |
Total release size: 2.1 MB
Release files / pyvq-0.2.0-cp310-abi3-win_amd64.whl
| Download URL | pyvq-0.2.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 795.4 kB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
9eff7fc64d62b572015d356347883e4a5e4103d10da6fba2132f5a02737ecc8a
|
|
BLAKE2b-256 checksum How to use checksums |
509d3309a267cbf1e5b06605bcf3610ee2ea031162c6942bec24a1862d27fb31
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / pyvq-0.2.0-cp310-abi3-manylinux_2_24_aarch64.whl
| Download URL | pyvq-0.2.0-cp310-abi3-manylinux_2_24_aarch64.whl |
|---|---|
| Size | 433.2 kB |
| Tags | CPython 3.10 Linux glibc 2.24+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
4ed0e2257df5ae1d9636a24bd532829a84d8f8a7cb4508f8e5ed0958458b5f95
|
|
BLAKE2b-256 checksum How to use checksums |
4ef6b3446919708fd1a0c528d6cc910fd4568d69510596dcfcc8ad1b167103be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / pyvq-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | pyvq-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 454.7 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
7e8684eaf5998f7b53e4a0e629617f0e54ee508919b4a76563a09811e957abb0
|
|
BLAKE2b-256 checksum How to use checksums |
868c73f1976df9301950ebee795afa5af53da33be07dad2173a55021361a4e2d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / pyvq-0.2.0-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | pyvq-0.2.0-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 404.6 kB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
7717f5bf82f9d443293bd99b9b75c62ef86a573be66887ead1fe155b3898b5d9
|
|
BLAKE2b-256 checksum How to use checksums |
60742faee4cabf28b147ebad455561d2977aabee964323949d55167f1b0f7c66
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|