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
path: root/moses/FF
diff options
context:
space:
mode:
authorAles Tamchyna <tamchyna@ufal.mff.cuni.cz>2016-03-23 16:10:25 +0300
committerAles Tamchyna <tamchyna@ufal.mff.cuni.cz>2016-03-23 16:10:25 +0300
commitf6f506e8148758af205efd781e76410c5efb0b19 (patch)
tree265421137a59ca56a8bfb90d4430e3c93917dd98 /moses/FF
parent47e1ffc1082d7e4b9fe3d21e3af9a6275c429934 (diff)
clarification
Diffstat (limited to 'moses/FF')
-rw-r--r--moses/FF/VW/VW.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/moses/FF/VW/VW.cpp b/moses/FF/VW/VW.cpp
index a29430cad..6d529a8fb 100644
--- a/moses/FF/VW/VW.cpp
+++ b/moses/FF/VW/VW.cpp
@@ -353,19 +353,20 @@ void VW::EvaluateTranslationOptionListWithSourceContext(const InputType &input
topt->UpdateScore();
} else {
- // we have target context features => this is just a partial score,
- // do not add it to the score component collection
- // subtract the score contribution of target-only features, otherwise it would
- // be included twice
+ // We have target context features => this is just a partial score,
+ // do not add it to the score component collection.
size_t toptHash = hash_value(*topt);
+
+ // Subtract the score contribution of target-only features, otherwise it would
+ // be included twice.
Discriminative::FeatureVector emptySource;
const Discriminative::FeatureVector &targetFeatureVector =
m_tlsTranslationOptionFeatures->GetStored()->find(toptHash)->second;
-
classifier.AddLabelIndependentFeatureVector(emptySource);
classifier.AddLabelDependentFeatureVector(targetFeatureVector);
- float futureScore = rawLosses[toptIdx];
- futureScore -= classifier.Predict(VW_DUMMY_LABEL);
+ float targetOnlyLoss = classifier.Predict(VW_DUMMY_LABEL);
+
+ float futureScore = rawLosses[toptIdx] - targetOnlyLoss;
m_tlsFutureScores->GetStored()->insert(std::make_pair(toptHash, futureScore));
}
}