pub struct SparseUpdateManager { /* private fields */ }Expand description
Sparse update manager
Implementations§
Source§impl SparseUpdateManager
impl SparseUpdateManager
Sourcepub fn new(config: SparseUpdateConfig) -> Self
pub fn new(config: SparseUpdateConfig) -> Self
Create a new sparse update manager
Sourcepub fn process_gradient(
&mut self,
parameter_id: String,
gradient: Vec<f32>,
shape: Vec<usize>,
) -> SparseUpdateResult
pub fn process_gradient( &mut self, parameter_id: String, gradient: Vec<f32>, shape: Vec<usize>, ) -> SparseUpdateResult
Process a gradient and return sparse representation if beneficial
Sourcepub fn process_gradient_block_sparse(
&mut self,
parameter_id: String,
gradient: Vec<f32>,
shape: Vec<usize>,
) -> SparseUpdateResult
pub fn process_gradient_block_sparse( &mut self, parameter_id: String, gradient: Vec<f32>, shape: Vec<usize>, ) -> SparseUpdateResult
Process gradient with block-sparse representation
Sourcepub fn get_parameter_statistics(
&self,
parameter_id: &str,
) -> Option<SparsePatternStatistics>
pub fn get_parameter_statistics( &self, parameter_id: &str, ) -> Option<SparsePatternStatistics>
Get sparsity statistics for a parameter
Sourcepub fn get_compression_statistics(&self) -> &HashMap<String, CompressionStats>
pub fn get_compression_statistics(&self) -> &HashMap<String, CompressionStats>
Get all compression statistics
Sourcepub fn set_parameter_threshold(&mut self, parameter_id: String, threshold: f32)
pub fn set_parameter_threshold(&mut self, parameter_id: String, threshold: f32)
Set custom threshold for a parameter
Sourcepub fn get_overall_statistics(&self) -> OverallSparseStatistics
pub fn get_overall_statistics(&self) -> OverallSparseStatistics
Get overall statistics
Auto Trait Implementations§
impl Freeze for SparseUpdateManager
impl RefUnwindSafe for SparseUpdateManager
impl Send for SparseUpdateManager
impl Sync for SparseUpdateManager
impl Unpin for SparseUpdateManager
impl UnsafeUnpin for SparseUpdateManager
impl UnwindSafe for SparseUpdateManager
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> 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