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

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

# Exit on error
set -e

# Test code goes here
rm -rf adam_load adam_load_?.log
mkdir -p adam_load

extra_opts="--no-shuffle --seed 7777 --maxi-batch 1 --maxi-batch-sort none --mini-batch 2 --dim-rnn 64 --dim-emb 32"

$MRT_MARIAN/build/marian \
    -m adam_load/model.npz -t $MRT_DATA/train.max50.{en,de} -v vocab.en.yml vocab.de.yml \
    --disp-freq 1 --after-batches 3 -l 0.1 $extra_opts \
    --log adam_load_1.log

test -e adam_load/model.npz
test -e adam_load/model.npz.optimizer.npz
test -e adam_load_1.log

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

$MRT_MARIAN/build/marian \
    -m adam_load/model.npz -t $MRT_DATA/train.max50.{en,de} -v vocab.en.yml vocab.de.yml \
    --disp-freq 1 --after-batches 6 -l 0.1 $extra_opts \
    --log adam_load_2.log

test -e adam_load/model.npz
test -e adam_load/model.npz.optimizer.npz
test -e adam_load_2.log

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

# The allowed tolerance needs to be radiculously high as restarting the
# training is very instable on different GPU devices
$MRT_TOOLS/diff-floats.py -p 15.0 -n 1 adam_load.out adam_load.expected > adam_load.diff

# Exit with success code
exit 0