# KFTT (English-Japanese)
mkdir experiments/models/kftt/

# preprocessing (lowercasing)
/home/vhoang2/tools/mosesdecoder-RELEASE-3.0/scripts/tokenizer/lowercase.perl < /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.en > /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.en 
/home/vhoang2/tools/mosesdecoder-RELEASE-3.0/scripts/tokenizer/lowercase.perl < /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.ja > /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.ja 

/home/vhoang2/tools/mosesdecoder-RELEASE-3.0/scripts/tokenizer/lowercase.perl < /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-dev-tune.en > /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-dev-tune.lo.en 
/home/vhoang2/tools/mosesdecoder-RELEASE-3.0/scripts/tokenizer/lowercase.perl < /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-dev-tune.ja > /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-dev-tune.lo.ja 

/home/vhoang2/tools/mosesdecoder-RELEASE-3.0/scripts/tokenizer/lowercase.perl < /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-test.en > /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-test.lo.en 
/home/vhoang2/tools/mosesdecoder-RELEASE-3.0/scripts/tokenizer/lowercase.perl < /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-test.ja > /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-test.lo.ja 

python ~/works/transformer-dynet/scripts/wrap-data.py ja en kyoto-train.cln.lo kyoto-dev-tune.lo kyoto-test.lo 3 3
python ~/works/transformer-dynet/scripts/wrap-data.py en ja kyoto-train.cln.lo kyoto-dev-tune.lo kyoto-test.lo 3 3

# BPE-ing
# 32k operations
cat /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.en /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.ja | /home/vhoang2/tools/subword-nmt/learn_bpe.py -s 25000 > /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.jbpe32k_learned #joint subword splitting
/home/vhoang2/tools/subword-nmt/apply_bpe.py -c /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.jbpe32k_learned < /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.en > /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.jbpe32k.en #train
/home/vhoang2/tools/subword-nmt/apply_bpe.py -c /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.jbpe32k_learned < /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.ja > /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.jbpe32k.ja #train
/home/vhoang2/tools/subword-nmt/apply_bpe.py -c /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.jbpe32k_learned < /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-dev-tune.lo.en > /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-dev-tune.lo.jbpe32k.en #dev
/home/vhoang2/tools/subword-nmt/apply_bpe.py -c /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.jbpe32k_learned < /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-dev-tune.lo.ja > /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-dev-tune.lo.jbpe32k.ja #dev
/home/vhoang2/tools/subword-nmt/apply_bpe.py -c /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.jbpe32k_learned < /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-test.lo.en > /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-test.lo.jbpe32k.en #test
/home/vhoang2/tools/subword-nmt/apply_bpe.py -c /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.jbpe32k_learned < /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-test.lo.ja > /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-test.lo.jbpe32k.ja #test

python ~/works/transformer-dynet/scripts/wrap-data.py ja en kyoto-train.cln.lo.jbpe32k kyoto-dev-tune.lo.jbpe32k kyoto-test.lo.jbpe32k 1 1
python ~/works/transformer-dynet/scripts/wrap-data.py en ja kyoto-train.cln.lo.jbpe32k kyoto-dev-tune.lo.jbpe32k kyoto-test.lo.jbpe32k 1 1

# 32K
cat /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.en /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.ja | /home/vhoang2/tools/subword-nmt/learn_bpe.py -s 32000 > /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.jbpe32K_learned #joint subword splitting
/home/vhoang2/tools/subword-nmt/apply_bpe.py -c /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.jbpe32K_learned < /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.en > /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.jbpe32K.en #train
/home/vhoang2/tools/subword-nmt/apply_bpe.py -c /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.jbpe32K_learned < /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.ja > /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.jbpe32K.ja #train
/home/vhoang2/tools/subword-nmt/apply_bpe.py -c /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.jbpe32K_learned < /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-dev-tune.lo.en > /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-dev-tune.lo.jbpe32K.en #dev
/home/vhoang2/tools/subword-nmt/apply_bpe.py -c /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.jbpe32K_learned < /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-dev-tune.lo.ja > /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-dev-tune.lo.jbpe32K.ja #dev
/home/vhoang2/tools/subword-nmt/apply_bpe.py -c /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.jbpe32K_learned < /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-test.lo.en > /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-test.lo.jbpe32K.en #test
/home/vhoang2/tools/subword-nmt/apply_bpe.py -c /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.jbpe32K_learned < /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-test.lo.ja > /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-test.lo.jbpe32K.ja #test

