pub struct GlobalPruner { /* private fields */ }Expand description
Global pruning across multiple layers.
Implementations§
Source§impl GlobalPruner
impl GlobalPruner
Sourcepub fn new(config: PruningConfig) -> Self
pub fn new(config: PruningConfig) -> Self
Create a new global pruner.
Sourcepub fn add_layer(&mut self, name: &str, weights: Array2<f64>)
pub fn add_layer(&mut self, name: &str, weights: Array2<f64>)
Add a layer to the global pruning pool.
Sourcepub fn prune_all(
&self,
) -> TrainResult<HashMap<String, (Array2<f64>, PruningMask)>>
pub fn prune_all( &self, ) -> TrainResult<HashMap<String, (Array2<f64>, PruningMask)>>
Prune all layers using global threshold.
Sourcepub fn statistics(
&self,
pruned: &HashMap<String, (Array2<f64>, PruningMask)>,
) -> PruningStats
pub fn statistics( &self, pruned: &HashMap<String, (Array2<f64>, PruningMask)>, ) -> PruningStats
Generate pruning statistics.
Auto Trait Implementations§
impl Freeze for GlobalPruner
impl RefUnwindSafe for GlobalPruner
impl Send for GlobalPruner
impl Sync for GlobalPruner
impl Unpin for GlobalPruner
impl UnwindSafe for GlobalPruner
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> 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