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

test_sgd_for_two_epochs.sh « restarting « training « tests - github.com/marian-nmt/marian-regression-tests.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6fb400ed013d40436fc193135f152ffe424b7b1e (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
#!/bin/bash -x

# Exit on error
set -e

# Test code goes here
rm -rf sgd_2e sgd_1st_epoch.log sgd_2nd_epoch.log
mkdir -p sgd_2e

extra_opts="--no-shuffle --seed 1111 --maxi-batch 1 --maxi-batch-sort none --mini-batch 32 -o sgd"

#$MRT_MARIAN/build/marian \
    #-m sgd_2e/model_2e.npz -t train.max50.{en,de} -v vocab.{en,de}.yml \
    #--disp-freq 4 --save-freq 32 --after-epoch 2 -l 0.1 $extra_opts \
    #--log sgd_two_epochs.log

#test -e sgd_2e/model_2e.npz
#test -e sgd_two_epochs.log

$MRT_MARIAN/build/marian \
    -m sgd_2e/model.npz -t $MRT_DATA/train.max50.{en,de} -v vocab.en.yml vocab.de.yml \
    --disp-freq 4 --save-freq 32 --after-epochs 1 -l 0.1 $extra_opts \
    --log sgd_1st_epoch.log

test -e sgd_2e/model.npz
test -e sgd_1st_epoch.log

cat sgd_1st_epoch.log | $MRT_TOOLS/strip-timestamps.sh | grep "Ep\. " | sed 's/ : Time.*//' > sgd_1st_epoch.out
cp sgd_2e/model.npz.yml sgd_2e/model.npz.1st_epoch.yml

$MRT_MARIAN/build/marian \
    -m sgd_2e/model.npz -t $MRT_DATA/train.max50.{en,de} -v vocab.en.yml vocab.de.yml \
    --disp-freq 4 --save-freq 32 --after-epochs 2 -l 0.1 $extra_opts \
    --log sgd_2nd_epoch.log

test -e sgd_2e/model.npz
test -e sgd_2nd_epoch.log

cat sgd_2nd_epoch.log | $MRT_TOOLS/strip-timestamps.sh | grep "Ep\. " | sed 's/ : Time.*//' > sgd_2nd_epoch.out
cat sgd_1st_epoch.out sgd_2nd_epoch.out > sgd_2e.out

$MRT_TOOLS/diff-floats.py sgd_2e.out sgd_2e.expected -p 0.3 > sgd_2e.diff

# Exit with success code
exit 0