pub struct AccuracyComparison {
pub original_accuracy: f32,
pub quantized_accuracy: f32,
pub accuracy_drop: f32,
pub accuracy_drop_percentage: f32,
pub is_acceptable: bool,
pub detailed_metrics: HashMap<String, f32>,
}Expand description
Accuracy comparison between quantized and original models
Fields§
§original_accuracy: f32Original model accuracy
quantized_accuracy: f32Quantized model accuracy
accuracy_drop: f32Accuracy drop (original - quantized)
accuracy_drop_percentage: f32Accuracy drop as percentage
is_acceptable: boolWhether the accuracy drop is acceptable
detailed_metrics: HashMap<String, f32>Additional metrics for detailed comparison
Implementations§
Source§impl AccuracyComparison
impl AccuracyComparison
Sourcepub fn new(original_accuracy: f32, quantized_accuracy: f32) -> Self
pub fn new(original_accuracy: f32, quantized_accuracy: f32) -> Self
Create a new accuracy comparison
Sourcepub fn new_with_threshold(
original_accuracy: f32,
quantized_accuracy: f32,
acceptable_drop_percentage: f32,
) -> Self
pub fn new_with_threshold( original_accuracy: f32, quantized_accuracy: f32, acceptable_drop_percentage: f32, ) -> Self
Create a new accuracy comparison with custom acceptable threshold
Sourcepub fn add_metric(&mut self, name: String, value: f32)
pub fn add_metric(&mut self, name: String, value: f32)
Add a detailed metric for comparison
Sourcepub fn efficiency_score(&self) -> f32
pub fn efficiency_score(&self) -> f32
Get the efficiency score based on accuracy preservation
Sourcepub fn is_quantization_recommended(&self) -> bool
pub fn is_quantization_recommended(&self) -> bool
Check if quantization is recommended based on accuracy
Trait Implementations§
Source§impl Clone for AccuracyComparison
impl Clone for AccuracyComparison
Source§fn clone(&self) -> AccuracyComparison
fn clone(&self) -> AccuracyComparison
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AccuracyComparison
impl RefUnwindSafe for AccuracyComparison
impl Send for AccuracyComparison
impl Sync for AccuracyComparison
impl Unpin for AccuracyComparison
impl UnsafeUnpin for AccuracyComparison
impl UnwindSafe for AccuracyComparison
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> 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>
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