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

test_sentence_weights_x3.sh « data-weighting « training « tests - github.com/marian-nmt/marian-regression-tests.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 893e5ab15ae564120173a0d1a4a214174044c8bd (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

# Exit on error
set -e

# Test code goes here
rm -rf x3copied* x3weights*
mkdir -p x3copied x3weights

test -e vocab.de.yml || $MRT_MARIAN/build/marian-vocab < $MRT_DATA/europarl.de-en/corpus.bpe.de > vocab.de.yml
test -e vocab.en.yml || $MRT_MARIAN/build/marian-vocab < $MRT_DATA/europarl.de-en/corpus.bpe.en > vocab.en.yml

$MRT_MARIAN/build/marian \
    --seed 2222 --no-shuffle --maxi-batch 1 --maxi-batch-sort none --max-length 100 --dim-emb 128 --dim-rnn 256 -o sgd \
    -m x3copied/model.npz -t train.x3.{de,en} -v vocab.{de,en}.yml \
    --log x3copied.log --disp-freq 1 --after-batches 100 --mini-batch 4 --cost-type ce-sum

test -e x3copied/model.npz
test -e x3copied.log
cat x3copied.log | grep 'Cost ' | sed -r 's/.*Cost (.*) : Time.*/\1/' > x3copied.out

$MRT_MARIAN/build/marian \
    --seed 2222 --no-shuffle --maxi-batch 1 --maxi-batch-sort none --max-length 100 --dim-emb 128 --dim-rnn 256 -o sgd \
    -m x3weights/model.npz -t train.1k.{de,en} -v vocab.{de,en}.yml \
    --log x3weights.log --disp-freq 1 --after-batches 100 --mini-batch 2 --cost-type ce-sum \
    --data-weighting train.1k.weights.txt --data-weighting-type sentence

test -e x3weights/model.npz
test -e x3weights.log

cat x3weights.log | grep 'Cost ' | sed -r 's/.*Cost (.*) : Time.*/\1/' > x3weights.out

$MRT_TOOLS/diff-floats.py x3copied.out x3weights.out -p 0.1 > x3weights.diff

# Exit with success code
exit 0