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

test_word_weighting_with_eos.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: c3d7b936f98c7bc71cd8f5f7a48e3a389e46ed55 (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
#!/bin/bash

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

# Exit on error
set -e

# Test code goes here
rm -rf word_eos word_eos.{log,out,diff}
mkdir -p word_eos

# Generate word weights, each word has weight 2, including EOS
cat $MRT_DATA/europarl.de-en/toy.bpe.en | sed -r -e 's/[^ ]+/2/g' -e 's/$/ 2/' > word_eos.weights.txt

# Train
$MRT_MARIAN/marian \
    --seed 1111 --no-shuffle --dim-emb 128 --dim-rnn 256 --optimizer sgd --cost-type ce-mean \
    -m word_eos/model.npz -t $MRT_DATA/europarl.de-en/toy.bpe.{de,en} -v vocab.{de,en}.yml \
    --log word_eos.log --disp-freq 5 -e 2 \
    --data-weighting word_eos.weights.txt --data-weighting-type word

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

cat word_eos.log | $MRT_TOOLS/extract-disp.sh > word_eos.out
$MRT_TOOLS/diff-nums.py word_eos.out word_eos.expected -p 0.1 -o word_eos.diff


# Exit with success code
exit 0