30 std::ostringstream os;
31 if (command < 0 || command >= num_commands)
43 std::vector<std::string> configs;
46 for (
size_t j = 0;
j < configs.size();
j++) {
47 KALDI_LOG <<
"Input config[" <<
j <<
"] is: " << configs[
j];
48 std::istringstream is(configs[
j]);
53 std::vector<Matrix<BaseFloat> > inputs;
62 std::ostringstream os;
63 computation.
Print(os, nnet);
64 KALDI_LOG <<
"Generated computation is: " << os.str();
73 analyzer.
Init(nnet, computation);
76 std::vector<std::string> submatrix_strings;
82 KALDI_LOG <<
"First nontrivial access of submatrix " << submatrix_strings[s]
85 KALDI_LOG <<
"Last access of submatrix " << submatrix_strings[s]
87 KALDI_LOG <<
"Last write access of submatrix " << submatrix_strings[s]
89 KALDI_LOG <<
"Data present in " << submatrix_strings[s]
90 <<
" at command " << c <<
" is invalidated at command " 100 using namespace kaldi;
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
int32 FirstNontrivialAccess(int32 s) const
Returns the first command (read or write) that accesses any part of 's' except for zeroing it (i...
void ReadConfig(std::istream &config_file)
This file contains various routines that are useful in test code.
void Print(std::ostream &os, const Nnet &nnet) const
This file contains utilities for analyzing and checking computations, which are used in the optimizat...
std::vector< Command > commands
void UnitTestNnetAnalyze()
void ComputeExampleComputationRequestSimple(const Nnet &nnet, ComputationRequest *request, std::vector< Matrix< BaseFloat > > *inputs)
This function computes an example computation request, for testing purposes.
void Init(const Nnet &nnet, const NnetComputation &computation)
std::vector< SubMatrixInfo > submatrices
int32 LastWriteAccess(int32 s) const
Returns the last command-index that accesses any part of submatrix 's' as a write operation...
int32 DataInvalidatedCommand(int32 c, int32 s) const
Returns (the first command-index after 'c' that any part of submatrix 's' is written to); or if there...
int32 LastAccess(int32 s) const
Returns the last non-deallocation command that accesses any part of submatrix 's'; if there is no suc...
std::string PrintCommand(int32 num_commands, int32 command)
void CreateComputation(const CompilerOptions &opts, NnetComputation *computation)
This class creates an initial version of the NnetComputation, without any optimization or sharing of ...
void GenerateConfigSequence(const NnetGenerationOptions &opts, std::vector< std::string > *configs)
Generates a sequence of at least one config files, output as strings, where the first in the sequence...
This struct exists to set up various pieces of analysis; it helps avoid the repetition of code where ...
int32 RandInt(int32 min_val, int32 max_val, struct RandomState *state)
void GetSubmatrixStrings(const Nnet &nnet, std::vector< std::string > *submat_strings) const
This class performs various kinds of specific analysis on top of what class Analyzer gives you immedi...