diff options
author | Roman Grundkiewicz <rgrundki@exseed.ed.ac.uk> | 2018-09-18 23:07:39 +0300 |
---|---|---|
committer | Roman Grundkiewicz <rgrundki@exseed.ed.ac.uk> | 2018-09-19 11:28:16 +0300 |
commit | 020f942e53e6d6f06828a0d962621b0f7ccebf52 (patch) | |
tree | 9047d847ad1c2e87cb4685171d9eefc793f4de7d /tests/training/validation | |
parent | 947952b6b6d1c9a95772ee251dfd59df776e8fcd (diff) |
Add tests for empty valid sets
Diffstat (limited to 'tests/training/validation')
-rw-r--r-- | tests/training/validation/.gitignore | 1 | ||||
-rw-r--r-- | tests/training/validation/test_empty_valid_set_lm.sh | 24 | ||||
-rw-r--r-- | tests/training/validation/test_empty_valid_set_source.sh | 24 | ||||
-rw-r--r-- | tests/training/validation/test_empty_valid_set_target.sh | 24 | ||||
-rw-r--r-- | tests/training/validation/test_empty_valid_sets.sh | 25 |
5 files changed, 98 insertions, 0 deletions
diff --git a/tests/training/validation/.gitignore b/tests/training/validation/.gitignore index 49e5167..219c736 100644 --- a/tests/training/validation/.gitignore +++ b/tests/training/validation/.gitignore @@ -3,3 +3,4 @@ final_match final_epoch train.bpe.* vocab.*.yml +empty_* diff --git a/tests/training/validation/test_empty_valid_set_lm.sh b/tests/training/validation/test_empty_valid_set_lm.sh new file mode 100644 index 0000000..2f94c0e --- /dev/null +++ b/tests/training/validation/test_empty_valid_set_lm.sh @@ -0,0 +1,24 @@ +#!/bin/bash -x + +# Exit on error +set -e + +# Test code goes here +rm -rf empty_valid_lm empty_valid_lm.log + +mkdir -p empty_valid_lm +touch empty_valid.en + +$MRT_MARIAN/build/marian \ + --no-shuffle --seed 1111 -o sgd --dim-emb 64 --dim-rnn 128 \ + --model empty_valid_lm/model.npz --type lm \ + -t $MRT_DATA/europarl.de-en/corpus.bpe.en -v vocab.en.yml \ + --disp-freq 2 --valid-freq 4 --after-batches 20 \ + --valid-metrics perplexity --valid-sets empty_valid.en \ + > empty_valid_lm.log 2>&1 || true + +test -e empty_valid_lm.log +grep -qi "file .* empty" empty_valid_lm.log + +# Exit with success code +exit 0 diff --git a/tests/training/validation/test_empty_valid_set_source.sh b/tests/training/validation/test_empty_valid_set_source.sh new file mode 100644 index 0000000..e638e2e --- /dev/null +++ b/tests/training/validation/test_empty_valid_set_source.sh @@ -0,0 +1,24 @@ +#!/bin/bash -x + +# Exit on error +set -e + +# Test code goes here +rm -rf empty_src empty_src.log + +mkdir -p empty_src +touch empty_valid.en + +$MRT_MARIAN/build/marian \ + --no-shuffle --seed 1111 -o sgd --dim-emb 64 --dim-rnn 128 \ + --model empty_src/model.npz \ + -t $MRT_DATA/europarl.de-en/corpus.bpe.{en,de} -v vocab.en.yml vocab.de.yml \ + --disp-freq 2 --valid-freq 4 --after-batches 20 \ + --valid-metrics translation --valid-sets empty_valid.en valid.bpe.de --valid-translation-output empty_src.out \ + > empty_src.log 2>&1 || true + +test -e empty_src.log +grep -qi "file .* empty" empty_src.log + +# Exit with success code +exit 0 diff --git a/tests/training/validation/test_empty_valid_set_target.sh b/tests/training/validation/test_empty_valid_set_target.sh new file mode 100644 index 0000000..2023d0f --- /dev/null +++ b/tests/training/validation/test_empty_valid_set_target.sh @@ -0,0 +1,24 @@ +#!/bin/bash -x + +# Exit on error +set -e + +# Test code goes here +rm -rf empty_trg empty_trg.log + +mkdir -p empty_trg +touch empty_valid.de + +$MRT_MARIAN/build/marian \ + --no-shuffle --seed 1111 -o sgd --dim-emb 64 --dim-rnn 128 \ + --model empty_trg/model.npz \ + -t $MRT_DATA/europarl.de-en/corpus.bpe.{en,de} -v vocab.en.yml vocab.de.yml \ + --disp-freq 2 --valid-freq 4 --after-batches 20 \ + --valid-metrics translation --valid-sets valid.bpe.en empty_valid.de --valid-translation-output empty_trg.out \ + > empty_trg.log 2>&1 || true + +test -e empty_trg.log +grep -qi "file .* empty" empty_trg.log + +# Exit with success code +exit 0 diff --git a/tests/training/validation/test_empty_valid_sets.sh b/tests/training/validation/test_empty_valid_sets.sh new file mode 100644 index 0000000..470ad6b --- /dev/null +++ b/tests/training/validation/test_empty_valid_sets.sh @@ -0,0 +1,25 @@ +#!/bin/bash -x + +# Exit on error +set -e + +# Test code goes here +rm -rf empty_validsets empty_validsets.log + +mkdir -p empty_validsets +touch empty_valid.en +touch empty_valid.de + +$MRT_MARIAN/build/marian \ + --no-shuffle --seed 1111 -o sgd --dim-emb 64 --dim-rnn 128 \ + --model empty_validsets/model.npz \ + -t $MRT_DATA/europarl.de-en/corpus.bpe.{en,de} -v vocab.en.yml vocab.de.yml \ + --disp-freq 2 --valid-freq 4 --after-batches 20 \ + --valid-metrics ce-mean-words bleu --valid-sets empty_valid.{en,de} \ + > empty_validsets.log 2>&1 || true + +test -e empty_validsets.log +grep -qi "file .* empty" empty_validsets.log + +# Exit with success code +exit 0 |