-
Notifications
You must be signed in to change notification settings - Fork 2
/
run.sh
61 lines (55 loc) · 1.24 KB
/
run.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
cuda=0
way=10
shot=1
query=30
embedding=meta #[cnn, lstmatt, meta, bert]
classifier=r2d2 #[routing, proto, gnn, r2d2]
feature_convergence=sum #[sum,max,mean,cnn]
val_episodes=100
patience=20
seed=2021
aug_support=1
meta_label_sim=1
dataset=pw #[pw,aws]
data_path="data/"$dataset".json"
wv_vector=$dataset"_word2vec.txt"
index2vector_path="data/"$dataset"_index2vector.pkl"
if [ $dataset = "pw" ] ; then
n_train_class=145
n_val_class=60
n_test_class=59
elif [ $dataset = "aws" ] ; then
n_train_class=51
n_val_class=23
n_test_class=22
else
echo "Invalid dataset!"
exit 1
fi
cmd="python src/main.py
--cuda $cuda
--way $way
--shot $shot
--query $query
--embedding $embedding
--classifier $classifier
--dataset $dataset
--data_path $data_path
--n_train_class $n_train_class
--n_val_class $n_val_class
--n_test_class $n_test_class
--word_vector $wv_vector
--val_episodes $val_episodes
--patience $patience
--seed $seed
--feature_convergence $feature_convergence
--index2vector_path $index2vector_path
--meta_iwf
"
if [ $aug_support ] ; then
cmd=$cmd"--aug_support "
fi
if [ $meta_label_sim ] ; then
cmd=$cmd"--meta_label_sim "
fi
eval $cmd