-
Notifications
You must be signed in to change notification settings - Fork 89
/
run_all_vary_size.py
47 lines (43 loc) · 1.28 KB
/
run_all_vary_size.py
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
datasets = """Structured/Amazon-Google
Structured/DBLP-ACM
Structured/DBLP-GoogleScholar
Structured/Walmart-Amazon
Textual/Abt-Buy
Textual/Company""".split('\n')
ops = """swap
append_col
del
swap
swap
del""".split('\n')
lm = "roberta"
epochs = 20
import os
import time
for dataset, op in zip(datasets, ops):
for size in [500, 1000, 1500, 2000]:
for run_id in range(5):
for da in [True, False]:
for dk in [True, False]:
# DK
ds = dataset
start = time.time()
cmd = """CUDA_VISIBLE_DEVICES=3 python train_ditto.py \
--task %s \
--logdir results_ditto/ \
--finetuning \
--batch_size %d \
--lr 3e-5 \
--fp16 \
--lm %s \
--n_epochs %d \
--size %d \
--run_id %d""" % (ds, batch_size, lm, epochs, size, run_id)
if 'Company' in ds:
cmd += ' --summarize'
if da:
cmd += ' --da %s' % op
if dk:
cmd += ' --dk general'
print(cmd)
os.system(cmd)