mighty.utils.var_online.MeanOnline¶
- class mighty.utils.var_online.MeanOnline(tensor=None)[source]¶
Online sample mean aggregate. Works with scalars, vectors, and n-dimensional tensors.
- Parameters:
- tensortorch.Tensor or None
The initial tensor, if provided.
Methods
__init__([tensor])activate(is_active)Activates or deactivates the updates.
get_mean()reset()Reset the mean and the count.
update(tensor)Update sample mean (and variance) from a batch of new values.