pub trait Quantize {
    // Required method
    fn quantize_using<T, R>(
        &self,
        n_subquantizers: usize,
        n_subquantizer_bits: u32,
        n_iterations: usize,
        n_attempts: usize,
        normalize: bool,
        rng: R
    ) -> Result<QuantizedArray>
       where T: TrainPq<f32>,
             R: CryptoRng + RngCore + SeedableRng + Send;

    // Provided method
    fn quantize<T>(
        &self,
        n_subquantizers: usize,
        n_subquantizer_bits: u32,
        n_iterations: usize,
        n_attempts: usize,
        normalize: bool
    ) -> Result<QuantizedArray>
       where T: TrainPq<f32> { ... }
}
Expand description

Quantizable embedding matrix.

Required Methods§

source

fn quantize_using<T, R>( &self, n_subquantizers: usize, n_subquantizer_bits: u32, n_iterations: usize, n_attempts: usize, normalize: bool, rng: R ) -> Result<QuantizedArray>where T: TrainPq<f32>, R: CryptoRng + RngCore + SeedableRng + Send,

Quantize the embedding matrix using the provided RNG.

This method trains a quantizer for the embedding matrix and then quantizes the matrix using this quantizer.

Provided Methods§

source

fn quantize<T>( &self, n_subquantizers: usize, n_subquantizer_bits: u32, n_iterations: usize, n_attempts: usize, normalize: bool ) -> Result<QuantizedArray>where T: TrainPq<f32>,

Quantize the embedding matrix.

This method trains a quantizer for the embedding matrix and then quantizes the matrix using this quantizer.

The xorshift PRNG is used for picking the initial quantizer centroids.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<S> Quantize for Swhere S: StorageView,