-
Notifications
You must be signed in to change notification settings - Fork 1
/
adapt_full_exp.sh
executable file
·46 lines (39 loc) · 1.37 KB
/
adapt_full_exp.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
#!/usr/bin/env sh
MODEL_NAME=$1
CONFIG=$2
OVERWRITE=$3
DECODE_MODE=$4
ALGO=$5
PRETRAIN_SETTING=$6
PRETRAIN_SUFFIX=$7
PRETRAIN_STEP=$8
ACCENT=$9
DECODE_BATCH_SIZE=32
name=$(hostname)
if [[ $name == *.speech ]];then
if [[ $name == "login.speech" ]];then
echo "[ERR] CANNOT run on login.speech!!"
exit 1
fi
echo "Running on battleship ($name)"
else
echo "Running on $name"
fi
## train
cmd="python train.py --config $CONFIG --pretrain --pretrain_setting $PRETRAIN_SETTING --pretrain_suffix $PRETRAIN_SUFFIX --pretrain_step $PRETRAIN_STEP --eval_suffix step$PRETRAIN_STEP --accent $ACCENT --algo $ALGO --model_name $MODEL_NAME --njobs 4 --eval_every_epoch"
if [[ $OVERWRITE == "overwrite" ]];then
cmd="$cmd --overwrite"
fi
echo $cmd
eval $cmd
## decode
cmd="python train.py --config $CONFIG --pretrain --pretrain_setting $PRETRAIN_SETTING --pretrain_suffix $PRETRAIN_SUFFIX --pretrain_step $PRETRAIN_STEP --eval_suffix step$PRETRAIN_STEP --accent $ACCENT --algo $ALGO --model_name $MODEL_NAME --test --decode_mode $DECODE_MODE --njobs 4 --decode_batch_size $DECODE_BATCH_SIZE"
if [[ $OVERWRITE == "overwrite" ]];then
cmd="$cmd --overwrite"
fi
echo $cmd
eval $cmd
## score
cmd="./score.sh --config $CONFIG --pretrain_suffix $PRETRAIN_SUFFIX --eval_suffix step$PRETRAIN_STEP --accent $ACCENT --algo $ALGO --model_name $MODEL_NAME --decode_mode $DECODE_MODE"
echo $cmd
eval $cmd