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

test_restoring_validation_lower_is_better.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: 8802acf10d231f57d6e2539f7fea41756cf09db8 (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
#!/bin/bash -x

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

# Exit on error
set -e

# Test code goes here
rm -rf valid_lowisbet valid_lowisbet_?.log
mkdir -p valid_lowisbet

extra_opts="--no-shuffle --seed 1111 --maxi-batch 1 --maxi-batch-sort none"
extra_opts="$extra_opts --dim-emb 64 --dim-rnn 128 --mini-batch 32"
extra_opts="$extra_opts --cost-type ce-mean --disp-label-counts false --clip-norm 0"


# Files for the validation sets are swapped intentionally
$MRT_MARIAN/marian $extra_opts \
    -m valid_lowisbet/model.npz -t $MRT_DATA/train.max50.{en,de} -v vocab.en.yml vocab.de.yml \
    --disp-freq 10 --valid-freq 30 --after-batches 160 --early-stopping 2 \
    --valid-metrics cross-entropy --valid-sets $MRT_DATA/europarl.de-en/toy.bpe.{de,en} --valid-mini-batch 64 \
    --valid-log valid_lowisbet_1.log

test -e valid_lowisbet/model.npz
test -e valid_lowisbet/model.npz.yml
test -e valid_lowisbet_1.log

cp valid_lowisbet/model.npz.progress.yml valid_lowisbet/model.npz.progress.yml.bac
cat valid_lowisbet_1.log | $MRT_TOOLS/strip-timestamps.sh | grep "cross-entropy" > valid_lowisbet.out

# Files for the validation sets are swapped intentionally
$MRT_MARIAN/marian $extra_opts \
    -m valid_lowisbet/model.npz -t $MRT_DATA/train.max50.{en,de} -v vocab.en.yml vocab.de.yml \
    --disp-freq 10 --valid-freq 30 --after-batches 320 --early-stopping 4 \
    --valid-metrics cross-entropy --valid-sets $MRT_DATA/europarl.de-en/toy.bpe.{de,en} --valid-mini-batch 64 \
    --valid-log valid_lowisbet_2.log

test -e valid_lowisbet/model.npz
test -e valid_lowisbet_2.log

cat valid_lowisbet_2.log | $MRT_TOOLS/strip-timestamps.sh | grep "cross-entropy" >> valid_lowisbet.out
$MRT_TOOLS/diff-nums.py -p 0.1 valid_lowisbet.out valid_lowisbet.expected -o valid_lowisbet.diff

# Exit with success code
exit 0