diff options
author | Roman Grundkiewicz <rgrundki@exseed.ed.ac.uk> | 2018-06-21 11:26:05 +0300 |
---|---|---|
committer | Roman Grundkiewicz <rgrundki@exseed.ed.ac.uk> | 2018-06-21 11:26:05 +0300 |
commit | 318a585aa22fd66f1f3abf49c7b9a6db1b877d41 (patch) | |
tree | 9a683ee7c60ff0dc24389bff2594a3c11ef3cc49 /tests/training/restoring/corpus/test_corpus_restoration_one_epoch.sh | |
parent | c7f0ec4519a44e8226cf4d96ad0c227a38c9b2db (diff) |
Move tests to subdirectory
Diffstat (limited to 'tests/training/restoring/corpus/test_corpus_restoration_one_epoch.sh')
-rw-r--r-- | tests/training/restoring/corpus/test_corpus_restoration_one_epoch.sh | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/training/restoring/corpus/test_corpus_restoration_one_epoch.sh b/tests/training/restoring/corpus/test_corpus_restoration_one_epoch.sh new file mode 100644 index 0000000..1006398 --- /dev/null +++ b/tests/training/restoring/corpus/test_corpus_restoration_one_epoch.sh @@ -0,0 +1,50 @@ +#!/bin/bash -x + +# Exit on error +set -e + +# Test code goes here +rm -rf corpus_one corpus_one*.log +mkdir -p corpus_one + +test -e vocab.de.yml +test -e vocab.en.yml + +extra_opts="--seed 9999 --maxi-batch 1 --maxi-batch-sort none --mini-batch 32 -o sgd --dim-emb 128 --dim-rnn 256 --disp-freq 4" + +$MRT_MARIAN/build/marian \ + -m corpus_one/model_full.npz -t $MRT_DATA/train.max50.{en,de} -v vocab.en.yml vocab.de.yml \ + --after-batches 70 $extra_opts \ + --log corpus_one.log + +test -e corpus_one/model_full.npz +test -e corpus_one.log + +cat corpus_one.log | $MRT_TOOLS/strip-timestamps.sh | grep "Ep\. " | sed 's/ : Time.*//' > corpus_one.expected + +$MRT_MARIAN/build/marian \ + -m corpus_one/model.npz -t $MRT_DATA/train.max50.{en,de} -v vocab.en.yml vocab.de.yml \ + --after-batches 25 $extra_opts \ + --log corpus_one_1.log + +test -e corpus_one/model.npz +test -e corpus_one_1.log + +cat corpus_one_1.log | $MRT_TOOLS/strip-timestamps.sh | grep "Ep\. " | sed 's/ : Time.*//' > corpus_one_1.out +cp corpus_one/model.npz.yml corpus_one/model.npz.1.yml + +$MRT_MARIAN/build/marian \ + -m corpus_one/model.npz -t $MRT_DATA/train.max50.{en,de} -v vocab.en.yml vocab.de.yml \ + --after-batches 70 $extra_opts \ + --log corpus_one_2.log + +test -e corpus_one/model.npz +test -e corpus_one_2.log + +cat corpus_one_2.log | $MRT_TOOLS/strip-timestamps.sh | grep "Ep\. " | sed 's/ : Time.*//' > corpus_one_2.out +cat corpus_one_1.out corpus_one_2.out > corpus_one.out + +$MRT_TOOLS/diff-floats.py corpus_one.out corpus_one.expected -p 0.1 > corpus_one.diff + +# Exit with success code +exit 0 |