summaryrefslogtreecommitdiff
path: root/training
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2011-05-03 17:30:45 -0400
committerChris Dyer <cdyer@cs.cmu.edu>2011-05-03 17:30:45 -0400
commitbd0717527a82019e236625c8ae0f726ba4021e50 (patch)
tree7d18a0cd66cc8b4bd864f5c79e4d10a8dc2a8f66 /training
parentf67862c799f911b6671a83b50b22b6a2323855c8 (diff)
parent3dec805a31b4542eee07adc6d2f42f77f7980045 (diff)
Merge branch 'master' of github.com:redpony/cdec
Diffstat (limited to 'training')
-rw-r--r--training/model1.cc11
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);