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)");
51 if (po.NumArgs() != 2) {
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();
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
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...
void ScalePriors(const Vector< BaseFloat > &prior_scales)
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...