diff options
author | Roman Grundkiewicz <rgrundki@exseed.ed.ac.uk> | 2019-02-07 20:56:58 +0300 |
---|---|---|
committer | Roman Grundkiewicz <rgrundki@exseed.ed.ac.uk> | 2019-02-07 20:56:58 +0300 |
commit | 7afb1da8be8901af39e7de59f3bc057fd6a1f714 (patch) | |
tree | cf0e0e9bcde5d7853f820e01b0ad535f7eb4ef91 | |
parent | 5a9587418bc3c9391d12c305aa6ca9b0683326b2 (diff) |
Add test for casting a single value from a config file into a vector
-rw-r--r-- | tests/interface/config/.gitignore | 1 | ||||
-rw-r--r-- | tests/interface/config/load_castup.yml | 7 | ||||
-rw-r--r-- | tests/interface/config/test_load_config_with_type_conversion.sh | 24 |
3 files changed, 32 insertions, 0 deletions
diff --git a/tests/interface/config/.gitignore b/tests/interface/config/.gitignore index 79da7c9..2f6a397 100644 --- a/tests/interface/config/.gitignore +++ b/tests/interface/config/.gitignore @@ -1,4 +1,5 @@ load_config +load_castup dump_*.yml diff --git a/tests/interface/config/load_castup.yml b/tests/interface/config/load_castup.yml new file mode 100644 index 0000000..0aa7ffd --- /dev/null +++ b/tests/interface/config/load_castup.yml @@ -0,0 +1,7 @@ +type: s2s +mini-batch: 8 +dim-rnn: 32 +dim-emb: 16 +after-batches: 2 +# lr-decay-inv-sqrt is now defined as a vector, so a single number should be casted up to a vector +lr-decay-inv-sqrt: 142536475869 diff --git a/tests/interface/config/test_load_config_with_type_conversion.sh b/tests/interface/config/test_load_config_with_type_conversion.sh new file mode 100644 index 0000000..f56e86b --- /dev/null +++ b/tests/interface/config/test_load_config_with_type_conversion.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# +# SUMMARY: Test if a single value option from a config file can be converted to a vector +# AUTHOR: romang + +# Exit on error +set -e + +rm -rf load_castup load_castup.log no_castup.log +mkdir -p load_castup + +# Run marian +$MRT_MARIAN/marian --train-sets $MRT_DATA/europarl.de-en/corpus.bpe.{de,en} --model load_castup/model.npz --vocabs vocab.de.yml vocab.en.yml --no-shuffle \ + --config load_castup.yml --log load_castup.log + +test -e load_castup/model.npz +test -e load_castup.log + +grep -q "type: s2s" load_castup.log +grep -q "lr-decay-inv-sqrt:$" load_castup.log +grep -q " - 142536475869" load_castup.log + +# Exit with success code +exit 0 |