LBANN  0.103.0
LivermoreBigArtificialNeuralNetworkToolkit
lbann::RunningStats Class Reference

Accumulate mean, stddev, min, and max over a streaming data set. More...

#include <running_statistics.hpp>

Public Member Functions

Modifiers
void reset () noexcept
 All values return to their defaults. More...
 
void insert (double val) noexcept
 Add a new value to the data set. More...
 
Queries
size_t samples () const noexcept
 Number of observed samples. More...
 
double min () const noexcept
 Get the minimum observed value. More...
 
double max () const noexcept
 Get the minimum observed value. More...
 
double mean () const noexcept
 Running mean of observed samples. More...
 
double total () const noexcept
 Running sum of observed samples. More...
 
double variance () const noexcept
 Running (unbiased) sample variance of the observed samples. More...
 
double stddev () const noexcept
 Running (unbiased) sample standard deviation of the observed samples. More...
 

Static Public Attributes

static constexpr auto default_min = std::numeric_limits<double>::max()
 The default minimum value, chosen to ensure that any observed sample is less-than this. More...
 
static constexpr auto default_max = std::numeric_limits<double>::lowest()
 The default maximum value, chosen to ensure that any observed sample is greater-than this. More...
 

Private Attributes

size_t m_count = 0UL
 
double m_min = default_min
 
double m_max = default_max
 
double m_mean = 0.
 
double m_diff_sq = 0.
 

Detailed Description

Accumulate mean, stddev, min, and max over a streaming data set.

Definition at line 40 of file running_statistics.hpp.

Member Function Documentation

◆ insert()

void lbann::RunningStats::insert ( double  val)
inlinenoexcept

Add a new value to the data set.

The statistics are updated immediately.

Definition at line 110 of file running_statistics.hpp.

Here is the caller graph for this function:

◆ max()

double lbann::RunningStats::max ( ) const
inlinenoexcept

Get the minimum observed value.

Note
Only valid if samples() > 0.

Definition at line 125 of file running_statistics.hpp.

Here is the caller graph for this function:

◆ mean()

double lbann::RunningStats::mean ( ) const
inlinenoexcept

Running mean of observed samples.

Definition at line 127 of file running_statistics.hpp.

Here is the caller graph for this function:

◆ min()

double lbann::RunningStats::min ( ) const
inlinenoexcept

Get the minimum observed value.

Note
Only valid if samples() > 0.

Definition at line 123 of file running_statistics.hpp.

Here is the caller graph for this function:

◆ reset()

void lbann::RunningStats::reset ( )
inlinenoexcept

All values return to their defaults.

All queries should be considered meaningless unless samples() is greater than 0.

Definition at line 108 of file running_statistics.hpp.

Here is the caller graph for this function:

◆ samples()

size_t lbann::RunningStats::samples ( ) const
inlinenoexcept

Number of observed samples.

Definition at line 121 of file running_statistics.hpp.

Here is the caller graph for this function:

◆ stddev()

double lbann::RunningStats::stddev ( ) const
inlinenoexcept

Running (unbiased) sample standard deviation of the observed samples.

Note
This is zero at least until 2 or more samples have been observed.

Definition at line 139 of file running_statistics.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ total()

double lbann::RunningStats::total ( ) const
inlinenoexcept

Running sum of observed samples.

Definition at line 129 of file running_statistics.hpp.

Here is the caller graph for this function:

◆ variance()

double lbann::RunningStats::variance ( ) const
inlinenoexcept

Running (unbiased) sample variance of the observed samples.

Note
This is zero at least until 2 or more samples have been observed.

Definition at line 134 of file running_statistics.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ default_max

constexpr auto lbann::RunningStats::default_max = std::numeric_limits<double>::lowest()
static

The default maximum value, chosen to ensure that any observed sample is greater-than this.

Definition at line 50 of file running_statistics.hpp.

◆ default_min

constexpr auto lbann::RunningStats::default_min = std::numeric_limits<double>::max()
static

The default minimum value, chosen to ensure that any observed sample is less-than this.

Definition at line 46 of file running_statistics.hpp.

◆ m_count

size_t lbann::RunningStats::m_count = 0UL
private

Definition at line 101 of file running_statistics.hpp.

◆ m_diff_sq

double lbann::RunningStats::m_diff_sq = 0.
private

Definition at line 105 of file running_statistics.hpp.

◆ m_max

double lbann::RunningStats::m_max = default_max
private

Definition at line 103 of file running_statistics.hpp.

◆ m_mean

double lbann::RunningStats::m_mean = 0.
private

Definition at line 104 of file running_statistics.hpp.

◆ m_min

double lbann::RunningStats::m_min = default_min
private

Definition at line 102 of file running_statistics.hpp.


The documentation for this class was generated from the following file: