-
Notifications
You must be signed in to change notification settings - Fork 3
/
train.sh
131 lines (90 loc) · 3.9 KB
/
train.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
set -e
#defining global hyperparameters
maxitersteps=200000
loginterval=100
saveinterval=2000
cuda="--cuda"
unsup="--unsup"
#defining paths
ts=`pwd`
tsdata=$ts/tsdata
codepath=$ts/undreamt
model=$ts/modeldir
#creating new directories
mkdir -p "$model"
mkdir -p "$tsdata"
echo "${ts}"
echo "${tsdata}"
#UNTS - Using both separator and discriminator
batchsize=36
lr=0.00012
hidden=600
dropout=0.2
loginterval=100
saveinterval=200
embeddcom="$tsdata/fk.lower.vec"
pref="wgan.unsup.noadvcompl.control1.allclass.denoi.singleclassf.rho1.0.10k"
MONO=( tsdata/fkdifficpart-2m tsdata/fkeasypart-2m )
PARALLLEL=( tsdata/wiki-split.en.lower tsdata/wiki-split.sen.lower )
python3 "$codepath/train.py" --src_embeddings "$embeddcom" --trg_embeddings "$embeddcom" --save "$model/model.$pref" \
--batch $batchsize $cuda --disable_backtranslation --unsup --enable_mgan --add_control --easyprefix "tsdata/fkeasypart-2m" \
--difficprefix "tsdata/fkdifficpart-2m" --start_save 9000 --stop_save 13000
exit
#UNTS-10k - Using both separator and discriminator with 10k parallel pairs
batchsize=36
lr=0.00012
hidden=600
dropout=0.2
loginterval=100
saveinterval=200
embeddcom="$tsdata/fk.lower.vec"
pref="wgan.semisup10k-sel-6-4.noadvcompl.control1.allclass.denoi.singleclassf.rho1.0.10k"
MONO=( tsdata/fkdifficpart-2m tsdata/fkeasypart-2m )
PARALLLEL=( tsdata/wiki-split.en.lower tsdata/wiki-split.sen.lower )
python3 "$codepath/train.py" --src_embeddings "$embeddcom" --trg_embeddings "$embeddcom" --save "$model/model.$pref" $cuda\
--src2trg "${PARALLLEL[0]}" "${PARALLLEL[1]}" --trg2src "${PARALLLEL[1]}" "${PARALLLEL[0]}" --disable_backtranslation \
--enable_mgan --add_control --easyprefix "tsdata/fkeasypart-2m" --difficprefix "tsdata/fkdifficpart-2m" --start_save 6000 --stop_save 13000
exit
# UNTS-10k - only with discriminator loss with 10k parallel pairs
batchsize=36
lr=0.00012
hidden=600
dropout=0.2
loginterval=100
saveinterval=200
embeddcom="$tsdata/fk.lower.vec"
pref="wgan.semisup10k-sel-6-4.noadvcompl.control1.noclassf.denoi.singleclassf.rho1.0.10k"
MONO=( tsdata/fkdifficpart-2m tsdata/fkeasypart-2m )
PARALLLEL=( tsdata/wiki-split.en.lower tsdata/wiki-split.sen.lower )
python3 "$codepath/train.py" --src_embeddings "$embeddcom" --trg_embeddings "$embeddcom" --save "$model/model.$pref" --batch $batchsize $cuda \
--src2trg "${PARALLLEL[0]}" "${PARALLLEL[1]}" --trg2src "${PARALLLEL[1]}" "${PARALLLEL[0]}" --disable_backtranslation --enable_mgan --add_control \
--easyprefix "tsdata/fkeasypart-2m" --difficprefix "tsdata/fkdifficpart-2m" --noclassf --start_save 8000 --stop_save 13000
exit
# UNTS-10k - only with separator loss with 10k parallel pairs
batchsize=36
lr=0.00012
hidden=600
dropout=0.2
loginterval=100
saveinterval=200
embeddcom="$tsdata/fk.lower.vec"
pref="wgan.semisup10k-sel-6-4.noadvcompl.control1.nodisc.denoi.singleclassf.rho1.0.10k"
MONO=( tsdata/fkdifficpart-2m tsdata/fkeasypart-2m )
PARALLLEL=( tsdata/wiki-split.en.lower tsdata/wiki-split.sen.lower )
python3 "$codepath/train.py" --src_embeddings "$embeddcom" --trg_embeddings "$embeddcom" --save "$model/model.$pref" \
--batch $batchsize $cuda --src2trg "${PARALLLEL[0]}" "${PARALLLEL[1]}" --trg2src "${PARALLLEL[1]}" "${PARALLLEL[0]}" \
--disable_backtranslation --enable_mgan --add_control --easyprefix "tsdata/fkeasypart-2m" --difficprefix "tsdata/fkdifficpart-2m" --nodisc --start_save 6000 --stop_save 13000
exit
# UNMT using backtranslation and denoising - Artetxe et al 2018.
batchsize=32
lr=0.00012
hidden=600
dropout=0.2
loginterval=100
saveinterval=200
embeddcom="tsdata/fk.lower.vec"
pref="wgan.onlyback.denoi.back1.singleclassf.rho1.0.10k"
MONO=( tsdata/fkdifficpart-2m-1.lower tsdata/fkeasypart-2m-1.lower )
python3 "$codepath/train.py" --src "${MONO[0]}" --trg "${MONO[1]}" --src_embeddings "$embeddcom" --trg_embeddings "$embeddcom" --save "$model/model.$pref" \
--batch $batchsize $cuda --unsup --start_save 18000 --stop_save 24000
exit