-
Notifications
You must be signed in to change notification settings - Fork 5
/
common.py
95 lines (87 loc) · 2.26 KB
/
common.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
89
90
91
92
93
94
#!/usr/bin/env python
# coding: utf-8
# Model & training arguments are defined in this file
class Config():
save_ckpt_dir = ''
result_out_dir = ''
data_dir = ''
ckpt_dir = None
use_gpu = True
use_dgconv = True
fix_groups = 1
num_replicates = 5
seed = 42
dataset = 'muufl'
if dataset == 'houston':
# hyperparams for unet
model = 'unet'
mask_undefined = True
num_classes = 20
epochs = 300
lr = 0.001
lr_schedule = None
optimizer = 'adam'
batch_size = 12
use_init = False
sample_h = sample_w = 128
# hyperparams for fusion_fcn
# model = 'fusion_fcn'
# mask_undefined = True
# num_classes = 20
# epochs = 4000
# lr = 0.001
# lr_schedule = None
# optimizer = 'adam'
# batch_size = 2
# use_init = True
# sample_h = 1202
# sample_w = 300
elif dataset == 'berlin':
mask_undefined = False
num_classes = 8
# hyperparameters for resnet18
model = 'resnet18'
epochs = 300
lr = 0.001
lr_schedule = None
optimizer = 'sgd'
batch_size = 64
use_init = False
sample_radius = 8
# hyperparameters for resnet50
# model = 'resnet50'
# epochs = 400
# lr = 0.001
# lr_schedule = [300]
# optimizer = 'adam'
# batch_size = 64
# use_init = False
# sample_radius = 8
elif dataset == 'muufl':
mask_undefined = False
num_classes = 11
use_init = True
# hyperparams for resnet18
model = 'resnet18'
sample_radius = 5
epochs = 300
lr = 0.02
lr_schedule = [200, 240]
optimizer = 'sgd'
batch_size = 48
# hyperparams for resnet50
# model = 'resnet50'
# sample_radius = 8
# epochs = 400
# lr = 0.01
# lr_schedule = [300, 350]
# optimizer = 'adam'
# batch_size = 64
# hyperparams for tb_cnn
# model = 'tb_cnn'
# sample_radius = 5
# epochs = 300
# lr = 0.001
# lr_schedule = None
# optimizer = 'adam'
# batch_size = 48