diff options
author | Chris Dyer <cdyer@cs.cmu.edu> | 2011-05-03 17:30:45 -0400 |
---|---|---|
committer | Chris Dyer <cdyer@cs.cmu.edu> | 2011-05-03 17:30:45 -0400 |
commit | 7c7604c4fbbedc4db977b3ad15ac6a47aa7044f2 (patch) | |
tree | 6ca8cb8e6801fc172bdf9c12a1966a7e7c33dd24 /training | |
parent | 01e219ec7d0bbd81471d7e6978397a2d53a71246 (diff) | |
parent | 256dfe09345418962241f83e9bff9b4b4bba7e92 (diff) |
Merge branch 'master' of github.com:redpony/cdec
Diffstat (limited to 'training')
-rw-r--r-- | training/model1.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/training/model1.cc b/training/model1.cc index 4023735c..b9590ece 100644 --- a/training/model1.cc +++ b/training/model1.cc @@ -129,10 +129,15 @@ int main(int argc, char** argv) { likelihood += log(sum) + src_logprob; } } + + // log(e) = 1.0 + double base2_likelihood = likelihood / log(2); + if (flag) { cerr << endl; } - cerr << " log likelihood: " << likelihood << endl; - cerr << " cross entropy: " << (-likelihood / denom) << endl; - cerr << " perplexity: " << pow(2.0, -likelihood / denom) << endl; + cerr << " log_e likelihood: " << likelihood << endl; + cerr << " log_2 likelihood: " << base2_likelihood << endl; + cerr << " cross entropy: " << (-base2_likelihood / denom) << endl; + cerr << " perplexity: " << pow(2.0, -base2_likelihood / denom) << endl; if (!final_iteration) { if (variational_bayes) tt.NormalizeVB(alpha); |