[][src]Trait finalfusion::storage::Quantize

pub trait Quantize {
    fn quantize_using<T, R>(
        &self,
        n_subquantizers: usize,
        n_subquantizer_bits: u32,
        n_iterations: usize,
        n_attempts: usize,
        normalize: bool,
        rng: R
    ) -> QuantizedArray
    where
        T: TrainPQ<f32>,
        R: RngCore + SeedableRng + Send
; fn quantize<T>(
        &self,
        n_subquantizers: usize,
        n_subquantizer_bits: u32,
        n_iterations: usize,
        n_attempts: usize,
        normalize: bool
    ) -> QuantizedArray
    where
        T: TrainPQ<f32>
, { ... } }

Quantizable embedding matrix.

Required methods

fn quantize_using<T, R>(
    &self,
    n_subquantizers: usize,
    n_subquantizer_bits: u32,
    n_iterations: usize,
    n_attempts: usize,
    normalize: bool,
    rng: R
) -> QuantizedArray where
    T: TrainPQ<f32>,
    R: 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.

Loading content...

Provided methods

fn quantize<T>(
    &self,
    n_subquantizers: usize,
    n_subquantizer_bits: u32,
    n_iterations: usize,
    n_attempts: usize,
    normalize: bool
) -> 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.

Loading content...

Implementors

impl<S> Quantize for S where
    S: StorageView
[src]

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

Quantize the embedding matrix.

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

Loading content...