-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathshared_args.py
66 lines (46 loc) · 3.36 KB
/
shared_args.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import argparse
def add_shared_args():
parser = argparse.ArgumentParser(description='Parameter Processing')
parser.add_argument('--dataset', type=str, default='CIFAR10', help='dataset')
parser.add_argument('--model', type=str, default='ConvNet', help='model')
parser.add_argument('--ipc', type=int, default=1, help='image(s) per class')
parser.add_argument('--eval_mode', type=str, default='M',
help='eval_mode') # S: the same to training model, M: multi architectures
parser.add_argument('--num_eval', type=int, default=5, help='the number of evaluating randomly initialized models')
parser.add_argument('--eval_it', type=int, default=100, help='how often to evaluate')
parser.add_argument('--save_it', type=int, default=None, help='how often to evaluate')
parser.add_argument('--epoch_eval_train', type=int, default=1000,
help='epochs to train a model with synthetic data')
parser.add_argument('--Iteration', type=int, default=1000, help='training iterations')
parser.add_argument('--mom_img', type=float, default=0.5, help='momentum for updating synthetic images')
parser.add_argument('--batch_real', type=int, default=256, help='batch size for real data')
parser.add_argument('--batch_train', type=int, default=256, help='batch size for training networks')
parser.add_argument('--batch_test', type=int, default=128, help='batch size for training networks')
parser.add_argument('--pix_init', type=str, default='noise', choices=["noise", "real"],
help='noise/real: initialize synthetic images from random noise or randomly sampled real images.')
parser.add_argument('--dsa', type=str, default='True', choices=['True', 'False'],
help='whether to use differentiable Siamese augmentation.')
parser.add_argument('--dsa_strategy', type=str, default='color_crop_cutout_flip_scale_rotate',
help='differentiable Siamese augmentation strategy')
parser.add_argument('--data_path', type=str, default='data', help='dataset path')
parser.add_argument('--save_path', type=str, default='result', help='path to save results')
parser.add_argument('--space', type=str, default='p', choices=['p', 'wp'])
parser.add_argument('--res', type=int, default=128, choices=[128, 256, 512], help='resolution')
parser.add_argument('--layer', type=int, default=12)
parser.add_argument('--avg_w', action='store_true')
parser.add_argument('--eval_all', action='store_true')
parser.add_argument('--min_it', type=bool, default=False)
parser.add_argument('--no_aug', type=bool, default=False)
parser.add_argument('--force_save', action='store_true')
parser.add_argument('--sg_batch', type=int, default=10)
parser.add_argument('--rand_f', action='store_true')
parser.add_argument('--logdir', type=str, default='./logged_files')
parser.add_argument('--wait_eval', action='store_true')
parser.add_argument('--idc_factor', type=int, default=1)
parser.add_argument('--rand_gan_un', action='store_true')
parser.add_argument('--rand_gan_con', action='store_true')
parser.add_argument('--learn_g', action='store_true')
parser.add_argument('--width', type=int, default=128)
parser.add_argument('--depth', type=int, default=5)
parser.add_argument('--special_gan', default=None)
return parser