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

test_tsv_train_with_weights_pos0.sh « input-tsv « interface « tests - github.com/marian-nmt/marian-regression-tests.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ee4522f7a638d66dba82c0c4a4bf93b02ac54baf (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
#!/bin/bash -x

#####################################################################
# SUMMARY: Train a model on TSV data with sentence weighting
# TAGS: sentencepiece tsv train dataweights
#####################################################################

# Exit on error
set -e

# Remove old artifacts and create working directory
rm -rf train_weights0 train_weights0.{log,out,diff}
mkdir -p train_weights0

# Run marian command
$MRT_MARIAN/marian \
    --cost-type ce-mean --no-shuffle --seed 5555 --dim-emb 32 --dim-rnn 64 --maxi-batch 1 --maxi-batch-sort none --optimizer sgd --learn-rate 0.1 \
    -m train_weights0/model.npz --tsv -t train2.w-de-en.tsv -v $MRT_MODELS/rnn-spm/vocab.deen.{spm,spm} \
    --after-batches 100 --disp-freq 4 \
    --data-weighting 0 --data-weighting-type sentence \
    --log train_weights0.log


# Check if files exist
test -e train_weights0/model.npz
test -e train_weights0.log
grep -qi "weights from" train_weights0.log

# Compare the current output with the expected output
cat train_weights0.log | $MRT_TOOLS/extract-costs.sh > train_weights0.out
$MRT_TOOLS/diff-nums.py train_weights0.out train_weights.expected -p 0.01 -o train_weights0.diff

# Exit with success code
exit 0