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

test_sentence_weighting_with_ones.sh « data-weighting « features « training « tests - github.com/marian-nmt/marian-regression-tests.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 58b243abc56822a53a481a0eae4c237513d6f122 (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
#!/bin/bash

#####################################################################
# SUMMARY:
# TAGS: dataweights
#####################################################################

# Exit on error
set -e

# Test code goes here
rm -rf noweights* ones*
mkdir -p noweights ones

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

$MRT_MARIAN/marian \
    --seed 2222 --no-shuffle --dim-emb 128 --dim-rnn 256 --optimizer sgd \
    -m noweights/model.npz -t $MRT_DATA/europarl.de-en/toy.bpe.{de,en} -v vocab.{de,en}.yml \
    --log noweights.log --disp-freq 5 -e 2

test -e noweights/model.npz
test -e noweights.log
cat noweights.log | $MRT_TOOLS/strip-timestamps.sh | grep "Ep\. " | sed -r 's/ Time.*//' > noweights.out

cat $MRT_DATA/europarl.de-en/toy.bpe.en | sed -r 's/.*/1/g' > ones.weights.txt

$MRT_MARIAN/marian \
    --seed 2222 --no-shuffle --dim-emb 128 --dim-rnn 256 --optimizer sgd \
    -m ones/model.npz -t $MRT_DATA/europarl.de-en/toy.bpe.{de,en} -v vocab.{de,en}.yml \
    --log ones.log --disp-freq 5 -e 2 \
    --data-weighting ones.weights.txt

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

cat ones.log | $MRT_TOOLS/strip-timestamps.sh | grep "Ep\. " | sed -r 's/ Time.*//' > ones.out
$MRT_TOOLS/diff-nums.py noweights.out ones.out -p 0.1 -o ones.diff

# Exit with success code
exit 0