-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstage1-finetune.sh
58 lines (51 loc) · 1.06 KB
/
stage1-finetune.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
#!/bin/bash
export CUDA_DEVICE_ORDER=PCI_BUS_ID
export CUDA_VISIBLE_DEVICES=0
log_file='run_glue.log' # training log
result_file='run_glue.csv' # attack results
cpkt='./save_models/fine-tune/' # Model saving path
seed=42
lr=2e-5
epoch=3
model='bert-base-uncased'
# IMDB
python run_glue.py \
--model_name $model \
--ckpt_dir $cpkt \
--dataset_name imdb \
--num_labels 2 \
--bsz 32 \
--epochs $epoch \
--lr $lr \
--seed $seed \
--max_seq_length 256 \
--result_file $result_file \
--num_examples 100 \
--force_overwrite 1 >> ${log_file}
# AGNEWS
python run_glue.py \
--model_name $model \
--ckpt_dir $cpkt \
--dataset_name ag_news \
--num_labels 4 \
--bsz 32 \
--epochs $epoch \
--lr $lr \
--seed $seed \
--max_seq_length 256 \
--result_file $result_file \
--num_examples 200 \
--force_overwrite 1 >> ${log_file}
# SST-2
python run_glue.py \
--model_name $model \
--ckpt_dir $cpkt \
--dataset_name glue \
--task_name sst2 \
--epochs $epoch \
--result_file ${result_file} \
--num_examples 872 \
--lr $lr \
--seed $seed \
--max_seq_length 128 \
--force_overwrite 1 >> ${log_file}