pub struct SensitivityAnalyzer { /* private fields */ }Expand description
Quantization sensitivity analyzer
Implementations§
Source§impl SensitivityAnalyzer
impl SensitivityAnalyzer
Sourcepub fn set_tolerance(&mut self, tolerance: f32)
pub fn set_tolerance(&mut self, tolerance: f32)
Set tolerance for accuracy comparison
Sourcepub fn analyze_layer_sensitivity(
&self,
layer_names: &[String],
evaluation_fn: impl Fn(&str, &QuantConfig) -> TorshResult<f32>,
) -> TorshResult<SensitivityAnalysisResults>
pub fn analyze_layer_sensitivity( &self, layer_names: &[String], evaluation_fn: impl Fn(&str, &QuantConfig) -> TorshResult<f32>, ) -> TorshResult<SensitivityAnalysisResults>
Perform sensitivity analysis on a model’s layers
Sourcepub fn heuristic_sensitivity_analysis(
&self,
layer_names: &[String],
) -> TorshResult<SensitivityAnalysisResults>
pub fn heuristic_sensitivity_analysis( &self, layer_names: &[String], ) -> TorshResult<SensitivityAnalysisResults>
Perform heuristic sensitivity analysis based on layer types
Sourcepub fn compare_tensor_accuracy(
&self,
original: &Tensor,
quantized: &Tensor,
) -> TorshResult<f32>
pub fn compare_tensor_accuracy( &self, original: &Tensor, quantized: &Tensor, ) -> TorshResult<f32>
Compare accuracy between original and quantized tensors
Sourcepub fn calculate_mse(
&self,
original: &Tensor,
quantized: &Tensor,
) -> TorshResult<f32>
pub fn calculate_mse( &self, original: &Tensor, quantized: &Tensor, ) -> TorshResult<f32>
Calculate Mean Squared Error between tensors
Sourcepub fn calculate_snr(
&self,
original: &Tensor,
quantized: &Tensor,
) -> TorshResult<f32>
pub fn calculate_snr( &self, original: &Tensor, quantized: &Tensor, ) -> TorshResult<f32>
Calculate Signal-to-Noise Ratio
Auto Trait Implementations§
impl Freeze for SensitivityAnalyzer
impl RefUnwindSafe for SensitivityAnalyzer
impl Send for SensitivityAnalyzer
impl Sync for SensitivityAnalyzer
impl Unpin for SensitivityAnalyzer
impl UnsafeUnpin for SensitivityAnalyzer
impl UnwindSafe for SensitivityAnalyzer
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