pub enum CalibrationMethod {
MinMax,
Percentile(f32),
Entropy,
MSE,
Adaptive,
Custom(Arc<dyn CalibrationFunction>),
}Expand description
Calibration methods for quantization parameter optimization
Different calibration methods offer trade-offs between computational cost, robustness to outliers, and final quantization accuracy.
Variants§
MinMax
Simple min-max calibration
Uses the minimum and maximum values in the data to set quantization range. Fast but sensitive to outliers.
Percentile(f32)
Percentile-based calibration
Uses a specified percentile to clip outliers before determining range. More robust than min-max but requires tuning the percentile parameter.
Entropy
Entropy-based calibration (KL divergence minimization)
Minimizes the KL divergence between original and quantized distributions. Provides good accuracy but is computationally expensive.
MSE
Mean squared error minimization
Finds parameters that minimize MSE between original and quantized values. Good balance between accuracy and computational cost.
Adaptive
Adaptive method selection
Automatically selects the best method based on data characteristics. Uses multiple methods and picks the one with best validation score.
Custom(Arc<dyn CalibrationFunction>)
Custom calibration with user-defined function
Allows users to provide their own calibration logic for specialized use cases or domain-specific optimization.
Trait Implementations§
Source§impl Clone for CalibrationMethod
impl Clone for CalibrationMethod
Auto Trait Implementations§
impl Freeze for CalibrationMethod
impl !RefUnwindSafe for CalibrationMethod
impl Send for CalibrationMethod
impl Sync for CalibrationMethod
impl Unpin for CalibrationMethod
impl UnsafeUnpin for CalibrationMethod
impl !UnwindSafe for CalibrationMethod
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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