Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Germann <Ulrich.Germann@gmail.com>2015-08-07 00:52:34 +0300
committerUlrich Germann <Ulrich.Germann@gmail.com>2015-08-07 00:52:34 +0300
commit6c1d9e2431a1dbc270ea5ab401f47c2c32621103 (patch)
treefcab703afdd8205b15f3de2a19d59cabc5a7ca6a /moses/mbr.cpp
parent524109e2cabe5bd3ac693d3187e439885484a8c7 (diff)
More reorganisation of options.
Diffstat (limited to 'moses/mbr.cpp')
-rw-r--r--moses/mbr.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/moses/mbr.cpp b/moses/mbr.cpp
index 66dac47f7..e49b1c5d9 100644
--- a/moses/mbr.cpp
+++ b/moses/mbr.cpp
@@ -92,7 +92,7 @@ float calculate_score(const vector< vector<const Factor*> > & sents, int ref, in
const TrellisPath doMBR(const TrellisPathList& nBestList)
{
float marginal = 0;
-
+ float mbr_scale = StaticData::Instance().options().mbr.scale;
vector<float> joint_prob_vec;
vector< vector<const Factor*> > translations;
float joint_prob;
@@ -104,14 +104,13 @@ const TrellisPath doMBR(const TrellisPathList& nBestList)
float maxScore = -1e20;
for (iter = nBestList.begin() ; iter != nBestList.end() ; ++iter) {
const TrellisPath &path = **iter;
- float score = StaticData::Instance().GetMBRScale()
- * path.GetScoreBreakdown()->GetWeightedScore();
+ float score = mbr_scale * path.GetScoreBreakdown()->GetWeightedScore();
if (maxScore < score) maxScore = score;
}
for (iter = nBestList.begin() ; iter != nBestList.end() ; ++iter) {
const TrellisPath &path = **iter;
- joint_prob = UntransformScore(StaticData::Instance().GetMBRScale() * path.GetScoreBreakdown()->GetWeightedScore() - maxScore);
+ joint_prob = UntransformScore(mbr_scale * path.GetScoreBreakdown()->GetWeightedScore() - maxScore);
marginal += joint_prob;
joint_prob_vec.push_back(joint_prob);