blob: 1242f40214cbc08cf804e4f4ce7c53a3acc0ed3a (
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 \
-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
|