diff options
author | Barry Haddow <barry.haddow@gmail.com> | 2015-05-08 11:16:51 +0300 |
---|---|---|
committer | Barry Haddow <barry.haddow@gmail.com> | 2015-05-08 11:16:51 +0300 |
commit | f403f5e4785361487969ad4865adea14651bfa15 (patch) | |
tree | dbed6ca2d7cc6b282c89471f589bbf0e66a3c3f0 | |
parent | 09c982c1de248656fe9be129ded8fd3846c89fda (diff) |
mmsapt doesn't require feature weights on first tuning iteration
-rwxr-xr-x | scripts/ems/experiment.perl | 3 | ||||
-rwxr-xr-x | scripts/training/train-model.perl | 12 |
2 files changed, 8 insertions, 7 deletions
diff --git a/scripts/ems/experiment.perl b/scripts/ems/experiment.perl index 7070a7c9e..def5b9a82 100755 --- a/scripts/ems/experiment.perl +++ b/scripts/ems/experiment.perl @@ -2438,9 +2438,8 @@ sub get_config_tables { my $mmsapt = &get("TRAINING:mmsapt"); if (defined($mmsapt)) { $ptImpl = 11; # mmsapt - $mmsapt =~ s/num-features=(\d+) // || die("ERROR: mmsapt setting needs to set num-features"); $numFF = $1; - $cmd .= "-mmsapt '$mmsapt' "; + $cmd .= "-mmsapt "; } # additional settings for factored models diff --git a/scripts/training/train-model.perl b/scripts/training/train-model.perl index 4c355479c..e6eacfd98 100755 --- a/scripts/training/train-model.perl +++ b/scripts/training/train-model.perl @@ -228,7 +228,7 @@ $_HELP = 1 'osm-setting=s' => \$_OSM_FACTORS, 'post-decoding-translit=s' => \$_POST_DECODING_TRANSLIT, 'transliteration-phrase-table=s' => \$_TRANSLITERATION_PHRASE_TABLE, - 'mmsapt=s' => \$_MMSAPT, + 'mmsapt' => \$_MMSAPT, 'max-lexical-reordering' => \$_MAX_LEXICAL_REORDERING, 'lexical-reordering-default-scores=s' => \$_LEXICAL_REORDERING_DEFAULT_SCORES, 'do-steps=s' => \$_DO_STEPS, @@ -2115,11 +2115,13 @@ sub create_ini { # sum up... $feature_spec .= "$phrase_table_impl_name name=TranslationModel$i num-features=$basic_weight_count path=$file input-factor=$input_factor output-factor=$output_factor"; - $feature_spec .= " L1=$___F L2=$___E ".$_MMSAPT if defined($_MMSAPT); # extra settings for memory mapped suffix array phrase table + $feature_spec .= " L1=$___F L2=$___E " if defined($_MMSAPT); # extra settings for memory mapped suffix array phrase table $feature_spec .= "\n"; - $weight_spec .= "TranslationModel$i="; - for(my $j=0;$j<$basic_weight_count;$j++) { $weight_spec .= " 0.2"; } - $weight_spec .= "\n"; + unless ($phrase_table_impl==11) { # suffix array provides its weights at first iteration + $weight_spec .= "TranslationModel$i="; + for(my $j=0;$j<$basic_weight_count;$j++) { $weight_spec .= " 0.2"; } + $weight_spec .= "\n"; + } $i++; } |