python ~/works/transformer-dynet/scripts/wrap-data.py ja en kyoto-train.cln.lo.jbpe32K kyoto-dev-tune.lo.jbpe32K kyoto-test.lo.jbpe32K 1 1
python ~/works/transformer-dynet/scripts/wrap-data.py en ja kyoto-train.cln.lo.jbpe32K kyoto-dev-tune.lo.jbpe32K kyoto-test.lo.jbpe32K 1 1

# 64K
cat /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.en /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.ja | /home/vhoang2/tools/subword-nmt/learn_bpe.py -s 64000 > /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.jbpe64K_learned #joint subword splitting
/home/vhoang2/tools/subword-nmt/apply_bpe.py -c /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.jbpe64K_learned < /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.en > /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.jbpe64K.en #train
/home/vhoang2/tools/subword-nmt/apply_bpe.py -c /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.jbpe64K_learned < /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.ja > /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.jbpe64K.ja #train
/home/vhoang2/tools/subword-nmt/apply_bpe.py -c /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.jbpe64K_learned < /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-dev-tune.lo.en > /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-dev-tune.lo.jbpe64K.en #dev
/home/vhoang2/tools/subword-nmt/apply_bpe.py -c /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.jbpe64K_learned < /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-dev-tune.lo.ja > /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-dev-tune.lo.jbpe64K.ja #dev
/home/vhoang2/tools/subword-nmt/apply_bpe.py -c /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.jbpe64K_learned < /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-test.lo.en > /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-test.lo.jbpe64K.en #test
/home/vhoang2/tools/subword-nmt/apply_bpe.py -c /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.jbpe64K_learned < /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-test.lo.ja > /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-test.lo.jbpe64K.ja #test

python ~/works/transformer-dynet/scripts/wrap-data.py ja en kyoto-train.cln.lo.jbpe64K kyoto-dev-tune.lo.jbpe64K kyoto-test.lo.jbpe64K 1 1
python ~/works/transformer-dynet/scripts/wrap-data.py en ja kyoto-train.cln.lo.jbpe64K kyoto-dev-tune.lo.jbpe64K kyoto-test.lo.jbpe64K 1 1

# *** small networks
# train
mkdir experiments/models/kftt/small
nice ./build_gpu/transformer-train --dynet-devices GPU:0 --max-seq-len 50 --minibatch-size 1024 --treport 512 --dreport 50000 -t /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.en-ja.capped -d /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-dev-tune.lo.en-ja.capped -p experiments/models/kftt/small -e 100 --lr-eta 0.1 --lr-patience 10 --patience 20 --lr-eta-decay 2 --encoder-emb-dropout-p 0.1 --encoder-sublayer-dropout-p 0.1 --decoder-emb-dropout-p 0.1 --decoder-sublayer-dropout-p 0.1 --attention-dropout-p 0.0 --ff-dropout-p 0.1 --ff-activation-type 1 --nlayers 2 --num-units 128 --num-heads 2 --use-label-smoothing --label-smoothing-weight 0.1 --position-encoding 2 &>experiments/models/kftt/small/log.en-ja.transformer.h2_l2_u128_do010101010001_att1_ls01_pe2_ml50_ffrelu &
# decode
# test
./build_gpu/transformer-decode --dynet-mem 5000 --dynet-devices GPU:0 --beam 5 -p experiments/models/kftt/small -T /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-test.lo.en.capped | sed 's/ <\/s>//g' | sed 's/<s> //g' > experiments/models/kftt/small/translation-beam5.test.en-ja.transformer.h2_l2_u128_do010101010001_att1_ls01_pe2_ml50_ffrelu
/home/vhoang2/tools/mosesdecoder-RELEASE-3.0/scripts/generic/multi-bleu.perl /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-test.lo.ja < experiments/models/kftt/small/translation-beam5.test.en-ja.transformer.h2_l2_u128_do010101010001_att1_ls01_pe2_ml50_ffrelu &>experiments/models/kftt/small/translation-beam5.test.en-ja.transformer.h2_l2_u128_do010101010001_att1_ls01_pe2_ml50_ffrelu.score-BLEU

