mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-27 05:55:02 +03:00
avoid duplicate generation of source-side features when training VW
This commit is contained in:
parent
f69c1dab02
commit
e932e96db7
@ -155,11 +155,6 @@ public:
|
||||
const WordsRange &sourceRange = translationOptionList.Get(0)->GetSourceWordsRange();
|
||||
const InputPath &inputPath = translationOptionList.Get(0)->GetInputPath();
|
||||
|
||||
for(size_t i = 0; i < sourceFeatures.size(); ++i)
|
||||
(*sourceFeatures[i])(input, inputPath, sourceRange, classifier);
|
||||
|
||||
const std::vector<VWFeatureBase*>& targetFeatures = VWFeatureBase::GetTargetFeatures(GetScoreProducerDescription());
|
||||
|
||||
// optionally update translation options using leave-one-out
|
||||
std::vector<bool> keep = (m_leaveOneOut.size() > 0)
|
||||
? LeaveOneOut(translationOptionList)
|
||||
@ -186,6 +181,11 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
for(size_t i = 0; i < sourceFeatures.size(); ++i)
|
||||
(*sourceFeatures[i])(input, inputPath, sourceRange, classifier);
|
||||
|
||||
const std::vector<VWFeatureBase*>& targetFeatures = VWFeatureBase::GetTargetFeatures(GetScoreProducerDescription());
|
||||
|
||||
std::vector<bool>::const_iterator iterKeep;
|
||||
for(iterTransOpt = translationOptionList.begin(), iterLoss = losses.begin(), iterKeep = keep.begin() ;
|
||||
iterTransOpt != translationOptionList.end() ; ++iterTransOpt, ++iterLoss) {
|
||||
|
Loading…
Reference in New Issue
Block a user