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)}")

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.0a2-pp39-pypy39_pp73-manylinux_2_24_aarch64.whl (374.6 kB view details)

Uploaded PyPymanylinux: glibc 2.24+ ARM64

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

Uploaded CPython 3.10+Windows x86-64

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

Uploaded CPython 3.10+manylinux: glibc 2.24+ ARM64

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

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

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

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for pyvq-0.1.0a2-pp39-pypy39_pp73-manylinux_2_24_aarch64.whl
Algorithm Hash digest
SHA256 e3a65ed4f564cf87e5cf774ab031eb7c91aa7b5ffd7e57b18149724eb705c129
MD5 f483dee35d315e8e03d6eded2446af25
BLAKE2b-256 4e63377219fd99c7b867e2c7e52e40a6d580579d921c1e59458f1a9f95587202

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyvq-0.1.0a2-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 705.5 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.0a2-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f2073ef14915ef303eb62cffa01c0442d3312f30d36b68f2289da60c8292c625
MD5 a8fb3fd952df03f4aebc37bf26875979
BLAKE2b-256 d5c9dbdbf473752c9b899d478d4aee13e009b78dc2e86944535fffebc0ab65ef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvq-0.1.0a2-cp310-abi3-manylinux_2_24_aarch64.whl
Algorithm Hash digest
SHA256 f50ccd404630e8aabf90ecb3c85542e6c02f4037e655cbea554fcdd59de13b7b
MD5 680a3b8ac046157706fa34879bf8f835
BLAKE2b-256 ac1661bdee39e2c61ce029ea314dd38d91fb7732e861ea48ea182c2b14e369ba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvq-0.1.0a2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cc9b7759950f8d94c1e6437d86d2d265aaa0b7b3b9b4ccbcf2906c2b47192c88
MD5 8b568e59aeb7d769f180ea6d35215e7a
BLAKE2b-256 feaeeb7e98c960168a51a6acd51430af3b3911278376df7d42b9eece835ed188

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvq-0.1.0a2-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dbb5936fd6d53e500f1c59cdf97d08432c6f9ea1dc1ca7b61868afe2937b61be
MD5 5be7f39debfc945ca75c9420ee8ee180
BLAKE2b-256 7eecbd5b12f2d96e4e712f350c2c6ee1419bad317132b243dfd5d204573a3627

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