-
Notifications
You must be signed in to change notification settings - Fork 0
/
parser_certify.py
88 lines (68 loc) · 2.91 KB
/
parser_certify.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import argparse
def get_parser():
parser = argparse.ArgumentParser(description='Certify many examples')
parser.add_argument("--num_query_val",
type=int,
default=5,
help="number of query samples")
parser.add_argument("--classes_per_it_tr",
type=int,
default=5,
help="number of classes per iteration")
parser.add_argument("--classes_per_it_val",
type=int,
default=5,
help="number of classes per iteration")
parser.add_argument("--iterations",
type=int,
default=100,
help="iterations per epoch")
parser.add_argument("--skip",
type=int,
default=1,
help="how many examples to skip")
parser.add_argument("--max",
type=int,
default=-1,
help="stop after this many examples")
parser.add_argument("--N",
type=int,
default=1000,
help="number of samples to use for smoothing")
parser.add_argument("--M",
type=int,
default=50,
help="number of samples to use for confidence intervals")
parser.add_argument("--K",
type=int,
default=5,
help="maximum repeats number to increase number of samples")
parser.add_argument("--batch",
type=int,
default=100,
help="batch size")
parser.add_argument("--alpha",
type=float,
default=0.001,
help="failure probability")
parser.add_argument('-imsize', '--orig_imsize',
type=int,
default=-1,
help='-1 for no cache, and -2 for no resize, only for MiniImageNet')
parser.add_argument("--cuda",
default=True)
parser.add_argument("--cuda_number",
type=int,
default=3)
parser.add_argument('-seed', '--manual_seed',
type=int,
default=7,
help='input for the manual seeds initializations')
parser.add_argument("--mode",
type=str,
default='small-norm')
parser.add_argument("--descr",
type=str,
default=None,
help="additional description for output filename")
return parser