diff options
author | bojar <bojar@1f5c12ca-751b-0410-a591-d2e778427230> | 2006-08-01 01:01:07 +0400 |
---|---|---|
committer | bojar <bojar@1f5c12ca-751b-0410-a591-d2e778427230> | 2006-08-01 01:01:07 +0400 |
commit | 540aadea2bff90a518c52ca0143ba603bb883b3d (patch) | |
tree | 4a3ff1ae03ccdea8dc7ce69d5d55b5e15d5083cb | |
parent | 60af7b28444bb1d5db42786b39df5b143b2d759f (diff) |
Allowing to optimize unknown lambdas, release methodology
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@421 1f5c12ca-751b-0410-a591-d2e778427230
-rw-r--r-- | scripts/Makefile | 8 | ||||
-rwxr-xr-x | scripts/training/mert-moses.pl | 20 |
2 files changed, 22 insertions, 6 deletions
diff --git a/scripts/Makefile b/scripts/Makefile index 22bf8ec15..a0d9ea2d0 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -9,11 +9,11 @@ DS?=$(shell date '+%Y%m%d') ## That is for each script (listed below in MAIN_SCRIPTS), ## we create a date-stamped version in MAIN_SCRIPTS_TARGET_DIR -# MAIN_SCRIPTS_TARGET_DIR=/export/ws06osmt/bin -MAIN_SCRIPTS_TARGET_DIR=$(shell echo `pwd`/temp) +MAIN_SCRIPTS_TARGET_DIR=/export/ws06osmt/bin +# MAIN_SCRIPTS_TARGET_DIR=$(shell echo `pwd`/temp) -# RELEASEDIR=/export/ws06osmt/bin/scripts-$(TS) -RELEASEDIR=$(shell echo `pwd`/temp) +RELEASEDIR=/export/ws06osmt/bin/scripts-$(TS) +# RELEASEDIR=$(shell echo `pwd`/temp) diff --git a/scripts/training/mert-moses.pl b/scripts/training/mert-moses.pl index cf02b8d02..e65aa7243 100755 --- a/scripts/training/mert-moses.pl +++ b/scripts/training/mert-moses.pl @@ -86,6 +86,9 @@ my $___START_STEP = undef; # which iteration step to start with # Use "--average" to use average reference length my $___AVERAGE = 0; +my $allow_unknown_lambdas = 0; + + my $SCRIPTS_ROOTDIR = undef; # path to all tools (overriden by specific options) my $cmertdir = undef; # path to cmert directory my $pythonpath = undef; # path to python libraries needed by cmert @@ -111,6 +114,7 @@ GetOptions( "start-step=i" => \$___START_STEP, "average" => \$___AVERAGE, "help" => \$usage, + "allow-unknown-lambdas" => \$allow_unknown_lambdas, "verbose" => \$verbose, "roodir=s" => \$SCRIPTS_ROOTDIR, "cmertdir=s" => \$cmertdir, @@ -141,6 +145,8 @@ Options: --decoder-flags=STRING ... extra parameters for the decoder --lambdas=STRING ... default values and ranges for lambdas, a complex string such as 'd:1,0.5-1.5 lm:1,0.5-1.5 tm:0.3,0.25-0.75;0.2,0.25-0.75;0.2,0.25-0.75;0.3,0.25-0.75;0,-0.5-0.5 w:0,-0.5-0.5' + --allow-unknown-lambdas ... keep going even if someone supplies a new lambda + in the lambdas option (such as 'superbmodel:1,0-1'); optimize it, too --start-step=NUM ... start at step X (that has been already achieved before) --average ... Use either average or shortest (default) reference length as effective reference length @@ -294,8 +300,16 @@ foreach my $name (keys %$use_triples) { my $expected_lambdas = $lambdas_per_model->{$name}; $expected_lambdas = 0 if !defined $expected_lambdas; my $got_lambdas = defined $use_triples->{$name} ? scalar @{$use_triples->{$name}} : 0; - die "Wrong number of lambdas for $name. Expected (given the config file): $expected_lambdas, got: $got_lambdas" - if $got_lambdas != $expected_lambdas; + if ($got_lambdas != $expected_lambdas) { + if ($allow_unknown_lambdas && $expected_lambdas == 0) { + print STDERR "Allowing to optimize $name, although I have no idea what it is.\n"; + } else { + print STDERR "Wrong number of lambdas for $name. Expected (given the config file): $expected_lambdas, got: $got_lambdas. +Use --allow-unknown-lambdas to optimize lambdas that you are just introducing +and I cannot validate against the models mentioned in moses.ini."; + exit 1; + } + } foreach my $feature (@{$use_triples->{$name}}) { my ($startval, $min, $max) = @$feature; @@ -338,6 +352,8 @@ chdir($___WORKING_DIR) or die "Can't chdir to $___WORKING_DIR"; +# Debugging purposes, +create_config($___CONFIG, "./preliminary.moses.ini", \@LAMBDA, \@NAME, "--not-run--", "--not-estimated--"); # create some initial files (esp. weights and their ranges for randomization) |