neubig / travatar

This is a repository for the Travatar forest-to-string translation decoder
GNU Lesser General Public License v3.0
28 stars 11 forks source link

mert-travatar.pl repeating weight_vals #32

Closed kpu closed 9 years ago

kpu commented 9 years ago

Each MERT iteration is writing the weights with all 0s then the actual weights.
run1.ini: [weight_vals] egfp=0.05 egfl=0.05 fgep=0.05 fgel=0.05 lm=0.3 w=0.3 p=-0.15 unk=0 lfreq=0.05 parse=1

run2.ini: [weight_vals] egfp=0 egfl=0 fgep=0 fgel=0 lm=0 w=0 p=0 unk=0 lfreq=0 parse=0 w=0.142192 fgel=0.00490651 lm=0.0748051 egfl=0.00770824 parse=0.0901886 unk=0.634792 lfreq=0.0107703 egfp=0.00552687 fgep=0.0150753 p=0.0140351

and even more for run3.ini. The result is that features see 0 weight, including LMComposerIncremental, which produces a NaN on this line: Real lm_score = (edge_score - lm_unk * lm_unkweight - edge->GetScore())/lmweight;

Bug 1: MERT should not be writing all the features with weight 0.
Bug 2: please add an error message or choose the last instance of the weight for repeated feature weights.

philip30 commented 9 years ago

Hi @kpu thanks for the report! This bug is caused by my push recently and have been fixed by this commit https://github.com/neubig/travatar/commit/44bb5f584770e5ef14d7ab42a86c836f99cfef3f . Can you try again and see whether you still encounter this problem?

kpu commented 9 years ago

It's working now, thanks. Can you please fix bug 2 though?

philip30 commented 9 years ago

@kpu , sorry didn't really get you. I think because of that fix, the features should not be repeated. Do you still find the repeated features?

neubig commented 9 years ago

@philip30 I think he means that "when there are two instances of the same weight in the configuration file (for example, lm=0, followed by lm=0.0748051), we should use the last one, or throw an error.

philip30 commented 9 years ago

@neubig I see, thanks! @kpu I think this commit (https://github.com/neubig/travatar/commit/ad430550179c99522b39a86c837a28b05d923948) will solve that problem. Can you try to double check? Thanks!

kpu commented 9 years ago

Thanks.