-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.py
executable file
·65 lines (48 loc) · 1.82 KB
/
config.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
# This file contains configuration for training and evaluation
from easydict import EasyDict as edict
cfg = edict()
# Model
cfg.model = edict()
cfg.model.name = 'unet'
cfg.model.norm_type = 'batch' # 'batch', instance
# Data
cfg.data = edict()
cfg.data.data_dir = './data'
cfg.data.name = 'full_tiles'
# define model input. options: 'dem', 'shaded_relief', 'naip', 'dem_derivative', 'dem_dxy_pre'
cfg.data.input_type = 'dem_derivative'
if cfg.data.input_type == 'dem':
cfg.data.input_channels = 1
elif cfg.data.input_type == 'shaded_relief':
cfg.data.input_channels = 3
elif cfg.data.input_type == 'naip':
cfg.data.input_channels = 4
elif cfg.data.input_type == 'dem_derivative':
cfg.data.input_channels = 2
elif cfg.data.input_type == 'dem_dxy_pre':
cfg.data.input_channels = 1
cfg.data.eval_pad = False
# Normalization of inputs
# DEM normalization. Options: '0_to_1', 'unit_gaussian', 'instance', 'none'
cfg.data.normalize_dem = 'none'
# shaded relief normalization. Options: '0_to_1', 'unit_gaussian', 'instance'
cfg.data.normalize_shaded = '0_to_1'
# NAIP normalization. Options: '0_to_1', 'unit_gaussian', 'instance', 'none'
cfg.data.normalize_naip = 'none'
# DEM gradient normalization. Options: 'instance' , 'none', '0_to_1', 'unit_gaussian'
cfg.data.normalize_dem_ddxy = 'unit_gaussian'
# normalization for DEM pre-computed gradients. Options: 'none', 'instance', 'unit_gaussian', '0_to_1'
cfg.data.normalize_dem_dxy_pre = 'none'
cfg.data.mode = 'train'
cfg.data.cutout_size = (400, 400)
# Training details
cfg.train = edict()
cfg.train.batch_size = 14
cfg.train.learning_rate = 5e-4 # initial learning rate
cfg.train.l2_reg = 1e-6
cfg.train.lr_decay = 0.9
cfg.train.lr_decay_every = 3
cfg.train.shuffle = True
cfg.train.num_epochs = 100
cfg.train.num_workers = 4
cfg.train.out_dir = './outputs/dem_derovative1'