-
Notifications
You must be signed in to change notification settings - Fork 54
/
config.py
37 lines (31 loc) · 1.44 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
from easydict import EasyDict as edict
import json
import os
config = edict()
config.TRAIN = edict()
config.TRAIN.batch_size = 25
config.TRAIN.early_stopping_num = 10
config.TRAIN.lr = 0.0001
config.TRAIN.lr_decay = 0.5
config.TRAIN.decay_every = 5
config.TRAIN.beta1 = 0.5 # beta1 in Adam optimiser
config.TRAIN.n_epoch = 9999
config.TRAIN.sample_size = 50
config.TRAIN.g_alpha = 15 # weight for pixel loss
config.TRAIN.g_gamma = 0.0025 # weight for perceptual loss
config.TRAIN.g_beta = 0.1 # weight for frequency loss
config.TRAIN.g_adv = 1 # weight for frequency loss
config.TRAIN.seed = 100
config.TRAIN.epsilon = 0.000001
config.TRAIN.VGG16_path = os.path.join('trained_model', 'VGG16', 'vgg16_weights.npz')
config.TRAIN.training_data_path = os.path.join('data', 'MICCAI13_SegChallenge', 'training.pickle')
config.TRAIN.val_data_path = os.path.join('data', 'MICCAI13_SegChallenge', 'validation.pickle')
config.TRAIN.testing_data_path = os.path.join('data', 'MICCAI13_SegChallenge', 'testing.pickle')
config.TRAIN.mask_Gaussian1D_path = os.path.join('mask', 'Gaussian1D')
config.TRAIN.mask_Gaussian2D_path = os.path.join('mask', 'Gaussian2D')
config.TRAIN.mask_Poisson2D_path = os.path.join('mask', 'Poisson2D')
def log_config(filename, cfg):
with open(filename, 'w') as f:
f.write("================================================\n")
f.write(json.dumps(cfg, indent=4))
f.write("\n================================================\n")