-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathexp_pipe.sh
55 lines (48 loc) · 1.31 KB
/
exp_pipe.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
#!/bin/bash
#SBATCH -p batch
#SBATCH -t 3-00:00:00
#SBATCH -N 1
#SBATCH -c 6
#SBATCH --gres=gpu:1
#SBATCH --ntasks-per-node=1
set -o nounset
set -o errexit
set -o pipefail
{
. scripts/set_environment.sh
args=( "$@" )
for arg in "${args[@]}"; do
eval "$arg"
done
echo "devices: ${devices:=0,1}"
echo "seed: ${seed:=0}"
echo "error schema: ${error_schema:=last}"
exper_path=exp/bart.$seed
# Train GEC model
bash train.sh \
encoder=bart \
config=configs/bart.ini \
devices=$devices \
seed=$seed \
update=10 \
path=$exper_path/model
# Use GEC model to generate pseudo data for target GED
bash scripts/generate_eng_treebank/generate_neg_treebank.sh \
-d $devices \
-b 4000 \
-G \
--gec-path $exper_path/model.3 \
--config configs/bart.ini \
--gec-topk 12 \
--output-path $exper_path/pseudo_data/ \
data/error_coded.train
# Train target GED model
bash train_ged.sh \
devices=$devices \
config=configs/seq2seq.ged.ini \
error_schema="$error_schema" \
update=12 \
data=$exper_path/pseudo_data \
ckptpath=$exper_path/model.3 \
path=$exper_path/ged.$error_schema/model
}