All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
sum-mllt-accs.cc File Reference
#include "util/common-utils.h"
#include "transform/mllt.h"
Include dependency graph for sum-mllt-accs.cc:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 23 of file sum-mllt-accs.cc.

References ParseOptions::GetArg(), rnnlm::i, ParseOptions::NumArgs(), ParseOptions::PrintUsage(), MlltAccs::Read(), ParseOptions::Read(), ParseOptions::Register(), Output::Stream(), and MlltAccs::Write().

23  {
24  try {
25  using namespace kaldi;
26  typedef kaldi::int32 int32;
27 
28  const char *usage =
29  "Sum stats obtained with gmm-acc-mllt.\n"
30  "Usage: sum-mllt-accs [options] <stats-out> <stats-in1> <stats-in2> ...\n";
31 
32  bool binary = true;
33  ParseOptions po(usage);
34  po.Register("binary", &binary, "Write accumulators in binary mode.");
35  po.Read(argc, argv);
36 
37  if (po.NumArgs() < 2) {
38  po.PrintUsage();
39  exit(1);
40  }
41 
42  MlltAccs mllt_accs;
43  std::string stats_out_filename = po.GetArg(1);
44 
45  for (int32 i = 2; i <= po.NumArgs(); i++) {
46  bool binary_in, add = true;
47  Input ki(po.GetArg(i), &binary_in);
48  mllt_accs.Read(ki.Stream(), binary_in, add);
49  }
50 
51  Output ko(stats_out_filename, binary);
52  mllt_accs.Write(ko.Stream(), binary);
53  return 0;
54  } catch(const std::exception &e) {
55  std::cerr << e.what();
56  return -1;
57  }
58 }
Relabels neural network egs with the read pdf-id alignments.
Definition: chain.dox:20
void Write(std::ostream &os, bool binary) const
Definition: mllt.cc:51
void Read(std::istream &is, bool binary, bool add=false)
Definition: mllt.cc:34
The class ParseOptions is for parsing command-line options; see Parsing command-line options for more...
Definition: parse-options.h:36
A class for estimating Maximum Likelihood Linear Transform, also known as global Semi-tied Covariance...
Definition: mllt.h:42