-
Notifications
You must be signed in to change notification settings - Fork 0
/
param_all4_2D_smallFilter_1batchNorm_multiSlice.py
73 lines (59 loc) · 2.23 KB
/
param_all4_2D_smallFilter_1batchNorm_multiSlice.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
### name of the run
name = '_smallFilter_1batchNorm_multiSlice' ### _confirm
### selected parameter
paramNum = 4
paramName = [ 'ZETA', 'Tvir', 'LX', 'E0', 'all4' ]
### LC parameter
dim=2 ### dimention of the input : 3
fullres = True ### reduce average cube (25,25,550) of full resolution (200,200,2200)
BoxSize = 200 ### raw resolution
BoxInLC = 11 ### number of concatenate box in the LC
Nsimu = 10000 ### total number of LC
### learning parameters
RandomSeed = 4321 ### 9510 confirm ### 4321 REF ##2235 old ### should be fixed, in order to be able to reproduce the training-testing set
trainSize = 0.8 ### if LHS useless
LHS = False
Nbins_LHS = 8000
batch_size = 20 ### number of sub sample, /!\ has to be a diviseur of the training set
epochs = 200 ### number of passage over the full data set
### Network PARAMETERS
### LOSS FUNCTION
loss = 'mean_squared_error' ### classic loss function for regression, see also 'mae'
### DEFINE THE OPTIMIZER
optimizer = 'RMSprop' #'adagrad' #'adadelta' #'adam' # 'adamax' # 'Nadam' # 'RMSprop' # sgd
### DEFINE THE LEARNING RATE
factor=0.5
patience=5
### DEFINE THE DATABASE TO USE
DATABASE = '100_2200_slice_10' ### '300Mpc_r200_2D'
multiple_slice = True
### OPTIONS
reduce_LC = False ### FOR 2D slice, use half of the image
substract_mean = False ### substract mean(f) o the LC
apply_gauss = False ### apply an half gaussian of the LC
reduce_CNN = True ### smaller CNN
use_dropout = 0.2
validation = True ### MAKE VALIDATION DATA
batchNorm = False ### batchnorm after all layer == LONG TIME
FirstbatchNorm = True ### batchnorm just after the first conv
LeackyRelu_alpha = 0
Nfilter1 = 8 ### First convolution
Nfilter2 = 16 ### 2nd convolution
Nfilter3 = 64 ### First Dense
######################
### INDUCED PARAMS ###
######################
if paramNum==4: ### given as arg
all4 = True ### LEARN THE 4 PARAMS AT THE SAME TIME
else:
all4 = False
if reduce_LC:
BoxSize = 100
### save files
model_template = '%s_2D'
model_file = model_template%(paramName[paramNum]) + name
history_file = model_file + '_history'
prediction_file = model_file + '_pred'
prediction_file_val = model_file + '_pred_val'
### save folder
CNN_folder = 'CNN_save/'