diff options
author | Chris Dyer <cdyer@cs.cmu.edu> | 2011-02-22 13:00:57 -0500 |
---|---|---|
committer | Chris Dyer <cdyer@cs.cmu.edu> | 2011-02-22 13:00:57 -0500 |
commit | 4324cdb03ec1f8332ad053e9f4f85170027b3938 (patch) | |
tree | 9836046634cbb8ae0771bdb1c46c88f36b9042fd /vest | |
parent | b6a372a529093975464e23cb01cb2a9ee3e7b0c7 (diff) |
fail early in vest on decoder failure
Diffstat (limited to 'vest')
-rwxr-xr-x | vest/dist-vest.pl | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/vest/dist-vest.pl b/vest/dist-vest.pl index 9d7129c2..2a56dd55 100755 --- a/vest/dist-vest.pl +++ b/vest/dist-vest.pl @@ -263,7 +263,7 @@ while (1){ #decode - print STDERR "DECODE\n"; + print STDERR "RUNNING DECODER AT "; print STDERR `date`; my $im1 = $iteration - 1; my $weightsFile="$dir/weights.$im1"; @@ -289,7 +289,8 @@ while (1){ die; } my $num_hgs = `ls $dir/hgs/*.gz | wc -l`; - print STDERR "HGs: $num_hgs\n"; + print STDERR "NUMBER OF HGs: $num_hgs\n"; + die "Dev set contains $devSize sentences! Decoder failure?\n" if ($devSize != $num_hgs); my $dec_score = `cat $runFile | $SCORER $refs_comma_sep -l $metric`; chomp $dec_score; print STDERR "DECODER SCORE: $dec_score\n"; @@ -299,6 +300,7 @@ while (1){ `gzip -f $decoderLog`; # run optimizer + print STDERR "RUNNING OPTIMIZER AT "; print STDERR `date`; my $mergeLog="$logdir/prune-merge.log.$iteration"; @@ -309,9 +311,9 @@ while (1){ print STDERR "\nGENERATE OPTIMIZATION STRATEGY (OPT-ITERATION $opt_iter/$optimization_iters)\n"; print STDERR `date`; $icc++; - my $nop=$noprimary?"--no_primary":""; - my $targs=$oraclen ? "--decoder_translations='$runFile.gz' ".get_comma_sep_refs('-references',$refFiles):""; - my $bwargs=$bleu_weight!=1 ? "--bleu_weight=$bleu_weight":""; + my $nop=$noprimary?"--no_primary":""; + my $targs=$oraclen ? "--decoder_translations='$runFile.gz' ".get_comma_sep_refs('-references',$refFiles):""; + my $bwargs=$bleu_weight!=1 ? "--bleu_weight=$bleu_weight":""; $cmd="$MAPINPUT -w $inweights -r $dir/hgs $bwargs -s $devSize -d $rand_directions --max_similarity=$maxsim --oracle_directions=$oraclen --oracle_batch=$oracleb $targs $dirargs > $dir/agenda.$im1-$opt_iter"; print STDERR "COMMAND:\n$cmd\n"; $result = system($cmd); |