pub struct LayerSensitivity {
pub layer_name: String,
pub gradient_norm: f64,
pub weight_variance: f64,
pub activation_range: f64,
pub output_sensitivity: f64,
pub is_embedding: bool,
pub is_final_layer: bool,
}Expand description
Sensitivity metric for a model layer — higher score means more sensitive to quantization.
Fields§
§layer_name: String§gradient_norm: f64Average gradient norm during training.
weight_variance: f64Variance of weight values.
activation_range: f64Activation range: max − min of activations.
output_sensitivity: f64How much output changes per unit weight change.
is_embedding: boolEmbedding layers usually require higher precision.
is_final_layer: boolFinal layers usually require higher precision.
Implementations§
Source§impl LayerSensitivity
impl LayerSensitivity
Sourcepub fn sensitivity_score(&self) -> f64
pub fn sensitivity_score(&self) -> f64
Compute a composite sensitivity score for this layer.
Formula: gradient_norm * 0.4 + weight_variance * 0.3 + activation_range * 0.2 + output_sensitivity * 0.1
Bonuses: embeddings +1.0, final layer +0.5.
Trait Implementations§
Source§impl Clone for LayerSensitivity
impl Clone for LayerSensitivity
Source§fn clone(&self) -> LayerSensitivity
fn clone(&self) -> LayerSensitivity
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 LayerSensitivity
impl RefUnwindSafe for LayerSensitivity
impl Send for LayerSensitivity
impl Sync for LayerSensitivity
impl Unpin for LayerSensitivity
impl UnsafeUnpin for LayerSensitivity
impl UnwindSafe for LayerSensitivity
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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