pub struct RunningStats { /* private fields */ }Expand description
Per-dimension running mean and variance tracker using Welford’s algorithm.
Implementations§
Source§impl RunningStats
impl RunningStats
Sourcepub fn std_f32(&self) -> Vec<f32>
pub fn std_f32(&self) -> Vec<f32>
Per-dimension sample standard deviation (returns [1.0; dim] until count ≥ 2).
Sourcepub fn update(&mut self, obs: &[f32]) -> RlResult<()>
pub fn update(&mut self, obs: &[f32]) -> RlResult<()>
Update statistics with a new observation vector.
§Errors
RlError::DimensionMismatchifobs.len() != dim.
Sourcepub fn update_batch(&mut self, batch: &[f32]) -> RlResult<()>
pub fn update_batch(&mut self, batch: &[f32]) -> RlResult<()>
Update statistics with a batch of observations [B × dim].
§Errors
RlError::DimensionMismatchifbatch.len() % dim != 0.
Trait Implementations§
Source§impl Clone for RunningStats
impl Clone for RunningStats
Source§fn clone(&self) -> RunningStats
fn clone(&self) -> RunningStats
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 moreAuto Trait Implementations§
impl Freeze for RunningStats
impl RefUnwindSafe for RunningStats
impl Send for RunningStats
impl Sync for RunningStats
impl Unpin for RunningStats
impl UnsafeUnpin for RunningStats
impl UnwindSafe for RunningStats
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