This repository has been archived by the owner on Aug 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 191
/
Copy pathtrain_iwslt14.sh
62 lines (61 loc) · 1.75 KB
/
train_iwslt14.sh
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
NCCL_ROOT_DIR="$(pwd)/nccl_2.1.15-1+cuda8.0_x86_64"
export NCCL_ROOT_DIR
LD_LIBRARY_PATH="${NCCL_ROOT_DIR}/lib:${LD_LIBRARY_PATH}"
export LD_LIBRARY_PATH
wget https://download.pytorch.org/models/translate/iwslt14/data.tar.gz
tar -xvzf data.tar.gz
rm -rf checkpoints data.tar.gz && mkdir -p checkpoints
CUDA_VISIBLE_DEVICES=0 python3 pytorch_translate/train.py \
"" \
--arch rnn \
--log-verbose \
--lr-scheduler fixed \
--force-anneal 200 \
--cell-type lstm \
--sequence-lstm \
--reverse-source \
--encoder-bidirectional \
--max-epoch 100 \
--stop-time-hr 72 \
--stop-no-best-bleu-eval 5 \
--optimizer sgd \
--lr 0.5 \
--lr-shrink 0.95 \
--clip-norm 5.0 \
--encoder-dropout-in 0.1 \
--encoder-dropout-out 0.1 \
--decoder-dropout-in 0.2 \
--decoder-dropout-out 0.2 \
--criterion label_smoothed_cross_entropy \
--label-smoothing 0.1 \
--batch-size 256 \
--length-penalty 0 \
--unk-reward -0.5 \
--word-reward 0.25 \
--max-tokens 9999999 \
--encoder-layers 2 \
--encoder-embed-dim 256 \
--encoder-hidden-dim 512 \
--decoder-layers 2 \
--decoder-embed-dim 256 \
--decoder-hidden-dim 512 \
--decoder-out-embed-dim 256 \
--save-dir checkpoints \
--attention-type dot \
--sentence-avg \
--momentum 0 \
--num-avg-checkpoints 10 \
--beam 6 \
--no-beamable-mm \
--source-lang de \
--target-lang en \
--train-source-text-file data/train.tok.bpe.de \
--train-target-text-file data/train.tok.bpe.en \
--eval-source-text-file data/valid.tok.bpe.de \
--eval-target-text-file data/valid.tok.bpe.en \
--source-max-vocab-size 14000 \
--target-max-vocab-size 14000 \
--log-interval 10 \
--seed "${RANDOM}" \
2>&1 | tee -a checkpoints/log