pub struct RunningMeanStd { /* private fields */ }Expand description
Running mean and standard deviation normalizer
Tracks mean and variance using Welford’s online algorithm for numerical stability.
Implementations§
Source§impl RunningMeanStd
impl RunningMeanStd
Sourcepub fn new(size: usize, epsilon: f32) -> Self
pub fn new(size: usize, epsilon: f32) -> Self
Create a new normalizer
§Arguments
size- Dimension of observationsepsilon- Small constant for numerical stability
Sourcepub fn update(&mut self, observations: &[Vec<f32>])
pub fn update(&mut self, observations: &[Vec<f32>])
Update statistics with a batch of observations
§Arguments
observations- Batch of observations[batch_size][obs_dim]
Sourcepub fn normalize_batch(&self, observations: &mut [Vec<f32>])
pub fn normalize_batch(&self, observations: &mut [Vec<f32>])
Normalize a batch of observations in-place
§Arguments
observations- Batch of observations[batch_size][obs_dim]
Trait Implementations§
Source§impl Clone for RunningMeanStd
impl Clone for RunningMeanStd
Source§fn clone(&self) -> RunningMeanStd
fn clone(&self) -> RunningMeanStd
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 RunningMeanStd
impl RefUnwindSafe for RunningMeanStd
impl Send for RunningMeanStd
impl Sync for RunningMeanStd
impl Unpin for RunningMeanStd
impl UnsafeUnpin for RunningMeanStd
impl UnwindSafe for RunningMeanStd
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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