diff options
author | Colin Cherry <colin.a.cherry@gmail.com> | 2012-06-14 22:09:06 +0400 |
---|---|---|
committer | Colin Cherry <colin.a.cherry@gmail.com> | 2012-06-14 22:09:06 +0400 |
commit | a8a5f896dbdfffddf0468ba7a28a06b29dbba3a7 (patch) | |
tree | d3f558ae5c05a0c4480f936211466130d8881272 /mert/kbmira.cpp | |
parent | 742f2d047fed8898f461ca42defc9094d0809660 (diff) |
Fixed some bugs in BatchMira's sparse feature handling.
Diffstat (limited to 'mert/kbmira.cpp')
-rw-r--r-- | mert/kbmira.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mert/kbmira.cpp b/mert/kbmira.cpp index 7e303bcfe..0723e9975 100644 --- a/mert/kbmira.cpp +++ b/mert/kbmira.cpp @@ -137,7 +137,9 @@ int main(int argc, char** argv) parameter_t val; getline(opt,buffer); istringstream strstrm(buffer); - while(strstrm >> val) initParams.push_back(val); + while(strstrm >> val) { + initParams.push_back(val); + } opt.close(); } size_t initDenseSize = initParams.size(); @@ -226,7 +228,7 @@ int main(int argc, char** argv) ValType hopeBleu = sentenceLevelBackgroundBleu(hope_stats, bg); const vector<float>& fear_stats = train->scoresAt(fear_index); ValType fearBleu = sentenceLevelBackgroundBleu(fear_stats, bg); - assert(hopeBleu > fearBleu); + assert(hopeBleu + 1e-8 >= fearBleu); ValType delta = hopeBleu - fearBleu; // Loss and update ValType diff_score = wv.score(diff); |