diff options
author | Roman Grundkiewicz <rgrundki@exseed.ed.ac.uk> | 2018-02-10 01:45:49 +0300 |
---|---|---|
committer | Roman Grundkiewicz <rgrundki@exseed.ed.ac.uk> | 2018-02-10 01:45:49 +0300 |
commit | 62369d4a7a1a8a5829861250842b2e1d618f2ba5 (patch) | |
tree | 3babd445ae594cfeba46413af93e3930c0cd5ab8 | |
parent | 10f2e66dfb162b09cea99b91ad982f6c93a781f8 (diff) |
Add test for random_seed() SQLite function
-rw-r--r-- | tests/training/basic/test_sqlite_random_seed.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/training/basic/test_sqlite_random_seed.sh b/tests/training/basic/test_sqlite_random_seed.sh new file mode 100644 index 0000000..8baa3e9 --- /dev/null +++ b/tests/training/basic/test_sqlite_random_seed.sh @@ -0,0 +1,38 @@ +#!/bin/bash -x + +# Exit on error +set -e + +# Test code goes here +rm -rf sqlite_seed sqlite_seed_?.log +mkdir -p sqlite_seed + +$MRT_MARIAN/build/marian \ + --seed 3333 \ + -m sqlite_seed/model1.npz \ + -t $MRT_DATA/europarl.de-en/corpus.bpe.{en,de} --sqlite \ + -v sqlite_seed/vocab.{en,de}.yml \ + --disp-freq 2 --after-batches 50 \ + --log sqlite_seed_1.log + +test -e sqlite_seed/model1.npz +test -e sqlite_seed_1.log + +$MRT_MARIAN/build/marian \ + --seed 3333 \ + -m sqlite_seed/model2.npz \ + -t $MRT_DATA/europarl.de-en/corpus.bpe.{en,de} --sqlite \ + -v sqlite_seed/vocab.{en,de}.yml \ + --disp-freq 2 --after-batches 50 \ + --log sqlite_seed_2.log + +test -e sqlite_seed/model2.npz +test -e sqlite_seed_2.log + +$MRT_TOOLS/extract-costs.sh < sqlite_seed_1.log > sqlite_seed_1.out +$MRT_TOOLS/extract-costs.sh < sqlite_seed_2.log > sqlite_seed_2.out + +$MRT_TOOLS/diff-floats.py sqlite_seed_1.out sqlite_seed_2.out -p 0.1 > sqlite_seed.diff + +# Exit with success code +exit 0 |