25 int main(
int argc,
char *argv[]) {
26 using namespace kaldi;
30 "Get feature-projection transform using stats obtained with acc-lda.\n" 31 "The file <index-list> contains a series of line, each containing a list\n" 32 "of integer indexes. For each line we create a transform of the same type\n" 33 "as nnet-get-feature-transform would produce, taking as input just the\n" 34 "listed feature dimensions. The output transform will be the concatenation\n" 35 "of all these transforms. The output-dim will be the number of integers in\n" 36 "the file <index-list> (the individual transforms are not dimension-reducing).\n" 37 "Do not set the --dim option." 38 "Usage: nnet-get-feature-transform-multi [options] <index-list> <lda-acc-1> <lda-acc-2> ... <lda-acc-n> <matrix-out>\n";
44 po.
Register(
"binary", &binary,
"Write accumulators in binary mode.");
54 std::string index_list_rxfilename = po.
GetArg(1);
57 std::vector<std::vector<int32> > indexes;
59 Input ki(index_list_rxfilename);
61 while (getline(ki.
Stream(), line)) {
62 std::vector<int32> this_indexes;
64 true, &this_indexes) ||
66 KALDI_ERR <<
"Bad line in index-list file: line is " << line;
68 indexes.push_back(this_indexes);
76 bool binary_in, add =
true;
78 fte.
Read(ki.Stream(), binary_in, add);
88 }
catch(
const std::exception &e) {
89 std::cerr << e.what();
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
bool SplitStringToIntegers(const std::string &full, const char *delim, bool omit_empty_strings, std::vector< I > *out)
Split a string (e.g.
void PrintUsage(bool print_command_line=false)
Prints the usage documentation [provided in the constructor].
void Register(const std::string &name, bool *ptr, const std::string &doc)
The class ParseOptions is for parsing command-line options; see Parsing command-line options for more...
void Read(std::istream &in_stream, bool binary, bool add)
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).
void WriteKaldiObject(const C &c, const std::string &filename, bool binary)
std::string PrintableRxfilename(const std::string &rxfilename)
PrintableRxfilename turns the rxfilename into a more human-readable form for error reporting...
std::string PrintableWxfilename(const std::string &wxfilename)
PrintableWxfilename turns the wxfilename into a more human-readable form for error reporting...