pub struct ImportanceStats {
pub min: f32,
pub max: f32,
pub mean: f32,
pub std: f32,
pub sparsity_at_threshold: Vec<(f32, f32)>,
}Expand description
Statistical summary of importance scores.
Provides min, max, mean, std for analyzing the distribution of importance values before thresholding.
Fields§
§min: f32Minimum importance value
max: f32Maximum importance value
mean: f32Mean importance value
std: f32Standard deviation of importance values
sparsity_at_threshold: Vec<(f32, f32)>Sparsity achieved at various thresholds: (threshold, sparsity_ratio)
Implementations§
Source§impl ImportanceStats
impl ImportanceStats
Sourcepub fn from_tensor(values: &Tensor) -> Self
pub fn from_tensor(values: &Tensor) -> Self
Sourcepub fn sparsity_at(&self, values: &Tensor, threshold: f32) -> f32
pub fn sparsity_at(&self, values: &Tensor, threshold: f32) -> f32
Compute sparsity at given threshold.
Sparsity is the fraction of values below the threshold.
Trait Implementations§
Source§impl Clone for ImportanceStats
impl Clone for ImportanceStats
Source§fn clone(&self) -> ImportanceStats
fn clone(&self) -> ImportanceStats
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 moreSource§impl Debug for ImportanceStats
impl Debug for ImportanceStats
Auto Trait Implementations§
impl Freeze for ImportanceStats
impl RefUnwindSafe for ImportanceStats
impl Send for ImportanceStats
impl Sync for ImportanceStats
impl Unpin for ImportanceStats
impl UnsafeUnpin for ImportanceStats
impl UnwindSafe for ImportanceStats
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