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
diff options
context:
space:
mode:
authorRoman Grundkiewicz <rgrundki@exseed.ed.ac.uk>2018-02-22 15:38:46 +0300
committerRoman Grundkiewicz <rgrundki@exseed.ed.ac.uk>2018-02-22 15:38:46 +0300
commitb8faa15c6ba09c9650f8740887a515cab58d8269 (patch)
tree7c2bf8931ab27dd73f7e549c79cd15cb4ba879e7 /tests/training
parentba1b7807937ff2e3315aec7439e44664431bf165 (diff)
Update regression tests
Diffstat (limited to 'tests/training')
-rw-r--r--tests/training/restart/.gitignore6
-rw-r--r--tests/training/restart/adam_load.expected12
-rw-r--r--tests/training/restart/test_loading_adam_params.sh4
-rw-r--r--tests/training/restart/test_sqlite_restoration.sh48
-rw-r--r--tests/training/restart/test_sqlite_restoration_maxi_batch.sh50
5 files changed, 86 insertions, 34 deletions
diff --git a/tests/training/restart/.gitignore b/tests/training/restart/.gitignore
index 504d7ac..ea8407f 100644
--- a/tests/training/restart/.gitignore
+++ b/tests/training/restart/.gitignore
@@ -8,8 +8,6 @@ adam_sync
adam_load
corpus
corpus.expected
-corpus_sqlite
-corpus_sqlite.expected
corpus_mini
corpus_mini.expected
corpus_one
@@ -18,3 +16,7 @@ corpus_maxi
corpus_maxi.expected
corpus_fit
corpus_fit.expected
+sqlite
+sqlite.expected
+sqlite_maxi
+sqlite_maxi.expected
diff --git a/tests/training/restart/adam_load.expected b/tests/training/restart/adam_load.expected
index 747cbb1..6aacfea 100644
--- a/tests/training/restart/adam_load.expected
+++ b/tests/training/restart/adam_load.expected
@@ -1,6 +1,6 @@
-Ep. 1 : Up. 1 : Sen. 8 : Cost 279.36
-Ep. 1 : Up. 2 : Sen. 16 : Cost 244.33
-Ep. 1 : Up. 3 : Sen. 24 : Cost 190.35
-Ep. 1 : Up. 4 : Sen. 32 : Cost 183.99
-Ep. 1 : Up. 5 : Sen. 40 : Cost 203.82
-Ep. 1 : Up. 6 : Sen. 48 : Cost 204.94
+Ep. 1 : Up. 1 : Sen. 2 : Cost 223.49
+Ep. 1 : Up. 2 : Sen. 4 : Cost 254.90
+Ep. 1 : Up. 3 : Sen. 6 : Cost 208.91
+Ep. 1 : Up. 4 : Sen. 8 : Cost 129.67
+Ep. 1 : Up. 5 : Sen. 10 : Cost 202.96
+Ep. 1 : Up. 6 : Sen. 12 : Cost 253.35
diff --git a/tests/training/restart/test_loading_adam_params.sh b/tests/training/restart/test_loading_adam_params.sh
index 40ab9f2..33508c1 100644
--- a/tests/training/restart/test_loading_adam_params.sh
+++ b/tests/training/restart/test_loading_adam_params.sh
@@ -7,7 +7,7 @@ set -e
rm -rf adam_load adam_load_?.log
mkdir -p adam_load
-extra_opts="--no-shuffle --seed 7777 --maxi-batch 1 --maxi-batch-sort none --mini-batch 8 --dim-rnn 64 --dim-emb 32"
+extra_opts="--no-shuffle --seed 7777 --maxi-batch 1 --maxi-batch-sort none --mini-batch 2 --dim-rnn 64 --dim-emb 32"
$MRT_MARIAN/build/marian \
-m adam_load/model.npz -t train.max50.{en,de} -v vocab.{en,de}.yml \
@@ -31,7 +31,7 @@ test -e adam_load_2.log
cat adam_load_2.log | $MRT_TOOLS/strip-timestamps.sh | grep "Ep\. " | sed 's/ : Time.*//' >> adam_load.out
-$MRT_TOOLS/diff-floats.py -p 3.0 adam_load.out adam_load.expected > adam_load.diff
+$MRT_TOOLS/diff-floats.py -p 5.0 adam_load.out adam_load.expected > adam_load.diff
# Exit with success code
exit 0
diff --git a/tests/training/restart/test_sqlite_restoration.sh b/tests/training/restart/test_sqlite_restoration.sh
index 78b17bd..0f36ca6 100644
--- a/tests/training/restart/test_sqlite_restoration.sh
+++ b/tests/training/restart/test_sqlite_restoration.sh
@@ -4,47 +4,47 @@
set -e
# Test code goes here
-rm -rf corpus_sqlite corpus_sqlite*.log
-mkdir -p corpus_sqlite
+rm -rf sqlite sqlite*.log
+mkdir -p sqlite
test -e vocab.de.yml
test -e vocab.en.yml
-extra_opts="--seed 1111 --maxi-batch 1 --maxi-batch-sort none --mini-batch 32 -o sgd --dim-emb 128 --dim-rnn 256 --disp-freq 4 --restore-corpus"
+extra_opts="--seed 3333 --maxi-batch 1 --maxi-batch-sort none --mini-batch 32 -o sgd --dim-emb 128 --dim-rnn 256 --disp-freq 4 --restore-corpus"
$MRT_MARIAN/build/marian \
- -m corpus_sqlite/model_full.npz -t train.max50.{en,de} -v vocab.{en,de}.yml \
- --after-batches 70 --sqlite corpus_sqlite/dbfull.sqlite3 $extra_opts \
- --log corpus_sqlite.log
+ -m sqlite/model_full.npz -t train.max50.{en,de} -v vocab.{en,de}.yml \
+ --after-batches 75 --sqlite sqlite/dbfull.sqlite3 $extra_opts \
+ --log sqlite.log
-test -e corpus_sqlite/model_full.npz
-test -e corpus_sqlite.log
+test -e sqlite/model_full.npz
+test -e sqlite.log
-cat corpus_sqlite.log | $MRT_TOOLS/strip-timestamps.sh | grep "Ep\. " | sed 's/ : Time.*//' > corpus_sqlite.expected
+cat sqlite.log | $MRT_TOOLS/strip-timestamps.sh | grep "Ep\. " | sed 's/ : Time.*//' > sqlite.expected
$MRT_MARIAN/build/marian \
- -m corpus_sqlite/model.npz -t train.max50.{en,de} -v vocab.{en,de}.yml \
- --after-batches 40 --sqlite corpus_sqlite/db.sqlite3 $extra_opts \
- --log corpus_sqlite_1.log
+ -m sqlite/model.npz -t train.max50.{en,de} -v vocab.{en,de}.yml \
+ --after-batches 50 --sqlite sqlite/db.sqlite3 $extra_opts \
+ --log sqlite_1.log
-test -e corpus_sqlite/model.npz
-test -e corpus_sqlite_1.log
+test -e sqlite/model.npz
+test -e sqlite_1.log
-cat corpus_sqlite_1.log | $MRT_TOOLS/strip-timestamps.sh | grep "Ep\. " | sed 's/ : Time.*//' > corpus_sqlite_1.out
-cp corpus_sqlite/model.npz.yml corpus_sqlite/model.npz.1.yml
+cat sqlite_1.log | $MRT_TOOLS/strip-timestamps.sh | grep "Ep\. " | sed 's/ : Time.*//' > sqlite_1.out
+cp sqlite/model.npz.yml sqlite/model.npz.1.yml
$MRT_MARIAN/build/marian \
- -m corpus_sqlite/model.npz -t train.max50.{en,de} -v vocab.{en,de}.yml \
- --after-batches 70 --sqlite corpus_sqlite/db.sqlite3 $extra_opts \
- --log corpus_sqlite_2.log
+ -m sqlite/model.npz -t train.max50.{en,de} -v vocab.{en,de}.yml \
+ --after-batches 75 --sqlite sqlite/db.sqlite3 $extra_opts \
+ --log sqlite_2.log
-test -e corpus_sqlite/model.npz
-test -e corpus_sqlite_2.log
+test -e sqlite/model.npz
+test -e sqlite_2.log
-cat corpus_sqlite_2.log | $MRT_TOOLS/strip-timestamps.sh | grep "Ep\. " | sed 's/ : Time.*//' > corpus_sqlite_2.out
-cat corpus_sqlite_1.out corpus_sqlite_2.out > corpus_sqlite.out
+cat sqlite_2.log | $MRT_TOOLS/strip-timestamps.sh | grep "Ep\. " | sed 's/ : Time.*//' > sqlite_2.out
+cat sqlite_1.out sqlite_2.out > sqlite.out
-$MRT_TOOLS/diff-floats.py corpus_sqlite.out corpus_sqlite.expected -p 0.1 > corpus_sqlite.diff
+$MRT_TOOLS/diff-floats.py sqlite.out sqlite.expected -p 0.1 -n 1 > sqlite.diff
# Exit with success code
exit 0
diff --git a/tests/training/restart/test_sqlite_restoration_maxi_batch.sh b/tests/training/restart/test_sqlite_restoration_maxi_batch.sh
new file mode 100644
index 0000000..6c7208e
--- /dev/null
+++ b/tests/training/restart/test_sqlite_restoration_maxi_batch.sh
@@ -0,0 +1,50 @@
+#!/bin/bash -x
+
+# Exit on error
+set -e
+
+# Test code goes here
+rm -rf sqlite_maxi sqlite_maxi*.log
+mkdir -p sqlite_maxi
+
+test -e vocab.de.yml
+test -e vocab.en.yml
+
+extra_opts="--seed 4444 --maxi-batch 20 --mini-batch 32 -o sgd --dim-emb 128 --dim-rnn 256 --disp-freq 4 --restore-corpus"
+
+$MRT_MARIAN/build/marian \
+ -m sqlite_maxi/model_full.npz -t train.max50.{en,de} -v vocab.{en,de}.yml \
+ --after-batches 70 $extra_opts \
+ --log sqlite_maxi.log
+
+test -e sqlite_maxi/model_full.npz
+test -e sqlite_maxi.log
+
+cat sqlite_maxi.log | $MRT_TOOLS/strip-timestamps.sh | grep "Ep\. " | sed 's/ : Time.*//' > sqlite_maxi.expected
+
+$MRT_MARIAN/build/marian \
+ -m sqlite_maxi/model.npz -t train.max50.{en,de} -v vocab.{en,de}.yml \
+ --after-batches 40 $extra_opts \
+ --log sqlite_maxi_1.log
+
+test -e sqlite_maxi/model.npz
+test -e sqlite_maxi_1.log
+
+cat sqlite_maxi_1.log | $MRT_TOOLS/strip-timestamps.sh | grep "Ep\. " | sed 's/ : Time.*//' > sqlite_maxi_1.out
+cp sqlite_maxi/model.npz.yml sqlite_maxi/model.npz.1.yml
+
+$MRT_MARIAN/build/marian \
+ -m sqlite_maxi/model.npz -t train.max50.{en,de} -v vocab.{en,de}.yml \
+ --after-batches 70 $extra_opts \
+ --log sqlite_maxi_2.log
+
+test -e sqlite_maxi/model.npz
+test -e sqlite_maxi_2.log
+
+cat sqlite_maxi_2.log | $MRT_TOOLS/strip-timestamps.sh | grep "Ep\. " | sed 's/ : Time.*//' > sqlite_maxi_2.out
+cat sqlite_maxi_1.out sqlite_maxi_2.out > sqlite_maxi.out
+
+$MRT_TOOLS/diff-floats.py sqlite_maxi.out sqlite_maxi.expected -p 0.1 > sqlite_maxi.diff
+
+# Exit with success code
+exit 0