From 5160d281e65c5bd525f7b8d72f3369cc09f4bbde Mon Sep 17 00:00:00 2001 From: redpony Date: Mon, 5 Jul 2010 19:56:15 +0000 Subject: write the final weights file to STDOUT git-svn-id: https://ws10smt.googlecode.com/svn/trunk@138 ec762483-ff6d-05da-a07a-a48fb63a330f --- vest/dist-vest.pl | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/vest/dist-vest.pl b/vest/dist-vest.pl index 83a45a6a..86d2b7e0 100755 --- a/vest/dist-vest.pl +++ b/vest/dist-vest.pl @@ -42,7 +42,6 @@ my $help = 0; my $epsilon = 0.0001; my $interval = 5; my $dryrun = 0; -my $ranges; my $last_score = -10000000; my $metric = "ibm_bleu"; my $dir; @@ -66,7 +65,6 @@ if (GetOptions( "max-iterations=i" => \$max_iterations, "normalize=s" => \$normalize, "pmem=s" => \$pmem, - "ranges=s" => \$ranges, "rand-directions=i" => \$rand_directions, "ref-files=s" => \$refFiles, "metric=s" => \$metric, @@ -240,11 +238,10 @@ while (1){ $result = system($cmd); unless ($result == 0){ cleanup(); - print STDERR "ERROR: mapinput command returned non-zero exit code $result\n"; - die; + die "ERROR: mapinput command returned non-zero exit code $result\n"; } - `mkdir $dir/splag.$im1`; + `mkdir $dir/splag.$im1`; $cmd="split -a 3 -l $lines_per_mapper $dir/agenda.$im1-$opt_iter $dir/splag.$im1/mapinput."; print STDERR "COMMAND:\n$cmd\n"; $result = system($cmd); @@ -277,8 +274,7 @@ while (1){ $result = system($script); unless ($result == 0){ cleanup(); - print STDERR "ERROR: mapper returned non-zero exit code $result\n"; - die; + die "ERROR: mapper returned non-zero exit code $result\n"; } } else { my $script_file = "$dir/scripts/map.$shard"; @@ -328,8 +324,7 @@ while (1){ $result = system($cmd); unless ($result == 0){ cleanup(); - print STDERR "ERROR: reducer command returned non-zero exit code $result\n"; - die; + die "ERROR: reducer command returned non-zero exit code $result\n"; } $cmd="sort -nk3 $DIR_FLAG '-t|' $dir/redoutput.$im1 | head -1"; my $best=`$cmd`; chomp $best; @@ -379,7 +374,11 @@ while (1){ print STDERR "\n==========\n"; } -print STDERR "\nFINAL WEIGHTS: $dir/$lastWeightsFile\n(Use -w with hiero)\n\n"; +print STDERR "\nFINAL WEIGHTS: $dir/$lastWeightsFile\n(Use -w with the decoder)\n\n"; + +print STDOUT "$dir/$lastWeightsFile\n"; + +exit 0; sub normalize_weights { my ($rfn, $rpts, $feat) = @_; -- cgit v1.2.3