-
Notifications
You must be signed in to change notification settings - Fork 15
/
train_kbqa.sh
75 lines (67 loc) · 1.85 KB
/
train_kbqa.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
# set python path
export CUDA_VISIBLE_DEVICES=0
python_path='python3 -m'
# data config arguments
data_name=SimpQ
data_dir=./data/SimpleQuestions_v2
candgen_dir=./runnings/candgen_SimpQ
emb_dir=./data/kbqa_emb
fb_meta_dir=./data/freebase-metadata
output_dir=./runnings/${data_name}
# schema config arguments
qw_max_len=20
pw_max_len=8
path_max_size=3
pseq_max_len=3
# negative sampling arguments
neg_f1_ths=0.1
neg_max_sample=20 # [10, 20, 40, 80]
neg_strategy=Fix # ['Fix', 'Dyn']
# model config arguments
cell_class=GRU # ['RNN', 'GRU', 'LSTM']
num_units=256
num_layers=1
dim_emb=300
n_words=61814
n_mids=3561
n_paths=3561
w_emb_fix=Upd # ['Upd', 'Fix']
drop_rate=0.2
sent_usage=qwOnly # ['mSum', 'mMax', 'mlp', 'qwOnly', 'depOnly']
final_func=fc512 # [bilinear, fcxxx]
# training config arguments
loss_margin=0.5
lr_rate=0.001
optm_batch_size=256
eval_batch_size=512
max_epoch=10
${python_path} src.kbqa.main_kbqa \
--data_dir=${data_dir} \
--candgen_dir=${candgen_dir} \
--emb_dir=${emb_dir} \
--fb_meta_dir=${fb_meta_dir} \
--output_dir=${output_dir} \
--qw_max_len=${qw_max_len} \
--pw_max_len=${pw_max_len} \
--path_max_size=${path_max_size} \
--pseq_max_len=${pseq_max_len} \
--neg_f1_ths=${neg_f1_ths} \
--neg_max_sample=${neg_max_sample} \
--neg_strategy=${neg_strategy} \
--cell_class=${cell_class} \
--num_units=${num_units} \
--num_layers=${num_layers} \
--dim_emb=${dim_emb} \
--n_words=${n_words} \
--n_mids=${n_mids} \
--n_paths=${n_paths} \
--w_emb_fix=${w_emb_fix} \
--drop_rate=${drop_rate} \
--sent_usage=${sent_usage} \
--final_func=${final_func} \
--loss_margin=${loss_margin} \
--lr_rate=${lr_rate} \
--optm_batch_size=${optm_batch_size} \
--eval_batch_size=${eval_batch_size} \
--max_epoch=${max_epoch}