diff options
author | Rico Sennrich <rico.sennrich@gmx.ch> | 2013-07-31 15:32:53 +0400 |
---|---|---|
committer | Rico Sennrich <rico.sennrich@gmx.ch> | 2013-07-31 16:18:18 +0400 |
commit | b32366ab8cf228d8789202aeb74da6737881b7b5 (patch) | |
tree | 05ef43b76aa97b42d03596b0adb7e073e5a95cfa /moses/ScoreComponentCollection.cpp | |
parent | d0e2c43011e26483598fae00a4fb15020fdf21cf (diff) |
fix future and total cost in multimodel(counts). (was broken since merge of branch weight-new in May)
Diffstat (limited to 'moses/ScoreComponentCollection.cpp')
-rw-r--r-- | moses/ScoreComponentCollection.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/moses/ScoreComponentCollection.cpp b/moses/ScoreComponentCollection.cpp index d6ddaec9f..97ae2684d 100644 --- a/moses/ScoreComponentCollection.cpp +++ b/moses/ScoreComponentCollection.cpp @@ -185,6 +185,19 @@ void ScoreComponentCollection::Assign(const FeatureFunction* sp, const string li } } +void ScoreComponentCollection::InvertDenseFeatures(const FeatureFunction* sp) +{ + + Scores old_scores = GetScoresForProducer(sp); + Scores new_scores(old_scores.size()); + + for (size_t i = 0; i != old_scores.size(); ++i) { + new_scores[i] = -old_scores[i]; + } + + Assign(sp, new_scores); +} + void ScoreComponentCollection::ZeroDenseFeatures(const FeatureFunction* sp) { size_t numScores = sp->GetNumScoreComponents(); |