Go to the source code of this file.
 | 
|    | kaldi | 
|   | This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for mispronunciations detection tasks, the reference: 
  | 
|   | 
|    | kaldi::nnet3 | 
|   | 
 | 
| int  | main (int argc, char *argv[]) | 
|   | 
◆ main()
      
        
          | int main  | 
          ( | 
          int  | 
          argc,  | 
        
        
           | 
           | 
          char *  | 
          argv[]  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 135 of file nnet3-acc-lda-stats.cc.
References NnetLdaStatsAccumulator::AccStats(), SequentialTableReader< Holder >::Done(), ParseOptions::GetArg(), KALDI_LOG, SequentialTableReader< Holder >::Next(), ParseOptions::NumArgs(), ParseOptions::PrintUsage(), ParseOptions::Read(), kaldi::ReadKaldiObject(), ParseOptions::Register(), SequentialTableReader< Holder >::Value(), and NnetLdaStatsAccumulator::WriteStats().
  137     using namespace kaldi;
   140     typedef kaldi::int64 int64;
   143         "Accumulate statistics in the same format as acc-lda (i.e. stats for\n"   144         "estimation of LDA and similar types of transform), starting from nnet\n"   145         "training examples.  This program puts the features through the network,\n"   146         "and the network output will be the features; the supervision in the\n"   147         "training examples is used for the class labels.  Used in obtaining\n"   148         "feature transforms that help nnet training work better.\n"   150         "Usage:  nnet3-acc-lda-stats [options] <raw-nnet-in> <training-examples-in> <lda-stats-out>\n"   152         "nnet3-acc-lda-stats 0.raw ark:1.egs 1.acc\n"   153         "See also: nnet-get-feature-transform\n";
   155     bool binary_write = 
true;
   159     po.Register(
"binary", &binary_write, 
"Write output in binary mode");
   160     po.Register(
"rand-prune", &rand_prune,
   161                 "Randomized pruning threshold for posteriors");
   165     if (po.NumArgs() != 3) {
   170     std::string nnet_rxfilename = po.GetArg(1),
   171         examples_rspecifier = po.GetArg(2),
   172         lda_accs_wxfilename = po.GetArg(3);
   182     for (; !example_reader.Done(); example_reader.Next(), num_egs++)
   183       accumulator.AccStats(example_reader.Value());
   185     KALDI_LOG << 
"Processed " << num_egs << 
" examples.";
   187     accumulator.WriteStats(lda_accs_wxfilename, binary_write);
   190   } 
catch(
const std::exception &e) {
   191     std::cerr << e.what() << 
'\n';
 This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
 
void ReadKaldiObject(const std::string &filename, Matrix< float > *m)
 
The class ParseOptions is for parsing command-line options; see Parsing command-line options for more...
 
A templated class for reading objects sequentially from an archive or script file; see The Table conc...