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

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

#####################################################################
# SUMMARY: Train with --mini-batch-fit
# AUTHOR: snukky
# TAGS: batchfit
#####################################################################

# Exit on error
set -e

# Check if 'bc' is installed
type bc || exit 100

# Test code goes here
rm -rf batch_fit batch_fit.log
mkdir -p batch_fit

$MRT_MARIAN/marian \
    --no-shuffle --seed 1111 --dim-emb 128 --dim-rnn 256 \
    -m batch_fit/model.npz -t $MRT_DATA/europarl.de-en/corpus.bpe.{en,de} -v vocab.en.yml vocab.de.yml \
    --disp-freq 20 --after-batches 100 \
    --log batch_fit.log \
    --mini-batch-fit -w 3500

test -e batch_fit/model.npz
test -e batch_fit/model.npz.yml
test -e batch_fit/model.npz.amun.yml

test -e batch_fit.log

cat batch_fit.log | grep 'Ep\. 1 :' | sed -r 's/.*Up\. ([0-9]+) .*Sen. ([,0-9]+).*/\2\/\1/' | sed 's/,//g' | bc > batch_fit.out
$MRT_TOOLS/diff.sh batch_fit.out batch_fit.expected > batch_fit.diff

# Exit with success code
exit 0