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

test_restoring_newbest_validators.sh « validation « restoring « training « tests - github.com/marian-nmt/marian-regression-tests.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: bfbff83aec232c4055e9fd6e6ec62f8d59207d3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash -x

#####################################################################
# TAGS: valid valid-restart
#####################################################################

# Exit on error
set -e

# Test code goes here
rm -rf valid_newbest valid_newbest_*.log valid_script_?.temp
mkdir -p valid_newbest

head -n 8 $MRT_DATA/europarl.de-en/toy.bpe.en > valid.mini.bpe.en
head -n 8 $MRT_DATA/europarl.de-en/toy.bpe.de > valid.mini.bpe.de


# Uncomment to re-generate the expected output

#$MRT_MARIAN/marian \
    #--type s2s --no-shuffle --seed 2222 --maxi-batch 1 --maxi-batch-sort none --quiet-translation --clip-norm 0 \
    #--dim-emb 64 --dim-rnn 128 --mini-batch 16 --optimizer sgd --cost-type ce-mean \
    #-m valid_newbest/model.npz -t $MRT_DATA/europarl.de-en/toy.bpe.{en,de} -v vocab.en.yml vocab.de.yml \
    #--disp-freq 5 --valid-freq 10 --after-batches 100 \
    #--valid-metrics cross-entropy translation --valid-script-path ./count_bytes.sh \
    #--valid-sets valid.mini.bpe.{de,en} \
    #--overwrite --keep-best \
    #--log valid_newbest_full.log

#cat valid_newbest_full.log | $MRT_TOOLS/strip-timestamps.sh | grep -P "\[valid\]" > valid_newbest.expected
#exit 1


$MRT_MARIAN/marian \
    --type s2s --no-shuffle --seed 2222 --maxi-batch 1 --maxi-batch-sort none --quiet-translation --clip-norm 0 \
    --dim-emb 64 --dim-rnn 128 --mini-batch 16 --optimizer sgd --cost-type ce-mean \
    -m valid_newbest/model.npz -t $MRT_DATA/europarl.de-en/toy.bpe.{en,de} -v vocab.en.yml vocab.de.yml \
    --disp-freq 5 --valid-freq 10 --after-batches 50 \
    --valid-metrics cross-entropy translation --valid-script-path ./count_bytes.sh \
    --valid-sets valid.mini.bpe.{de,en} \
    --keep-best \
    --log valid_newbest_1.log

test -e valid_newbest/model.npz
test -e valid_newbest/model.npz.yml
test -e valid_newbest_1.log

cp valid_newbest/model.npz.progress.yml valid_newbest/model.npz.progress.yml.bac
cat valid_newbest_1.log | $MRT_TOOLS/strip-timestamps.sh | grep -P "\[valid\]" > valid_newbest.out


$MRT_MARIAN/marian \
    -m valid_newbest/model.npz -t $MRT_DATA/europarl.de-en/toy.bpe.{en,de} -v vocab.en.yml vocab.de.yml \
    --after-batches 100 --log valid_newbest_2.log

test -e valid_newbest/model.npz
test -e valid_newbest_2.log

cat valid_newbest_2.log | $MRT_TOOLS/strip-timestamps.sh | grep -P "\[valid\]" >> valid_newbest.out
$MRT_TOOLS/diff.sh valid_newbest.out valid_newbest.expected > valid_newbest.diff

# Exit with success code
exit 0