20 #ifndef KALDI_NNET3_NNET_DIAGNOSTICS_H_ 21 #define KALDI_NNET3_NNET_DIAGNOSTICS_H_ 38 tot_objective(0.0) { }
71 debug_computation(false),
73 compute_accuracy(true),
74 store_component_stats(false),
75 compute_per_dim_accuracy(false) { }
81 opts->
Register(
"debug-computation", &debug_computation,
"If true, turn on " 82 "debug for the actual computation (very verbose!)");
83 opts->
Register(
"compute-accuracy", &compute_accuracy,
"If true, compute " 84 "accuracy values as well as objective functions");
85 opts->
Register(
"compute-per-dim-accuracy", &compute_per_dim_accuracy,
86 "If true, compute accuracy values per-dim");
90 optimize_config.
Register(&optimization_opts);
93 compiler_config.
Register(&compiler_opts);
96 compute_config.
Register(&compute_opts);
129 bool PrintTotalStats()
const;
138 double GetTotalObjective(
double *
tot_weight)
const;
142 const Nnet &GetDeriv()
const;
159 unordered_map<std::string, SimpleObjectiveInfo, StringHasher>
objf_info_;
215 #endif // KALDI_NNET3_NNET_DIAGNOSTICS_H_ NnetExample is the input data and corresponding label (or labels) for one or more frames of input...
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
void Register(OptionsItf *opts)
unordered_map< std::string, PerDimObjectiveInfo, StringHasher > accuracy_info_
This class is a wrapper that enables you to store a matrix in one of three forms: either as a Matrix<...
This class enables you to do the compilation and optimization in one call, and also ensures that if t...
NnetComputeProbOptions config_
void Register(OptionsItf *opts)
Vector< BaseFloat > tot_weight_vec
This class is for computing cross-entropy and accuracy values in a neural network, for diagnostics.
bool store_component_stats
virtual void Register(const std::string &name, bool *ptr, const std::string &doc)=0
unordered_map< std::string, SimpleObjectiveInfo, StringHasher > objf_info_
The two main classes defined in this header are struct ComputationRequest, which basically defines a ...
The class ParseOptions is for parsing command-line options; see Parsing command-line options for more...
void ComputeAccuracy(const GeneralMatrix &supervision, const CuMatrixBase< BaseFloat > &nnet_output, BaseFloat *tot_weight_out, BaseFloat *tot_accuracy_out, VectorBase< BaseFloat > *tot_weight_vec, VectorBase< BaseFloat > *tot_accuracy_vec)
This function computes the frame accuracy for this minibatch.
Vector< BaseFloat > tot_objective_vec
void Register(OptionsItf *opts)
NnetOptimizeOptions optimize_config
int32 num_minibatches_processed_
bool compute_per_dim_accuracy
void Register(OptionsItf *opts)
NnetComputeOptions compute_config
Matrix for CUDA computing.
CachingOptimizingCompiler compiler_
A class representing a vector.
class NnetComputer is responsible for executing the computation described in the "computation" object...
CachingOptimizingCompilerOptions compiler_config
Provides a vector abstraction class.