-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_command.py
30 lines (26 loc) · 1.23 KB
/
get_command.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
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument('--rewiring', required=False, default='')
parser.add_argument('--num_iterations', type=int, required=False, default=0)
parser.add_argument('--layer_type', required=False, default='')
parser.add_argument('--gpu_index', required=True, default=0)
parser.add_argument('--num_seeds', type=int, required=False, default=10)
args = vars(parser.parse_args())
gpu_index = args['gpu_index']
num_seeds = args['num_seeds']
rewiring_methods = ['fosr', 'sdrf_orc', 'sdrf_bfc', 'none']
num_iterations = [3, 5, 10]
layer_types = ['GCN', 'GIN'] # 'R-GIN', 'R-GCN'
if(args['rewiring'] != ''):
assert args['rewiring'] in rewiring_methods
rewiring_methods = [args['rewiring']]
if(args['num_iterations'] != 0):
num_iterations = [args['num_iterations']]
if(args['layer_type'] != ''):
assert args['layer_type'] in layer_types
layer_types = [args['layer_type']]
for rewiring in rewiring_methods:
for num_iters in num_iterations:
for layer_type in layer_types:
cmd = f'python run_graph_classification.py --rewiring {rewiring} --num_iterations {num_iters} --layer_type {layer_type} --num_trials {num_seeds} --device cuda:{gpu_index}'
print(cmd)