25 int main(
int argc,
char *argv[]) {
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" 55 std::string nnet_rxfilename = po.
GetArg(1);
61 Input ki(nnet_rxfilename, &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...
int main(int argc, char *argv[])
int32 NumUpdatableComponents() const
Returns the number of updatable components.
void PrintUsage(bool print_command_line=false)
Prints the usage documentation [provided in the constructor].
void Read(std::istream &is, bool binary)
void Register(const std::string &name, bool *ptr, const std::string &doc)
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)
int Read(int argc, const char *const *argv)
Parses the command line options and fills the ParseOptions-registered variables.
std::string GetArg(int param) const
Returns one of the positional parameters; 1-based indexing for argc/argv compatibility.
int NumArgs() const
Number of positional parameters (c.f. argc-1).
A class representing a vector.
const Nnet & GetNnet() const