NnetStats::StatsElement Struct Reference
Collaboration diagram for NnetStats::StatsElement:

Public Member Functions

 StatsElement (BaseFloat deriv_begin, BaseFloat deriv_end)
 
void AddStats (BaseFloat avg_deriv, BaseFloat avg_value)
 
void PrintStats (std::ostream &os)
 

Public Attributes

BaseFloat deriv_begin
 
BaseFloat deriv_end
 
BaseFloat deriv_sum
 
BaseFloat deriv_sumsq
 
BaseFloat abs_value_sum
 
BaseFloat abs_value_sumsq
 
int32 count
 

Detailed Description

Definition at line 59 of file nnet-stats.h.

Constructor & Destructor Documentation

◆ StatsElement()

Member Function Documentation

◆ AddStats()

◆ PrintStats()

void PrintStats ( std::ostream &  os)

Definition at line 25 of file nnet-stats.cc.

References NnetStats::StatsElement::abs_value_sum, NnetStats::StatsElement::abs_value_sumsq, NnetStats::StatsElement::count, NnetStats::StatsElement::deriv_begin, NnetStats::StatsElement::deriv_end, NnetStats::StatsElement::deriv_sum, and NnetStats::StatsElement::deriv_sumsq.

Referenced by NnetStats::PrintStats().

25  {
26  BaseFloat c = (count == 0 ? 1 : count), // prevent division by zero.
27  deriv_mean = deriv_sum/c,
28  deriv_stddev = std::sqrt(deriv_sumsq/c - deriv_mean*deriv_mean),
29  abs_value_mean = abs_value_sum/c,
30  abs_value_stddev = std::sqrt(abs_value_sumsq/c -
31  abs_value_mean*abs_value_mean);
32 
33  os << '[' << deriv_begin << ':' << deriv_end << "] count=" << count
34  << ", deriv mean,stddev=" << deriv_mean << ',' << deriv_stddev
35  << ", abs-avg-value mean,stddev=" << abs_value_mean << ','
36  << abs_value_stddev;
37 }
float BaseFloat
Definition: kaldi-types.h:29

Member Data Documentation

◆ abs_value_sum

BaseFloat abs_value_sum

◆ abs_value_sumsq

BaseFloat abs_value_sumsq

◆ count

◆ deriv_begin

BaseFloat deriv_begin

Definition at line 60 of file nnet-stats.h.

Referenced by NnetStats::StatsElement::PrintStats().

◆ deriv_end

BaseFloat deriv_end

Definition at line 61 of file nnet-stats.h.

Referenced by NnetStats::StatsElement::PrintStats().

◆ deriv_sum

◆ deriv_sumsq

BaseFloat deriv_sumsq

The documentation for this struct was generated from the following files: