emmi.utils.running_moments ========================== .. py:module:: emmi.utils.running_moments Classes ------- .. autoapisummary:: emmi.utils.running_moments.RunningMoments Module Contents --------------- .. py:class:: RunningMoments Calculates running moments of data (mean and variance) for data normalization purposes. .. py:method:: push_tensor(x, dim=1) Add a tensor to the moment calculation. Calculations are carried out in float64 to avoid numerical imprecisions. :param x: Tensor to push. Shape should be (num_points, dim). The statistics are averaged over the num_points :param dim: Which dim (i.e., axis) contains the feature dimension. For example, in a pointcloud dim=1 calculates the mean/std of the x, y and z positions. In an RGB image (batch_size, num_channels, height, width), dim=1 calculates the per-channel mean/std. .. py:method:: push_scalar(x) Add a scalar to the moment calculation. Calculations are carried out in float64 to avoid numerical imprecisions. :param x: Scalar to add to the moment calculations. .. py:method:: mean() .. py:method:: var() .. py:method:: std()