pub struct PruningConfig {
pub pruning_ratio: f64,
pub structured: bool,
pub iterative: bool,
pub num_iterations: usize,
pub initial_ratio: f64,
pub final_ratio: f64,
pub schedule: String,
pub min_threshold: f64,
pub global_pruning: bool,
}Expand description
Configuration for pruning strategies.
Fields§
§pruning_ratio: f64Fraction of weights to prune (0.0 to 1.0)
structured: boolWhether to use structured pruning (entire neurons/channels)
iterative: boolUse iterative pruning (gradually increase pruning ratio)
num_iterations: usizeNumber of iterations for iterative pruning
initial_ratio: f64Initial pruning ratio for iterative pruning
final_ratio: f64Final pruning ratio for iterative pruning
schedule: StringPruning schedule: “linear”, “exponential”, “cosine”
min_threshold: f64Minimum weight magnitude threshold (weights below this are always pruned)
global_pruning: boolWhether to use global pruning (across all layers) or local (per-layer)
Trait Implementations§
Source§impl Clone for PruningConfig
impl Clone for PruningConfig
Source§fn clone(&self) -> PruningConfig
fn clone(&self) -> PruningConfig
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 PruningConfig
impl Debug for PruningConfig
Source§impl Default for PruningConfig
impl Default for PruningConfig
Source§impl<'de> Deserialize<'de> for PruningConfig
impl<'de> Deserialize<'de> for PruningConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PruningConfig
impl RefUnwindSafe for PruningConfig
impl Send for PruningConfig
impl Sync for PruningConfig
impl Unpin for PruningConfig
impl UnwindSafe for PruningConfig
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