CumulativeMovingMeanStd

class maze.core.utils.stats_utils.CumulativeMovingMeanStd(epsilon: float = 1e-08)

Maintains cumulative moving mean and std of incoming numpy arrays along axis 0. Output shapes: scalar -> scalar vector -> scalar matrix -> vector

Implementation adopted from: https://github.com/DLR-RM/stable-baselines3/blob/master/stable_baselines3/common/running_mean_std.py

Parameters:

epsilon – Ensures numerical stability and avoids division by zero.

update(new_data: numpy.ndarray | float) None

Update cumulative moving statistics.

Parameters:

new_data – New data to update the stats with.