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 rbm-convert-to-nnet.cc.
References ParseOptions::GetArg(), Nnet::GetComponent(), Component::GetType(), KALDI_ASSERT, KALDI_LOG, Component::kRbm, ParseOptions::NumArgs(), Nnet::NumComponents(), ParseOptions::PrintUsage(), ParseOptions::Read(), Nnet::Read(), ParseOptions::Register(), Output::Stream(), and Input::Stream().
27 using namespace kaldi;
32 "Convert RBM to <affinetransform> and <sigmoid>\n" 33 "Usage: rbm-convert-to-nnet [options] <rbm-in> <nnet-out>\n" 35 " rbm-convert-to-nnet --binary=false rbm.mdl nnet.mdl\n";
38 bool binary_write =
true;
41 po.Register(
"binary", &binary_write,
"Write output in binary mode");
45 if (po.NumArgs() != 2) {
50 std::string model_in_filename = po.GetArg(1),
51 model_out_filename = po.GetArg(2);
56 Input ki(model_in_filename, &binary_read);
57 nnet.
Read(ki.Stream(), binary_read);
65 Output ko(model_out_filename, binary_write);
66 rbm.WriteAsNnet(ko.Stream(), binary_write);
69 KALDI_LOG <<
"Written model to " << model_out_filename;
71 }
catch(
const std::exception &e) {
72 std::cerr << e.what();
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
int32 NumComponents() const
Returns the number of 'Components' which form the NN.
The class ParseOptions is for parsing command-line options; see Parsing command-line options for more...
void Read(const std::string &rxfilename)
Read Nnet from 'rxfilename',.
#define KALDI_ASSERT(cond)
const Component & GetComponent(int32 c) const
Component accessor,.
virtual ComponentType GetType() const =0
Get Type Identification of the component,.