forked from tensorflow/nmt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrain_jnmt_no_mono.sh
executable file
·44 lines (37 loc) · 1.05 KB
/
train_jnmt_no_mono.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
#!/bin/bash
SRC=$1
TGT=$2
CONFIG=$3
TIMESTAMP=`date +%s`
OUTPUT_DIR="../experiments/jnmt_${CONFIG}_${SRC}-${TGT}_${TIMESTAMP}"
mkdir -p ${OUTPUT_DIR}
HPARAMS="./nmt/standard_hparams/jnmt/${CONFIG}.json"
if [ ! -e ${HPARAMS} ]
then
echo "${HPARAMS} not found."
exit 1
fi
if [[ $CONFIG == c* ]]
then
echo "Continuous model, using pre-trained word embeddings."
EMBED="../data/${SRC}-${TGT}/word_vectors"
else
echo "Discrete model, not using pre-trained word embeddings."
EMBED="None"
fi
python -m nmt.nmt \
--src=${SRC} \
--tgt=${TGT} \
--out_dir=${OUTPUT_DIR} \
--vocab_prefix=../data/${SRC}-${TGT}/vocab \
--train_prefix=../data/${SRC}-${TGT}/training \
--dev_prefix=../data/${SRC}-${TGT}/dev \
--embed_prefix=${EMBED} \
--hparams_path=${HPARAMS} \
&> ${OUTPUT_DIR}/log &
echo "Using config: ${HPARAMS}"
echo "You can check the logfile using:"
echo "less ${OUTPUT_DIR}/log"
if [[ -z $1 ]]; then TBPORT=6006; else TBPORT=$1; fi
echo "You can start tensorboard using:"
echo "tensorboard --logdir ${OUTPUT_DIR} --port ${TBPORT}"