vq 0.1.1

A vector quantization library for Rust
Documentation
vq-0.1.1 has been yanked.

Vq

Vq (v[ector] q[uantiztion]) is a Rust library that implements several popular vector quantization algorithms including binary, scalar, and product quantization algorithms. It provides a simple, efficient API for data compression that help reduce memory usage and computational overhead.

Features

Installation

cargo add vq

Documentation

Find the latest documentation here or on docs.rs.

Check out the tests directory for detailed examples of using Vq.

Quick Example

Here's a simple example using the scalar quantization:

use vq::sq::ScalarQuantizer;
use vq::vector::Vector;

fn main() {
    // Create a scalar quantizer for values in the range [0.0, 1.0] with 256 levels.
    let quantizer = ScalarQuantizer::new(0.0, 1.0, 256);

    // Create an input vector.
    let input = Vector::new(vec![0.1, 0.5, -0.8, -0.3, 0.9]);

    // Quantize the input vector.
    let quantized_input = quantizer.quantize(&input);

    println!("Quantized input vector: {}", quantized_input);
}

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details on how to contribute.

License

Vq is available under the terms of either of the following licenses: