Struct ActivationStats
pub struct ActivationStats { /* private fields */ }Expand description
Bounded collector for activation statistics.
Implementations§
§impl ActivationStats
impl ActivationStats
pub fn new_diagonal(
dim: usize,
budget_bytes: usize,
) -> Result<ActivationStats, ConverterError>
pub fn new_diagonal( dim: usize, budget_bytes: usize, ) -> Result<ActivationStats, ConverterError>
Create a new diagonal activation statistic collector.
pub fn new_block_diagonal(
dim: usize,
block_size: usize,
budget_bytes: usize,
) -> Result<ActivationStats, ConverterError>
pub fn new_block_diagonal( dim: usize, block_size: usize, budget_bytes: usize, ) -> Result<ActivationStats, ConverterError>
Create a new block-diagonal activation statistic collector.
pub fn sample_count(&self) -> usize
pub fn sample_count(&self) -> usize
Number of samples accumulated.
pub fn budget_bytes(&self) -> usize
pub fn budget_bytes(&self) -> usize
Declared byte budget limit.
pub fn allocated_bytes(&self) -> usize
pub fn allocated_bytes(&self) -> usize
Memory footprint in bytes.
pub fn accumulate_sample(&mut self, x: &[f32]) -> Result<(), ConverterError>
pub fn accumulate_sample(&mut self, x: &[f32]) -> Result<(), ConverterError>
Stream a single activation vector into the statistics.
pub fn compute_diagonal_weights(
&self,
damping: f32,
) -> Result<Vec<f32>, ConverterError>
pub fn compute_diagonal_weights( &self, damping: f32, ) -> Result<Vec<f32>, ConverterError>
Compute the diagonal weights $\sqrt{E[x_i^2] + \lambda}$ for activation weighting.
pub fn compute_block_cholesky(
&self,
damping: f32,
) -> Result<Vec<f32>, ConverterError>
pub fn compute_block_cholesky( &self, damping: f32, ) -> Result<Vec<f32>, ConverterError>
Compute the block-diagonal square-root factor $L$ where $H \approx L L^T$. For diagonal mode, returns a diagonal vector. For block-diagonal mode, returns the Cholesky factor $L$ per block (row-major $B \times B$).
Trait Implementations§
§impl Clone for ActivationStats
impl Clone for ActivationStats
§fn clone(&self) -> ActivationStats
fn clone(&self) -> ActivationStats
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 ActivationStats
impl RefUnwindSafe for ActivationStats
impl Send for ActivationStats
impl Sync for ActivationStats
impl Unpin for ActivationStats
impl UnsafeUnpin for ActivationStats
impl UnwindSafe for ActivationStats
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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