26 int main(
int argc,
char *argv[]) {
27 using namespace kaldi;
31 "Copy a logistic-regression model, possibly changing the binary mode;\n" 32 "also supports the --scale-priors option which can scale the prior probabilities\n" 33 "the model assigns to different classes (e.g., you can remove the effect of\n" 34 "unbalanced training data by scaling by the inverse of the class priors in the\n" 36 "Usage: logistic-regression-copy [options] <model-in> <model-out>\n" 37 "e.g.: echo '[ 2.6 1.7 3.9 1.24 7.5 ]' | logistic-regression-copy --scale-priors=- \\\n" 38 " 1.model scaled_priors.mdl\n";
43 std::string scale_priors_rxfilename;
45 po.
Register(
"binary", &binary,
"Write output in binary mode");
46 po.
Register(
"scale-priors", &scale_priors_rxfilename,
"(extended) filename for file " 47 "containing a vector of prior-scales (e.g. inverses of training priors)");
56 std::string model_rxfilename = po.
GetArg(1),
57 model_wxfilename = po.
GetArg(2);
63 if (scale_priors_rxfilename !=
"") {
73 }
catch(
const std::exception &e) {
74 std::cerr << e.what();
int main(int argc, char *argv[])
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
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)
void ReadKaldiObject(const std::string &filename, Matrix< float > *m)
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.
std::string GetArg(int param) const
Returns one of the positional parameters; 1-based indexing for argc/argv compatibility.
void ScalePriors(const Vector< BaseFloat > &prior_scales)
int NumArgs() const
Number of positional parameters (c.f. argc-1).
A class representing a vector.
void WriteKaldiObject(const C &c, const std::string &filename, bool binary)
std::string PrintableWxfilename(const std::string &wxfilename)
PrintableWxfilename turns the wxfilename into a more human-readable form for error reporting...