/
PathConfig.py
111 lines (85 loc) · 2.96 KB
/
PathConfig.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# -*- coding: utf-8 -*-
"""
Path setting
Created on Feb 2018
@author: fangshuyang (yfs2016@hit.edu.cn)
"""
from LibConfig import *
from ParamConfig import *
####################################################
#### FILENAMES ####
####################################################
# Data filename
if SimulateData:
tagD0 = 'georec'
tagV0 = 'vmodel'
tagD1 = 'Rec'
tagV1 = 'vmodel'
else:
tagD0 = 'srec'
tagV0 = 'svmodel'
tagD1 = 'Rec'
tagV1 = 'svmodel'
datafilename = tagD0
dataname = tagD1
truthfilename = tagV0
truthname = tagV1
###################################################
#### PATHS #####
###################################################
main_dir = '/home/yfs1/Code/pytorch/FCNVMB/' # Replace your main path here
## Check the main directory
if len(main_dir) == 0:
raise Exception('Please specify path to correct directory!')
## Data path
if os.path.exists('./data/'):
data_dir = main_dir + 'data/' # Replace your data path here
else:
os.makedirs('./data/')
data_dir = main_dir + 'data/'
# Define training/testing data directory
train_data_dir = data_dir + 'train_data/' # Replace your training data path here
test_data_dir = data_dir + 'test_data/' # Replace your testing data path here
# Define directory for simulate data and SEG data respectively
if SimulateData:
train_data_dir = train_data_dir + 'SimulateData/'
test_data_dir = test_data_dir + 'SimulateData/'
else:
train_data_dir = train_data_dir + 'SEGSaltData/'
test_data_dir = test_data_dir + 'SEGSaltData/'
## Create Results and Models path
if os.path.exists('./results/') and os.path.exists('./models/'):
results_dir = main_dir + 'results/'
models_dir = main_dir + 'models/'
else:
os.makedirs('./results/')
os.makedirs('./models/')
results_dir = main_dir + 'results/'
models_dir = main_dir + 'models/'
if SimulateData:
results_dir = results_dir + 'SimulateResults/'
models_dir = models_dir + 'SimulataModel/'
else:
results_dir = results_dir + 'SEGSaltResults/'
models_dir = models_dir + 'SEGSaltModel/'
if os.path.exists(results_dir) and os.path.exists(models_dir):
results_dir = results_dir
models_dir = models_dir
else:
os.makedirs(results_dir)
os.makedirs(models_dir)
results_dir = results_dir
models_dir = models_dir
# Create Model name
if SimulateData:
tagM = 'Simulate'
else:
tagM = 'SEGSalt'
tagM0 = '_FCNVMBModel'
tagM1 = '_TrainSize' + str(TrainSize)
tagM2 = '_Epoch' + str(Epochs)
tagM3 = '_BatchSize' + str(BatchSize)
tagM4 = '_LR' + str(LearnRate)
modelname = tagM+tagM0+tagM1+tagM2+tagM3+tagM4
# Change here to set the model as the pre-trained initialization
premodelname = 'Simulate_FCNVMBModel_TrainSize1600_Epoch100_BatchSize10_LR0.001'