# *** medium networks
# train
mkdir experiments/models/kftt/medium
nice ./build_gpu/transformer-train --dynet-devices GPU:2 --max-seq-len 50 --minibatch-size 1024 --treport 512 --dreport 50000 -t /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.en-ja.capped -d /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-dev-tune.lo.en-ja.capped -p experiments/models/kftt/medium -e 100 --lr-eta 0.1 --lr-patience 10 --patience 20 --lr-eta-decay 2 --encoder-emb-dropout-p 0.1 --encoder-sublayer-dropout-p 0.1 --decoder-emb-dropout-p 0.1 --decoder-sublayer-dropout-p 0.1 --attention-dropout-p 0.0 --ff-dropout-p 0.1 --ff-activation-type 1 --nlayers 4 --num-units 512 --num-heads 4 --use-label-smoothing --label-smoothing-weight 0.1 --position-encoding 2 &>experiments/models/kftt/medium/log.en-ja.transformer.h4_l4_u512_do010101010001_att1_ls01_pe2_ml50_ffrelu &
# decode
# test
./build_gpu/transformer-decode --dynet-mem 5000 --dynet-devices GPU:1 --beam 5 -p experiments/models/kftt/medium -T /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-test.lo.en.capped | sed 's/ <\/s>//g' | sed 's/<s> //g' > experiments/models/kftt/medium/translation-beam5.test.en-ja.transformer.h4_l4_u512_do010101010001_att1_ls01_pe2_ml50_ffrelu
/home/vhoang2/tools/mosesdecoder-RELEASE-3.0/scripts/generic/multi-bleu.perl /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-test.lo.ja < experiments/models/kftt/medium/translation-beam5.test.en-ja.transformer.h4_l4_u512_do010101010001_att1_ls01_pe2_ml50_ffrelu &>experiments/models/kftt/medium/translation-beam5.test.en-ja.transformer.h4_l4_u512_do010101010001_att1_ls01_pe2_ml50_ffrelu.score-BLEU

# *** medium networks (with byte-pair encoding, 32K operations)
# train
mkdir experiments/models/kftt/medium_jbpe_32k
nice ./build_gpu/transformer-train --dynet-devices GPU:0 --max-seq-len 80 --minibatch-size 1024 --treport 512 --dreport 50000 -t /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.jbpe32K.en-ja.capped -d /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-dev-tune.lo.jbpe32K.en-ja.capped -p experiments/models/kftt/medium_jbpe_32k -e 100 --lr-eta 0.1 --lr-patience 10 --patience 20 --lr-eta-decay 2 --encoder-emb-dropout-p 0.1 --encoder-sublayer-dropout-p 0.1 --decoder-emb-dropout-p 0.1 --decoder-sublayer-dropout-p 0.1 --attention-dropout-p 0.0 --ff-dropout-p 0.1 --ff-activation-type 1 --nlayers 4 --num-units 512 --num-heads 4 --use-label-smoothing --label-smoothing-weight 0.1 --position-encoding 2 &>experiments/models/kftt/medium_jbpe_32k/log.en-ja.transformer.h4_l4_u512_do010101010001_att1_ls01_pe2_ml50_ffrelu_jbpe32K &
# decode
# test
./build_gpu/transformer-decode --dynet-mem 5000 --dynet-devices GPU:0 --beam 5 -p experiments/models/kftt/medium_jbpe_32k -T /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-test.lo.jbpe32K.en.capped | sed 's/@@ //g' | sed 's/ <\/s>//g' | sed 's/<s> //g' > experiments/models/kftt/medium_jbpe_32k/translation-beam5.test.en-ja.transformer.h4_l4_u512_do010101010001_att1_ls01_pe2_ml50_ffrelu_jbpe32K
/home/vhoang2/tools/mosesdecoder-RELEASE-3.0/scripts/generic/multi-bleu.perl /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-test.lo.ja < experiments/models/kftt/medium_jbpe_32k/translation-beam5.test.en-ja.transformer.h4_l4_u512_do010101010001_att1_ls01_pe2_ml50_ffrelu_jbpe32K &>experiments/models/kftt/medium_jbpe_32k/translation-beam5.test.en-ja.transformer.h4_l4_u512_do010101010001_att1_ls01_pe2_ml50_ffrelu_jbpe32K.score-BLEU

