diff options
author | Marcin Junczys-Dowmunt <junczys@amu.edu.pl> | 2017-03-24 20:37:35 +0300 |
---|---|---|
committer | Marcin Junczys-Dowmunt <junczys@amu.edu.pl> | 2017-03-24 20:37:35 +0300 |
commit | 5dbeadb47dbb70b85061aa08c8c55193d9fbe74a (patch) | |
tree | 2e0e7d1698b0c756896c6af59cde4eb4f5eabd02 /examples/training/run-me.sh | |
parent | e7157515d3f30b44649f2f48b4a70b3999530a02 (diff) |
added training example
Diffstat (limited to 'examples/training/run-me.sh')
-rwxr-xr-x | examples/training/run-me.sh | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/examples/training/run-me.sh b/examples/training/run-me.sh new file mode 100755 index 00000000..66c49f2f --- /dev/null +++ b/examples/training/run-me.sh @@ -0,0 +1,56 @@ +#!/bin/bash -v + +if [ ! -e ../../build/amun ] +then + echo "amun is not installed in ../../build, you need to compile the toolkit first." + exit 1 +fi + +if [ ! -e ../../build/marian ] +then + echo "marian is not installed in ../../build, you need to compile the toolkit first." + exit 1 +fi + +if [ ! -e "mosesdecoder" ] +then + git clone https://github.com/moses-smt/mosesdecoder +fi + +if [ ! -e "subword-nmt" ] +then + git clone https://github.com/rsennrich/subword-nmt +fi + +if [ ! -e "data/ro-en.tgz" ] +then + ./scripts/download-files.sh +fi + +mkdir model + +if [ ! -e "data/corpus.bpe.en" ] +then + ./scripts/preprocess.sh +fi + +if [ ! -e "model/model.npz" ] +then + +../../build/marian \ + --model model/model.npz \ + --devices 0 \ + --train-sets data/corpus.bpe.ro data/corpus.bpe.en \ + --vocabs model/vocab.ro.yml model/vocab.en.yml \ + --dim-vocabs 50000 50000 \ + --mini-batch 80 \ + --layer-normalization \ + --after-batches 90000 \ + --valid-freq 10000 --save-freq 30000 --disp-freq 1000 \ + --valid-sets data/newsdev2016.bpe.ro data/newsdev2016.bpe.en \ + --valid-metrics cross-entropy valid-script \ + --valid-script-path ./scripts/validate.sh \ + --log model/train.log --valid-log model/valid.log + +fi + |