Skip to content

lit_sb3.core.running_mean_std

source module lit_sb3.core.running_mean_std

Classes

  • RunningMeanStd — Calculates the running mean and std of a data stream.

source class RunningMeanStd(epsilon: float = 0.0001, shape: tuple[int, ...] = ())

Calculates the running mean and std of a data stream.

https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Parallel_algorithm.

Parameters

  • epsilon : float — helps with arithmetic issues

  • shape : tuple[int, ...] — the shape of the data stream's output

Methods

source method RunningMeanStd.copy() → RunningMeanStd

Returns.

Return a copy of the current object.

source method RunningMeanStd.combine(other: RunningMeanStd) → None

Combine stats from another RunningMeanStd object.

Parameters

source method RunningMeanStd.update(arr: np.ndarray) → None

source method RunningMeanStd.update_from_moments(batch_mean: np.ndarray, batch_var: np.ndarray, batch_count: float) → None