28 deriv_stddev = std::sqrt(
deriv_sumsq/c - deriv_mean*deriv_mean),
31 abs_value_mean*abs_value_mean);
34 <<
", deriv mean,stddev=" << deriv_mean <<
',' << deriv_stddev
35 <<
", abs-avg-value mean,stddev=" << abs_value_mean <<
',' 52 while (index >= static_cast<int32>(
buckets_.size()))
73 KALDI_WARN <<
"No stats stored with nonlinear component";
78 if (value_sum.
Dim() != deriv_sum.
Dim())
79 KALDI_ERR <<
"Error computing nnet stats: probably you are " 80 <<
"trying to compute stats for a sigmoid layer.";
89 os <<
"Stats for buckets:" << std::endl;
94 os <<
"Global stats: ";
101 std::vector<NnetStats> *stats) {
106 if (ac == NULL)
continue;
109 if (nc == NULL)
continue;
113 if (sc != NULL)
continue;
115 stats->back().AddStatsFromNnet(nnet);
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
const Component & GetComponent(int32 c) const
This kind of Component is a base-class for things like sigmoid and softmax.
void AddStats(BaseFloat avg_deriv, BaseFloat avg_value)
int32 affine_component_index_
std::vector< StatsElement > buckets_
void PrintStats(std::ostream &os)
void GetNnetStats(const NnetStatsConfig &config, const Nnet &nnet, std::vector< NnetStats > *stats)
void AddStatsFromNnet(const Nnet &nnet)
BaseFloat abs_value_sumsq
StatsElement(BaseFloat deriv_begin, BaseFloat deriv_end)
int32 BucketFor(BaseFloat avg_deriv)
int32 NumComponents() const
Returns number of components– think of this as similar to # of layers, but e.g.
NnetStats(int32 affine_component_index, BaseFloat bucket_width)
const CuVector< double > & ValueSum() const
void PrintStats(std::ostream &os)
#define KALDI_ASSERT(cond)
void AddStats(BaseFloat avg_deriv, BaseFloat avg_value)
const CuVector< double > & DerivSum() const
MatrixIndexT Dim() const
Dimensions.