-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfew_IDPG-PHM.sh
88 lines (78 loc) · 3.3 KB
/
few_IDPG-PHM.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
76
77
78
79
80
81
82
83
84
85
86
87
88
ARCH=roberta_large
SAVE=/PATH/TO/YOUR/CHECKPOINTS/FOLDER/
NEWSAVE=/PATH/TO/WHERE/YOU/STORE/THE/FINETUNE/CHECKPOINT/FOLDER/
SAVE=/scratch/vgvinodv_root/vgvinodv1/zhuofeng/checkpoints/
NEWSAVE=/scratch/vgvinodv_root/vgvinodv1/zhuofeng/checkpoints/
ROBERTA_PATH=$SAVE'nli_large_checkpoint.pt'
K=$1
suffixlen="5"
LRs="5e-04 1e-04 5e-05 1e-05"
froms="0"
gq="16"
pdim="16"
mode="1"
seeds="1 2 3 4 5"
mkdir -p "few_results"
for LR in $LRs; do
for from in $froms; do
OUT_FILE='few_results/mphm-r'$K'-'$from'.txt'
TASKs="SST-2 cr mr mpqa subj"
insertpositions="0"
for insertposition in $insertpositions; do
SUFFIX=$K'-mphmr-'$gq'-'$suffixlen'-'$insertposition'-f'$LR'_5-'
#SAVE=$checkpoint_path'efl_roberta-d_phm-'$gq'-'$suffixlen'-'$from'/'
for TASK in $TASKs; do
for seed in $seeds; do
node=0
SAVE_FILE=$SAVE$TASK$SUFFIX$seed
bash scripts/few-finetune-gene_freeze-mphm.sh $ROBERTA_PATH $SAVE_FILE $seed $ARCH $node $insertposition $LR $K $TASK
done
wait
for seed in $seeds; do
SAVE_FILE=$SAVE$TASK$SUFFIX$seed'/'
CUDA_VISIBLE_DEVICES=0 python 'scripts/'$TASK'_get_result.py' -i $SAVE_FILE -o $OUT_FILE -n $seed -f $from -t $insertposition -k $K -l $LR
done
wait
SAVE_FILE=$SAVE$TASK$SUFFIX
python 'scripts/bagging_'$TASK'.py' -i $SAVE_FILE -o $OUT_FILE
echo $TASK 'done'
done
done
TASKs="MRPC RTE QNLI QQP"
insertpositions="0"
for insertposition in $insertpositions; do
SUFFIX=$K'-mphmr-'$gq'-'$suffixlen'-'$insertposition'-f'$LR'_5-'
for TASK in $TASKs; do
for seed in $seeds; do
node=0
SAVE_FILE=$SAVE$TASK$SUFFIX$seed
bash scripts/few-finetune-gene_freeze-mphm.sh $ROBERTA_PATH $SAVE_FILE $seed $ARCH $node $insertposition $LR $K $TASK
done
wait
for seed in $seeds; do
SAVE_FILE=$SAVE$TASK$SUFFIX$seed'/'
CUDA_VISIBLE_DEVICES=0 python 'scripts/'$TASK'_get_result.py' -i $SAVE_FILE -o $OUT_FILE -n $seed -f $from -t $insertposition -k $K -l $LR
done
wait
SAVE_FILE=$SAVE$TASK$SUFFIX
python 'scripts/bagging_'$TASK'.py' -i $SAVE_FILE -o $OUT_FILE
echo $TASK 'done'
done
TASK="STS-B"
for seed in $seeds; do
node=0
SAVE_FILE=$SAVE$TASK$SUFFIX$seed
bash scripts/few-finetune-gene_freeze-mphm-sts-b.sh $ROBERTA_PATH $SAVE_FILE $seed $ARCH $node $insertposition $LR $K
done
wait
for seed in $seeds; do
SAVE_FILE=$SAVE$TASK$SUFFIX$seed'/'
CUDA_VISIBLE_DEVICES=0 python 'scripts/'$TASK'_get_result.py' -i $SAVE_FILE -o $OUT_FILE -n $seed -f $from -t $insertposition -k $K -l $LR
done
wait
SAVE_FILE=$SAVE$TASK$SUFFIX
python 'scripts/bagging_'$TASK'.py' -i $SAVE_FILE -o $OUT_FILE
echo $TASK 'done'
done
done
done