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

test_length_mismatch_warnings.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: 0253e6e7c3690a075395b509acb53568a28e4b74 (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
#!/bin/bash

# Exit on error
set -e

# Test code goes here
rm -rf warn warn.log warn.weights.txt
mkdir -p warn


cat $MRT_DATA/europarl.de-en/toy.bpe.en | sed -r 's/[^ ]+/1/g' > warn.weights.txt
sed -i '2s/1 1 /1 /g' warn.weights.txt
sed -i '3s/1 /1 1 /g' warn.weights.txt

$MRT_MARIAN/marian \
    --seed 1111 --dim-emb 64 --dim-rnn 128 --optimizer sgd -e 1 \
    -m warn/model.npz -t $MRT_DATA/europarl.de-en/toy.bpe.{de,en} -v vocab.{de,en}.yml \
    --data-weighting warn.weights.txt --data-weighting-type word \
    > warn.log 2>&1 || true

test -e warn.log
grep -qi "[warn].*number of weights.* does not match.* words.* line #1" warn.log
grep -qi "[warn].*number of weights.* does not match.* words.* line #2" warn.log


# Exit with success code
exit 0