-
Notifications
You must be signed in to change notification settings - Fork 1
/
train-toy-gpu-multi.sh
executable file
·38 lines (34 loc) · 1.06 KB
/
train-toy-gpu-multi.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
echo "Training the model..."
if test "$#" -ne 3; then
echo "Illegal number of parameters"
echo "sh train.sh <slang> <tlang> <ngpus>"
exit 0
fi
# Creating the working folder
mkdir -p models
mkdir -p models/multi30k-$1-$2/
# Training
#rm -rf models/multi30k-$1-$2/baseline #remove the existing one if required!
if [ -z ${SOCKEYE+x} ]; then
echo "No tokenizer is initialized. Source ENV.sh first";
fi
CUDA_VISIBLE_DEVICES=`/home/gkumar/scripts/free-gpu -n $3` PYTHONPATH=$SOCKEYE python3 $SOCKEYE/sockeye/train.py \
--source data/multi30k/train-toy.$1.atok \
--target data/multi30k/train-toy.$2.atok \
--validation-source data/multi30k/val.$1.atok \
--validation-target data/multi30k/val.$2.atok \
--word-min-count 2 \
--rnn-num-layers 1 \
--rnn-cell-type gru \
--rnn-num-hidden 64 \
--num-embed-source 64 \
--num-embed-target 64 \
--attention-type mlp \
--attention-num-hidden 64 \
--batch-size 64 \
--normalize-loss \
--dropout 0.1 \
--optimizer adam \
--initial-learning-rate 0.001 \
--output models/multi30k-$1-$2/multigpu \
--device-ids -$3