# *** medium networks (with byte-pair encoding, 32K operations) (run2)
# train
mkdir experiments/models/kftt/medium_jbpe_32k_run2
nice ./build_gpu/transformer-train --dynet-devices GPU:0 --max-seq-len 80 --minibatch-size 1024 --treport 512 --dreport 50000 -t /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-train.cln.lo.jbpe32K.en-ja.capped -d /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-dev-tune.lo.jbpe32K.en-ja.capped -p experiments/models/kftt/medium_jbpe_32k_run2 -e 100 --lr-eta 0.1 --lr-patience 10 --patience 20 --lr-eta-decay 2 --encoder-emb-dropout-p 0.1 --encoder-sublayer-dropout-p 0.1 --decoder-emb-dropout-p 0.1 --decoder-sublayer-dropout-p 0.1 --attention-dropout-p 0.0 --ff-dropout-p 0.1 --ff-activation-type 1 --nlayers 4 --num-units 512 --num-heads 4 --use-label-smoothing --label-smoothing-weight 0.1 --position-encoding 2 &>experiments/models/kftt/medium_jbpe_32k_run2/log.en-ja.transformer.h4_l4_u512_do010101010001_att1_ls01_pe2_ml50_ffrelu_jbpe32K &
# decode
# test
./build_gpu/transformer-decode --dynet-mem 5000 --dynet-devices GPU:0 --beam 5 -p experiments/models/kftt/medium_jbpe_32k -T /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-test.lo.jbpe32K.en.capped | sed 's/@@ //g' | sed 's/ <\/s>//g' | sed 's/<s> //g' > experiments/models/kftt/medium_jbpe_32k_run2/translation-beam5.test.en-ja.transformer.h4_l4_u512_do010101010001_att1_ls01_pe2_ml50_ffrelu_jbpe32K
/home/vhoang2/tools/mosesdecoder-RELEASE-3.0/scripts/generic/multi-bleu.perl /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-test.lo.ja < experiments/models/kftt/medium_jbpe_32k_run2/translation-beam5.test.en-ja.transformer.h4_l4_u512_do010101010001_att1_ls01_pe2_ml50_ffrelu_jbpe32K &>experiments/models/kftt/medium_jbpe_32k_run2/translation-beam5.test.en-ja.transformer.h4_l4_u512_do010101010001_att1_ls01_pe2_ml50_ffrelu_jbpe32K.score-BLEU

# ensemble decoding
# test
mkdir experiments/models/kftt/ensemble_medium_jbpe_32k_2runs
cp experiments/models/kftt/medium_jbpe_32k/*.vocab experiments/models/kftt/ensemble_medium_jbpe_32k_2runs
cat experiments/models/kftt/medium_jbpe_32k/model.config experiments/models/kftt/medium_jbpe_32k_run2/model.config > experiments/models/kftt/ensemble_medium_jbpe_32k_2runs/model.config
./build_gpu/transformer-decode --dynet-mem 12000 --dynet-devices GPU:0  --beam 5 -p experiments/models/kftt/ensemble_medium_jbpe_32k_2runs -T /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-test.lo.jbpe32K.en.capped | sed 's/@@ //g' | sed 's/ <\/s>//g' | sed 's/<s> //g' > experiments/models/kftt/ensemble_medium_jbpe_32k_2runs/translation-beam5.test.en-ja.transformer.h4_l4_u512_do010101010001_att1_ls01_pe2_ml50_ffrelu_jbpe32K_ensemble2runs
/home/vhoang2/tools/mosesdecoder-RELEASE-3.0/scripts/generic/multi-bleu.perl /home/vhoang2/works/transformer-dynet/experiments/data/kftt/kftt-data-1.0/data/tok/kyoto-test.lo.ja < experiments/models/kftt/ensemble_medium_jbpe_32k_2runs/translation-beam5.test.en-ja.transformer.h4_l4_u512_do010101010001_att1_ls01_pe2_ml50_ffrelu_jbpe32K_ensemble2runs &>experiments/models/kftt/ensemble_medium_jbpe_32k_2runs/translation-beam5.test.en-ja.transformer.h4_l4_u512_do010101010001_att1_ls01_pe2_ml50_ffrelu_jbpe32K_ensemble2runs.score-BLEU

