Skip to content

Commit

Permalink
Should be multiplying by M_LN10 to make weights for log10 models.
Browse files Browse the repository at this point in the history
  • Loading branch information
kpu committed Jun 15, 2015
1 parent bcabda8 commit b48771e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lm/interpolate/tune_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void TuneWeights(int tune_file, const std::vector<StringPiece> &model_names, Vec
for (std::size_t iteration = 0; iteration < 10 /*TODO fancy stopping criteria */; ++iteration) {
std::cerr << "Iteration " << iteration << ": weights =";
for (Vector::Index i = 0; i < weights.rows(); ++i) {
std::cerr << ' ' << (weights(i) / M_LN10);
std::cerr << ' ' << (weights(i) * M_LN10);
}
std::cerr << std::endl;
std::cerr << "Perplexity = " <<
Expand All @@ -30,7 +30,7 @@ void TuneWeights(int tune_file, const std::vector<StringPiece> &model_names, Vec
weights -= 0.7 * hessian.inverse() * gradient;
}
// Internally converted to ln, which is equivalent to upweighting.
weights /= M_LN10;
weights *= M_LN10;
}
}} // namespaces

Expand Down

0 comments on commit b48771e

Please sign in to comment.