All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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

Member Function Documentation

void AddStats ( BaseFloat  avg_deriv,
BaseFloat  avg_value 
)

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

References count.

Referenced by NnetStats::AddStats().

39  {
40  count++;
41  deriv_sum += avg_deriv;
42  deriv_sumsq += avg_deriv * avg_deriv;
43  abs_value_sum += std::abs(avg_value);
44  abs_value_sumsq += avg_value * avg_value;
45 }
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

BaseFloat abs_value_sum

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

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

BaseFloat abs_value_sumsq

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

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

int32 count

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

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

BaseFloat deriv_begin

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

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

BaseFloat deriv_end

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

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

BaseFloat deriv_sum

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

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

BaseFloat deriv_sumsq

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

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


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