26 #ifndef LBANN_UTILS_RUNNING_STATISTICS_HPP_INCLUDED 27 #define LBANN_UTILS_RUNNING_STATISTICS_HPP_INCLUDED 46 constexpr
static auto default_min = std::numeric_limits<double>::max();
50 constexpr
static auto default_max = std::numeric_limits<double>::lowest();
61 void reset() noexcept;
67 void insert(
double val) noexcept;
73 size_t samples() const noexcept;
77 double min() const noexcept;
81 double max() const noexcept;
83 double mean() const noexcept;
85 double total() const noexcept;
97 double stddev() const noexcept;
116 double diff1 = val -
m_mean;
145 #endif // LBANN_UTILS_RUNNING_STATISTICS_HPP_INCLUDED void reset() noexcept
All values return to their defaults.
double mean() const noexcept
Running mean of observed samples.
double min() const noexcept
Get the minimum observed value.
static constexpr auto default_min
The default minimum value, chosen to ensure that any observed sample is less-than this...
size_t samples() const noexcept
Number of observed samples.
static constexpr auto default_max
The default maximum value, chosen to ensure that any observed sample is greater-than this...
double variance() const noexcept
Running (unbiased) sample variance of the observed samples.
Accumulate mean, stddev, min, and max over a streaming data set.
double stddev() const noexcept
Running (unbiased) sample standard deviation of the observed samples.
void insert(double val) noexcept
Add a new value to the data set.
double total() const noexcept
Running sum of observed samples.
double max() const noexcept
Get the minimum observed value.