-
Notifications
You must be signed in to change notification settings - Fork 1
/
search_space.py
executable file
·49 lines (42 loc) · 1.4 KB
/
search_space.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
import pandas as pd
from auto_drac import data_augs
def get_hparams(args):
"""
Only supports the data aug experiment
Should be trivial to add more...
"""
if args.experiment == "data_aug":
if args.fixed:
names = ['aug_type']
types = ['categorical']
ranges = [['crop']]
else:
names = ['entropy_coef', 'lr', 'clip_param', 'aug_coef', 'aug_type']
types = ['continuous', 'continuous', 'continuous', 'continuous', 'categorical']
ranges = [[0,0.2],
[1e-5, 1e-3],
[0.01, 0.5],
[0.01, 0.5],
['crop',
'random-conv',
'grayscale',
'flip',
'rotate',
'cutout',
'cutout-color',
'color-jitter']]
df_hparams = pd.DataFrame({
'Name': names,
'Type': types,
'Range': ranges})
return(df_hparams)
aug_to_func = {
'crop': data_augs.Crop,
'random-conv': data_augs.RandomConv,
'grayscale': data_augs.Grayscale,
'flip': data_augs.Flip,
'rotate': data_augs.Rotate,
'cutout': data_augs.Cutout,
'cutout-color': data_augs.CutoutColor,
'color-jitter': data_augs.ColorJitter,
}