Skip to content

Commit

Permalink
Add regression test checking the number of values passed to --early-s…
Browse files Browse the repository at this point in the history
…topping-epsilon
  • Loading branch information
snukky committed Mar 28, 2023
1 parent 5dfb741 commit f41576f
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tests/training/validation/test_early_stopping_epsilon_mismatch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash -x

#####################################################################
# SUMMARY: Check if --early-stopping-epsilon requires the same number of values as --valid-metrics
# AUTHOR: snukky
# TAGS: early-stopping early-stopping-epsilon
#####################################################################

# Exit on error
set -e

# Remove old artifacts
rm -rf eps_stop_mismatch eps_stop_mismatch.log
mkdir -p eps_stop_mismatch

# Test code goes here
cp $MRT_MODELS/wngt19/model.small.npz eps_stop_on_1st/model.npz

$MRT_MARIAN/marian \
--seed 2222 --no-shuffle --clip-norm 1 --maxi-batch 1 --mini-batch 32 -w 2500 \
-m eps_stop_mismatch/model.npz -t $MRT_DATA/europarl.de-en/corpus.small.{de,en}.gz \
-v $MRT_MODELS/wngt19/en-de.{spm,spm} \
--disp-freq 5 --valid-freq 10 --after-batches 10 \
--valid-metrics bleu ce-mean-words perplexity \
--valid-sets $MRT_MODELS/wngt19/newstest2014.{en,de} \
--early-stopping 4 --early-stopping-epsilon 0.5 0.1 > eps_stop_mismatch.log 2>&1 || true

# Check error message
test -e eps_stop_mismatch.log
grep -q "early.stopping.epsilon.* must have as many values as .*valid.metrics" eps_stop_mismatch.log

# Exit with success code
exit 0

0 comments on commit f41576f

Please sign in to comment.