diff options
author | Patrick Simianer <p@simianer.de> | 2016-04-08 14:14:20 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2016-04-08 14:14:20 +0200 |
commit | a27f7c022be6196afce81d7020a6d7501b28684f (patch) | |
tree | 2e777e222ec252b2df7da3a439ac841aeec0f347 /training/dtrain/score.h | |
parent | 079b78f659ef9e06cb6b38db634c2f7daa5aba13 (diff) |
dtrain: fix Liang's score
Diffstat (limited to 'training/dtrain/score.h')
-rw-r--r-- | training/dtrain/score.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/training/dtrain/score.h b/training/dtrain/score.h index a9c60b64..748b3317 100644 --- a/training/dtrain/score.h +++ b/training/dtrain/score.h @@ -356,14 +356,14 @@ class LiangBleuScorer : public Scorer break; } else { weight_t i_score = log((weight_t)counts.clipped[i]/counts.sum[i]); - for (size_t j=i; j < M; j++) { + for (size_t j=i; j<M; j++) { i_bleu[j] += (1/((weight_t)j+1)) * i_score; } } - sum += exp(i_bleu[i])/pow(2.0, (double)(N_-i+2)); + sum += exp(i_bleu[i])/pow(2.0, (double)(N_-i)); } - return brevity_penalty(hl, hl) * sum; + return brevity_penalty(hl, rl) * sum; } }; |