-
Notifications
You must be signed in to change notification settings - Fork 1
/
train-subw.sh
executable file
·24 lines (17 loc) · 982 Bytes
/
train-subw.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Trains sparse two-headed gated attention model with static encoder attenton over subwords
modeldir_base=$1 #pytorch datasets and models will be saved in this folder
train=$2
train_segm=$3
dev=$4
dev_segm=$5
config=$6
####################################################################################################
# prepare datasets
echo "python preprocess.py -use_bpe -train $train -bpe_train $train_segm -valid $dev -bpe_valid $dev_segm -save_data $modeldir_base/data -inflection_field"
python preprocess.py -use_bpe -train $train -bpe_train $train_segm -valid $dev -bpe_valid $dev_segm -save_data $modeldir_base/data -inflection_field
# train instruction
name=$modeldir_base/$( basename $config .yml )
modeldir=$name-models
mkdir -p $modeldir
echo "python train.py -config $config -data $modeldir_base/data -save_model $modeldir/model -log_file $name.log"
python train.py -config $config -data $modeldir_base/data -save_model $modeldir/model -log_file $name.log