pub struct EnsembleCompressor { /* private fields */ }Expand description
Ensemble compressor
Implementations§
Source§impl EnsembleCompressor
impl EnsembleCompressor
Sourcepub fn new(config: CompressionConfig) -> Self
pub fn new(config: CompressionConfig) -> Self
Create a new ensemble compressor
Sourcepub fn knowledge_distillation(
compression_ratio: Float,
temperature: Float,
) -> Self
pub fn knowledge_distillation( compression_ratio: Float, temperature: Float, ) -> Self
Create compressor with knowledge distillation
Sourcepub fn ensemble_pruning(
compression_ratio: Float,
quality_threshold: Float,
) -> Self
pub fn ensemble_pruning( compression_ratio: Float, quality_threshold: Float, ) -> Self
Create compressor with ensemble pruning
Sourcepub fn quantization(bits: u8) -> Self
pub fn quantization(bits: u8) -> Self
Create compressor with quantization
Sourcepub fn bayesian_optimization(
performance_cost_trade_off: Float,
n_calls: usize,
random_state: Option<u64>,
) -> Self
pub fn bayesian_optimization( performance_cost_trade_off: Float, n_calls: usize, random_state: Option<u64>, ) -> Self
Create compressor with Bayesian optimization
Sourcepub fn compress<T>(
&mut self,
ensemble: &[T],
x_val: &Array2<Float>,
y_val: &Array1<Int>,
) -> Result<CompressedEnsemble<T>>
pub fn compress<T>( &mut self, ensemble: &[T], x_val: &Array2<Float>, y_val: &Array1<Int>, ) -> Result<CompressedEnsemble<T>>
Compress an ensemble using the configured strategy
Sourcepub fn stats(&self) -> Option<&CompressionStats>
pub fn stats(&self) -> Option<&CompressionStats>
Get compression statistics
Sourcepub fn reset_stats(&mut self)
pub fn reset_stats(&mut self)
Reset compression statistics
Auto Trait Implementations§
impl Freeze for EnsembleCompressor
impl RefUnwindSafe for EnsembleCompressor
impl Send for EnsembleCompressor
impl Sync for EnsembleCompressor
impl Unpin for EnsembleCompressor
impl UnwindSafe for EnsembleCompressor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more