From f403f5e4785361487969ad4865adea14651bfa15 Mon Sep 17 00:00:00 2001 From: Barry Haddow Date: Fri, 8 May 2015 09:16:51 +0100 Subject: mmsapt doesn't require feature weights on first tuning iteration --- scripts/ems/experiment.perl | 3 +-- scripts/training/train-model.perl | 12 +++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'scripts') 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++; } -- cgit v1.2.3