25 int main(
int argc,
char *argv[]) {
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");
50 std::string model_in_filename = po.
GetArg(1),
51 model_out_filename = po.
GetArg(2);
56 Input ki(model_in_filename, &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...
int main(int argc, char *argv[])
int32 NumComponents() const
Returns the number of 'Components' which form the NN.
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...
int Read(int argc, const char *const *argv)
Parses the command line options and fills the ParseOptions-registered variables.
void Read(const std::string &rxfilename)
Read Nnet from 'rxfilename',.
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).
#define KALDI_ASSERT(cond)
const Component & GetComponent(int32 c) const
Component accessor,.
virtual ComponentType GetType() const =0
Get Type Identification of the component,.