Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 24 of file sum-matrices.cc.
References ParseOptions::GetArg(), rnnlm::i, KALDI_LOG, ParseOptions::NumArgs(), MatrixBase< Real >::NumCols(), MatrixBase< Real >::NumRows(), ParseOptions::PrintUsage(), ParseOptions::Read(), Matrix< Real >::Read(), ParseOptions::Register(), and MatrixBase< Real >::Write().
25 using namespace kaldi;
29 "Sum matrices, e.g. stats for fMPE training\n" 30 "Usage: sum-matrices [options] <mat-out> <mat-in1> <mat-in2> ...\n" 32 " sum-matrices mat 1.mat 2.mat 3.mat\n";
37 po.Register(
"binary", &binary,
"Write output in binary mode");
40 if (po.NumArgs() < 2) {
47 for (int32
i = 2;
i <= po.NumArgs();
i++) {
49 Input ki(po.GetArg(
i), &binary_in);
50 mat.
Read(ki.Stream(), binary_in,
true);
54 Output ko(po.GetArg(1), binary);
55 mat.
Write(ko.Stream(), binary);
57 KALDI_LOG <<
"Summed " << (po.NumArgs()-1) <<
" matrices " 59 }
catch(
const std::exception &e) {
60 std::cerr << e.what();
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
void Write(std::ostream &out, bool binary) const
write to stream.
MatrixIndexT NumCols() const
Returns number of columns (or zero for empty matrix).
void Read(std::istream &in, bool binary, bool add=false)
read from stream.
The class ParseOptions is for parsing command-line options; see Parsing command-line options for more...
MatrixIndexT NumRows() const
Returns number of rows (or zero for empty matrix).