diff options
author | Colin Cherry <Colin.Cherry@nrc-cnrc.gc.ca> | 2012-06-27 00:33:41 +0400 |
---|---|---|
committer | Colin Cherry <Colin.Cherry@nrc-cnrc.gc.ca> | 2012-06-27 01:02:32 +0400 |
commit | 58c3280c2c0388ee3a02064f3497b3201d0f7554 (patch) | |
tree | f25b3a8fd13e006e468a946e1e58abbed0325bd6 /mert/kbmira.cpp | |
parent | 32299593fa4699bcc04c0b461ed935b207ab31ad (diff) |
HypPackEnumerator now stores MiraFeatureVectors, as opposed to
FeatureDataItems. Uses roughly half the memory.
Diffstat (limited to 'mert/kbmira.cpp')
-rw-r--r-- | mert/kbmira.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mert/kbmira.cpp b/mert/kbmira.cpp index 80a797860..9f202575a 100644 --- a/mert/kbmira.cpp +++ b/mert/kbmira.cpp @@ -201,7 +201,7 @@ int main(int argc, char** argv) size_t hope_index=0, fear_index=0, model_index=0; ValType hope_score=0, fear_score=0, model_score=0; for(size_t i=0; i< train->cur_size(); i++) { - MiraFeatureVector vec(train->featuresAt(i)); + const MiraFeatureVector& vec=train->featuresAt(i); ValType score = wv.score(vec); ValType bleu = sentenceLevelBackgroundBleu(train->scoresAt(i),bg); // Hope @@ -224,8 +224,8 @@ int main(int argc, char** argv) // Update weights if(hope_index!=fear_index) { // Vector difference - MiraFeatureVector hope(train->featuresAt(hope_index)); - MiraFeatureVector fear(train->featuresAt(fear_index)); + const MiraFeatureVector& hope=train->featuresAt(hope_index); + const MiraFeatureVector& fear=train->featuresAt(fear_index); MiraFeatureVector diff = hope - fear; // Bleu difference const vector<float>& hope_stats = train->scoresAt(hope_index); |