pub enum PruningStrategy {
Magnitude(f64),
PercentileMagnitude(f64),
StructuredL1(f64),
RandomPruning(f64),
GradualPruning {
initial_sparsity: f64,
final_sparsity: f64,
begin_step: usize,
end_step: usize,
},
}Expand description
Selects the algorithm used to decide which weights to prune.
Variants§
Magnitude(f64)
Zero out every weight whose absolute value is strictly below threshold.
PercentileMagnitude(f64)
Zero out the bottom percentile% of weights ranked by absolute
magnitude. percentile must be in [0, 100].
StructuredL1(f64)
Prune entire neurons (rows) whose mean L1 norm is below threshold.
RandomPruning(f64)
Randomly zero out fraction% of weights using the pruner’s seeded PRNG.
fraction must be in [0, 1].
GradualPruning
Linearly increase sparsity from initial_sparsity to final_sparsity
between begin_step and end_step.
Trait Implementations§
Source§impl Clone for PruningStrategy
impl Clone for PruningStrategy
Source§fn clone(&self) -> PruningStrategy
fn clone(&self) -> PruningStrategy
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 moreSource§impl Debug for PruningStrategy
impl Debug for PruningStrategy
Source§impl PartialEq for PruningStrategy
impl PartialEq for PruningStrategy
Source§fn eq(&self, other: &PruningStrategy) -> bool
fn eq(&self, other: &PruningStrategy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PruningStrategy
Auto Trait Implementations§
impl Freeze for PruningStrategy
impl RefUnwindSafe for PruningStrategy
impl Send for PruningStrategy
impl Sync for PruningStrategy
impl Unpin for PruningStrategy
impl UnsafeUnpin for PruningStrategy
impl UnwindSafe for PruningStrategy
Blanket Implementations§
impl<T> Allocation for T
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