Go to the source code of this file.
 | 
| int  | main (int argc, char *argv[]) | 
|   | 
◆ main()
      
        
          | int main  | 
          ( | 
          int  | 
          argc,  | 
        
        
           | 
           | 
          char *  | 
          argv[]  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 25 of file nnet-am-info.cc.
References ParseOptions::GetArg(), Nnet::GetLearningRates(), AmNnet::GetNnet(), rnnlm::i, AmNnet::Info(), KALDI_LOG, ParseOptions::NumArgs(), Nnet::NumUpdatableComponents(), ParseOptions::PrintUsage(), AmNnet::Read(), ParseOptions::Read(), TransitionModel::Read(), ParseOptions::Register(), and Input::Stream().
   27     using namespace kaldi;
    32         "Print human-readable information about the neural network\n"    33         "acoustic model to the standard output\n"    34         "Usage:  nnet-am-info [options] <nnet-in>\n"    36         " nnet-am-info 1.nnet\n";
    40     bool print_learning_rates = 
false;
    42     po.Register(
"print-learning-rates", &print_learning_rates,
    43                 "If true, instead of printing the normal info, print a "    44                 "colon-separated list of the learning rates for each updatable "    45                 "layer, suitable to give to nnet-am-copy as the argument to"    50     if (po.NumArgs() != 1) {
    55     std::string nnet_rxfilename = po.GetArg(1);
    61       Input ki(nnet_rxfilename, &binary_read);
    62       trans_model.
Read(ki.Stream(), binary_read);
    63       am_nnet.
Read(ki.Stream(), binary_read);
    66     if (print_learning_rates) {
    69       int32 nc = learning_rates.Dim();
    70       for (int32 
i = 0; 
i < nc; 
i++)
    71         std::cout << learning_rates(
i) << (
i < nc - 1 ? 
":" : 
"");
    72       std::cout << std::endl;
    73       KALDI_LOG << 
"Printed learning-rate info for " << nnet_rxfilename;
    75       std::cout << am_nnet.
Info();
    76       KALDI_LOG << 
"Printed info about " << nnet_rxfilename;
    79   } 
catch(
const std::exception &e) {
    80     std::cerr << e.what() << 
'\n';
 This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
 
int32 NumUpdatableComponents() const
Returns the number of updatable components. 
 
void Read(std::istream &is, bool binary)
 
void GetLearningRates(VectorBase< BaseFloat > *learning_rates) const
Get all the learning rates in the neural net (the output must have dim equal to NumUpdatableComponent...
 
The class ParseOptions is for parsing command-line options; see Parsing command-line options for more...
 
void Read(std::istream &is, bool binary)
 
A class representing a vector. 
 
const Nnet & GetNnet() const