Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/marian-regression-tests.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRoman Grundkiewicz <rgrundki@exseed.ed.ac.uk>2018-02-09 13:28:59 +0300
committerRoman Grundkiewicz <rgrundki@exseed.ed.ac.uk>2018-02-09 13:28:59 +0300
commitb93e2a29f8107f4a9db8cc1a249a51595d9d2b8c (patch)
tree3def511c710606a1179d4f07244f25a33edd463c /tests
parentc74fa185729e6026ea27391fca373804d12160e3 (diff)
Add basic test for SQLite corpus
Diffstat (limited to 'tests')
-rw-r--r--tests/training/basic/.gitignore1
-rw-r--r--tests/training/basic/test_sqlite.sh39
-rw-r--r--tests/training/basic/test_toy_vocab.sh2
3 files changed, 41 insertions, 1 deletions
diff --git a/tests/training/basic/.gitignore b/tests/training/basic/.gitignore
index 33331a2..b7ca9d5 100644
--- a/tests/training/basic/.gitignore
+++ b/tests/training/basic/.gitignore
@@ -1,5 +1,6 @@
toy
valid
trans
+sqlite
*.temp
vocab.*.yml
diff --git a/tests/training/basic/test_sqlite.sh b/tests/training/basic/test_sqlite.sh
new file mode 100644
index 0000000..1136cdc
--- /dev/null
+++ b/tests/training/basic/test_sqlite.sh
@@ -0,0 +1,39 @@
+#!/bin/bash -x
+
+# Exit on error
+set -e
+
+# Test code goes here
+rm -rf sqlite *sqlite.log
+mkdir -p sqlite
+
+$MRT_MARIAN/build/marian \
+ --seed 1111 --no-shuffle \
+ -m sqlite/model.nosqlite.npz \
+ -t $MRT_DATA/europarl.de-en/corpus.bpe.{en,de} \
+ -v sqlite/vocab.{en,de}.yml \
+ --disp-freq 10 --after-batches 100 \
+ --log nosqlite.log
+
+test -e sqlite/model.nosqlite.npz
+test -e nosqlite.log
+
+$MRT_TOOLS/extract-costs.sh < nosqlite.log > nosqlite.out
+
+$MRT_MARIAN/build/marian \
+ --seed 1111 --no-shuffle \
+ -m sqlite/model.npz \
+ -t $MRT_DATA/europarl.de-en/corpus.bpe.{en,de} --sqlite \
+ -v sqlite/vocab.{en,de}.yml \
+ --disp-freq 10 --after-batches 100 \
+ --log sqlite.log
+
+test -e sqlite/model.npz
+test -e sqlite.log
+
+$MRT_TOOLS/extract-costs.sh < sqlite.log > sqlite.out
+
+$MRT_TOOLS/diff-floats.py nosqlite.out sqlite.out -p 0.2 > sqlite.diff
+
+# Exit with success code
+exit 0
diff --git a/tests/training/basic/test_toy_vocab.sh b/tests/training/basic/test_toy_vocab.sh
index be4e7ce..3f72c63 100644
--- a/tests/training/basic/test_toy_vocab.sh
+++ b/tests/training/basic/test_toy_vocab.sh
@@ -20,7 +20,7 @@ test -e toy/model.npz
test -e toy/model.npz.yml
test -e toy/model.npz.amun.yml
-cat toy.log | grep 'Cost ' | sed -r 's/.*Cost (.*) : Time.*/\1/' > toy.out
+cat toy.log | $MRT_TOOLS/extract-costs.sh > toy.out
$MRT_TOOLS/diff-floats.py toy.out toy.expected -p 0.9 > toy.diff
# Exit with success code