[−][src]Trait finalfusion::embeddings::Quantize
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: &mut R
) -> Embeddings<V, QuantizedArray> where
T: TrainPQ<f32>,
R: Rng,
&self,
n_subquantizers: usize,
n_subquantizer_bits: u32,
n_iterations: usize,
n_attempts: usize,
normalize: bool,
rng: &mut R
) -> Embeddings<V, QuantizedArray> where
T: TrainPQ<f32>,
R: Rng,
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
fn quantize<T>(
&self,
n_subquantizers: usize,
n_subquantizer_bits: u32,
n_iterations: usize,
n_attempts: usize,
normalize: bool
) -> Embeddings<V, QuantizedArray> where
T: TrainPQ<f32>,
&self,
n_subquantizers: usize,
n_subquantizer_bits: u32,
n_iterations: usize,
n_attempts: usize,
normalize: bool
) -> Embeddings<V, 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.
Implementors
impl<V, S> Quantize<V> for Embeddings<V, S> where
V: Vocab,
S: StorageView,
[src]
V: Vocab,
S: StorageView,
fn quantize_using<T, R>(
&self,
n_subquantizers: usize,
n_subquantizer_bits: u32,
n_iterations: usize,
n_attempts: usize,
normalize: bool,
rng: &mut R
) -> Embeddings<V, QuantizedArray> where
T: TrainPQ<f32>,
R: Rng,
[src]
&self,
n_subquantizers: usize,
n_subquantizer_bits: u32,
n_iterations: usize,
n_attempts: usize,
normalize: bool,
rng: &mut R
) -> Embeddings<V, QuantizedArray> where
T: TrainPQ<f32>,
R: Rng,
fn quantize<T>(
&self,
n_subquantizers: usize,
n_subquantizer_bits: u32,
n_iterations: usize,
n_attempts: usize,
normalize: bool
) -> Embeddings<V, QuantizedArray> where
T: TrainPQ<f32>,
[src]
&self,
n_subquantizers: usize,
n_subquantizer_bits: u32,
n_iterations: usize,
n_attempts: usize,
normalize: bool
) -> Embeddings<V, QuantizedArray> where
T: TrainPQ<f32>,