CTLearn 0.8.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
ctlearn/data_loader.py ADDED
@@ -0,0 +1,221 @@
1
+ import numpy as np
2
+ import tensorflow as tf
3
+
4
+
5
+ class KerasBatchGenerator(tf.keras.utils.Sequence):
6
+ "Generates batches for Keras application"
7
+
8
+ def __init__(
9
+ self,
10
+ DL1DataReaderDL1DH,
11
+ indices,
12
+ batch_size=64,
13
+ mode="train",
14
+ class_names=None,
15
+ shuffle=True,
16
+ concat_telescopes=False,
17
+ ):
18
+ "Initialization"
19
+ self.DL1DataReaderDL1DH = DL1DataReaderDL1DH
20
+ self.batch_size = batch_size
21
+ self.indices = indices
22
+ self.mode = mode
23
+ self.class_names = class_names
24
+ self.shuffle = shuffle
25
+ self.concat_telescopes = concat_telescopes
26
+ self.on_epoch_end()
27
+
28
+ # Decrypt the example description
29
+ # Features
30
+ self.singleimg_shape = None
31
+ self.trg_pos, self.trg_shape = None, None
32
+ self.pon_pos = None
33
+ self.pointing = []
34
+ self.wvf_pos, self.wvf_shape = None, None
35
+ self.img_pos, self.img_shape = None, None
36
+ self.prm_pos, self.prm_shape = None, None
37
+ self.parameter_list = []
38
+ # Additional info
39
+ self.evt_pos, self.obs_pos = None, None
40
+ self.event_list, self.obs_list = [], []
41
+ self.mjd_pos, self.milli_pos, self.nano_pos = None, None, None
42
+ self.mjd_list, self.milli_list, self.nano_list = [], [], []
43
+ # Labels
44
+ self.prt_pos, self.enr_pos, self.drc_pos = None, None, None
45
+ self.prt_labels, self.enr_labels, self.alt_labels, self.az_labels = (
46
+ [],
47
+ [],
48
+ [],
49
+ [],
50
+ )
51
+ self.energy_unit = None
52
+
53
+ for i, desc in enumerate(self.DL1DataReaderDL1DH.example_description):
54
+ if "trigger" in desc["name"]:
55
+ self.trg_pos = i
56
+ self.trg_shape = desc["shape"]
57
+ elif "pointing" in desc["name"]:
58
+ self.pon_pos = i
59
+ elif "waveform" in desc["name"]:
60
+ self.wvf_pos = i
61
+ self.wvf_shape = desc["shape"]
62
+ elif "image" in desc["name"]:
63
+ self.img_pos = i
64
+ self.img_shape = desc["shape"]
65
+ elif "parameters" in desc["name"]:
66
+ self.prm_pos = i
67
+ self.prm_shape = desc["shape"]
68
+ elif "true_shower_primary_id" in desc["name"]:
69
+ self.prt_pos = i
70
+ elif "energy" in desc["name"]:
71
+ self.enr_pos = i
72
+ self.energy_unit = desc["unit"]
73
+ elif "direction" in desc["name"]:
74
+ self.drc_pos = i
75
+ elif "event_id" in desc["name"]:
76
+ self.evt_pos = i
77
+ elif "obs_id" in desc["name"]:
78
+ self.obs_pos = i
79
+ elif "mjd" in desc["name"]:
80
+ self.mjd_pos = i
81
+ elif "milli_sec" in desc["name"]:
82
+ self.milli_pos = i
83
+ elif "nano_sec" in desc["name"]:
84
+ self.nano_pos = i
85
+
86
+ # Retrieve shape from a single image in stereo analysis
87
+ if self.trg_pos is not None and self.img_pos is not None:
88
+ self.singleimg_shape = (
89
+ self.img_shape[1],
90
+ self.img_shape[2],
91
+ self.img_shape[3],
92
+ )
93
+ # Reshape inputs into proper dimensions for the stereo analysis with merged models
94
+ if self.concat_telescopes:
95
+ self.img_shape = (
96
+ self.img_shape[1],
97
+ self.img_shape[2],
98
+ self.img_shape[0] * self.img_shape[3],
99
+ )
100
+
101
+ def __len__(self):
102
+ "Denotes the number of batches per epoch"
103
+ return int(np.floor(len(self.indices) / self.batch_size))
104
+
105
+ def __getitem__(self, index):
106
+ "Generate one batch of data"
107
+ return self.__data_generation(
108
+ self.indices[index * self.batch_size : (index + 1) * self.batch_size]
109
+ )
110
+
111
+ def on_epoch_end(self):
112
+ "Updates indexes after each epoch"
113
+ if self.shuffle == True:
114
+ np.random.shuffle(self.indices)
115
+
116
+ def __data_generation(self, batch_indices):
117
+ "Generates data containing batch_size samples"
118
+ if self.trg_pos is not None:
119
+ triggers = np.empty((self.batch_size, *self.trg_shape))
120
+ if self.wvf_pos is not None:
121
+ waveforms = np.empty((self.batch_size, *self.wvf_shape))
122
+ if self.img_pos is not None:
123
+ images = np.empty((self.batch_size, *self.img_shape))
124
+ if self.prm_pos is not None:
125
+ parameters = np.empty((self.batch_size, *self.prm_shape))
126
+
127
+ if self.mode == "train":
128
+ if self.prt_pos is not None:
129
+ particletype = np.empty((self.batch_size))
130
+ if self.enr_pos is not None:
131
+ energy = np.empty((self.batch_size))
132
+ if self.drc_pos is not None:
133
+ direction = np.empty((self.batch_size, 2))
134
+
135
+ # Generate data
136
+ for i, index in enumerate(batch_indices):
137
+ event = self.DL1DataReaderDL1DH[index]
138
+ # Fill the features
139
+ if self.trg_pos is not None:
140
+ triggers[i] = event[self.trg_pos]
141
+ if self.wvf_pos is not None:
142
+ waveforms[i] = event[self.wvf_pos]
143
+ if self.img_pos is not None:
144
+ images[i] = np.reshape(event[self.img_pos], self.img_shape)
145
+ if self.prm_pos is not None:
146
+ parameters[i] = event[self.prm_pos]
147
+
148
+ if self.mode == "train":
149
+ # Fill the labels
150
+ if self.prt_pos is not None:
151
+ particletype[
152
+ i
153
+ ] = self.DL1DataReaderDL1DH.shower_primary_id_to_class[
154
+ int(event[self.prt_pos])
155
+ ]
156
+ if self.enr_pos is not None:
157
+ energy[i] = event[self.enr_pos]
158
+ if self.drc_pos is not None:
159
+ direction[i] = event[self.drc_pos]
160
+ else:
161
+ # Save all labels for the prediction phase
162
+ if self.prt_pos is not None:
163
+ self.prt_labels.append(np.float32(event[self.prt_pos]))
164
+ if self.enr_pos is not None:
165
+ self.enr_labels.append(event[self.enr_pos][0])
166
+ if self.drc_pos is not None:
167
+ self.alt_labels.append(event[self.drc_pos][0])
168
+ self.az_labels.append(event[self.drc_pos][1])
169
+ # Save pointing
170
+ if self.pon_pos is not None:
171
+ self.pointing.append(event[self.pon_pos])
172
+ # Save all parameters for the prediction phase
173
+ if self.prm_pos is not None:
174
+ self.parameter_list.append(event[self.prm_pos])
175
+ # Save event and obs id
176
+ if self.evt_pos is not None:
177
+ self.event_list.append(np.float32(event[self.evt_pos]))
178
+ if self.obs_pos is not None:
179
+ self.obs_list.append(np.float32(event[self.obs_pos]))
180
+ # Save timestamp
181
+ if self.mjd_pos is not None:
182
+ self.mjd_list.append(np.float32(event[self.mjd_pos]))
183
+ if self.milli_pos is not None:
184
+ self.milli_list.append(np.float32(event[self.milli_pos]))
185
+ if self.nano_pos is not None:
186
+ self.nano_list.append(np.float32(event[self.nano_pos]))
187
+
188
+ features = {}
189
+ if self.trg_pos is not None:
190
+ features["triggers"] = triggers
191
+ if self.wvf_pos is not None:
192
+ features["waveforms"] = waveforms
193
+ if self.img_pos is not None:
194
+ features["images"] = images
195
+ if self.prm_pos is not None:
196
+ features["parameters"] = parameters
197
+
198
+ labels = {}
199
+ if self.mode == "train":
200
+ if self.prt_pos is not None:
201
+ labels["particletype"] = tf.keras.utils.to_categorical(
202
+ particletype,
203
+ num_classes=self.DL1DataReaderDL1DH.num_classes,
204
+ )
205
+ label = tf.keras.utils.to_categorical(
206
+ particletype,
207
+ num_classes=self.DL1DataReaderDL1DH.num_classes,
208
+ )
209
+ if self.enr_pos is not None:
210
+ labels["energy"] = energy.reshape((-1, 1))
211
+ label = energy.reshape((-1, 1))
212
+ if self.drc_pos is not None:
213
+ labels["direction"] = direction
214
+ label = direction
215
+
216
+ # Temp fix till keras support class weights for multiple outputs or I wrote custom loss
217
+ # https://github.com/keras-team/keras/issues/11735
218
+ if len(labels) == 1:
219
+ labels = label
220
+
221
+ return features, labels
@@ -0,0 +1,57 @@
1
+ Data:
2
+ mode: 'stereo'
3
+ image_channels: ['image', 'peak_time']
4
+ mapping_settings:
5
+ mapping_method:
6
+ 'LSTCam': 'bilinear_interpolation'
7
+ 'FlashCam': 'bilinear_interpolation'
8
+ 'NectarCam': 'bilinear_interpolation'
9
+ 'CHEC': 'oversampling'
10
+ 'SCTCam': 'oversampling'
11
+ 'LSTSiPMCam': 'bilinear_interpolation'
12
+ 'MAGICCam': 'bilinear_interpolation'
13
+ padding:
14
+ 'LSTCam': 2
15
+ 'FlashCam': 2
16
+ 'NectarCam': 2
17
+ 'CHEC': 0
18
+ 'SCTCam': 0
19
+ 'LSTSiPMCam': 2
20
+ 'MAGICCam': 2
21
+ Input:
22
+ batch_size_per_worker: 16
23
+ concat_telescopes: false
24
+ Model:
25
+ name: 'CNNRNN'
26
+ backbone: {module: 'cnn_rnn', function: 'cnn_rnn_model'}
27
+ engine_img: {module: 'basic', function: 'conv_block'}
28
+ head: {module: 'head', function: 'standard_head'}
29
+ Model Parameters:
30
+ attention: {mechanism: 'Squeeze-and-Excitation', ratio: 16}
31
+ basic:
32
+ conv_block:
33
+ layers:
34
+ - {filters: 32, kernel_size: 3, number: 1}
35
+ - {filters: 32, kernel_size: 3, number: 1}
36
+ - {filters: 64, kernel_size: 3, number: 1}
37
+ - {filters: 128, kernel_size: 3, number: 1}
38
+ max_pool: {size: 2, strides: 2}
39
+ bottleneck: null
40
+ batchnorm: false
41
+ standard_head:
42
+ particletype: {fc_head: [], weight: 1.0}
43
+ energy: {fc_head: [], weight: 1.0}
44
+ direction: {fc_head: [], weight: 1.0}
45
+ Training:
46
+ validation_split: 0.05
47
+ num_epochs: 5
48
+ verbose: 2
49
+ workers: 1
50
+ optimizer: 'Adam'
51
+ adam_epsilon: 1.0e-8
52
+ base_learning_rate: 0.0001
53
+ lr_reducing_patience: 5
54
+ lr_reducing_factor: 0.5
55
+ lr_reducing_mindelta: 0.01
56
+ lr_reducing_minlr: 0.00001
57
+
@@ -0,0 +1,56 @@
1
+ Data:
2
+ mode: 'mono'
3
+ image_channels: ['image', 'peak_time']
4
+ mapping_settings:
5
+ mapping_method:
6
+ 'LSTCam': 'bilinear_interpolation'
7
+ 'FlashCam': 'bilinear_interpolation'
8
+ 'NectarCam': 'bilinear_interpolation'
9
+ 'CHEC': 'oversampling'
10
+ 'SCTCam': 'oversampling'
11
+ 'LSTSiPMCam': 'bilinear_interpolation'
12
+ 'MAGICCam': 'bilinear_interpolation'
13
+ padding:
14
+ 'LSTCam': 2
15
+ 'FlashCam': 2
16
+ 'NectarCam': 2
17
+ 'CHEC': 0
18
+ 'SCTCam': 0
19
+ 'LSTSiPMCam': 2
20
+ 'MAGICCam': 2
21
+ Input:
22
+ batch_size_per_worker: 64
23
+ concat_telescopes: false
24
+ Model:
25
+ name: 'SingleCNN'
26
+ backbone: {module: 'single_cnn', function: 'single_cnn_model'}
27
+ engine_img: {module: 'basic', function: 'conv_block'}
28
+ head: {module: 'head', function: 'standard_head'}
29
+ Model Parameters:
30
+ attention: {mechanism: 'Squeeze-and-Excitation', ratio: 16}
31
+ basic:
32
+ conv_block:
33
+ layers:
34
+ - {filters: 32, kernel_size: 3, number: 1}
35
+ - {filters: 32, kernel_size: 3, number: 1}
36
+ - {filters: 64, kernel_size: 3, number: 1}
37
+ - {filters: 128, kernel_size: 3, number: 1}
38
+ max_pool: {size: 2, strides: 2}
39
+ bottleneck: null
40
+ batchnorm: false
41
+ standard_head:
42
+ particletype: {fc_head: [512, 256], weight: 1.0}
43
+ energy: {fc_head: [512, 256], weight: 1.0}
44
+ direction: {fc_head: [512, 256], weight: 1.0}
45
+ Training:
46
+ validation_split: 0.1
47
+ num_epochs: 10
48
+ verbose: 2
49
+ workers: 1
50
+ optimizer: 'Adam'
51
+ adam_epsilon: 1.0e-8
52
+ base_learning_rate: 0.0001
53
+ lr_reducing_patience: 5
54
+ lr_reducing_factor: 0.5
55
+ lr_reducing_mindelta: 0.01
56
+ lr_reducing_minlr: 0.00001
@@ -0,0 +1,54 @@
1
+ Data:
2
+ mode: 'mono'
3
+ image_channels: ['image', 'peak_time']
4
+ mapping_settings:
5
+ mapping_method:
6
+ 'LSTCam': 'bilinear_interpolation'
7
+ 'FlashCam': 'bilinear_interpolation'
8
+ 'NectarCam': 'bilinear_interpolation'
9
+ 'CHEC': 'oversampling'
10
+ 'SCTCam': 'oversampling'
11
+ 'LSTSiPMCam': 'bilinear_interpolation'
12
+ 'MAGICCam': 'bilinear_interpolation'
13
+ padding:
14
+ 'LSTCam': 2
15
+ 'FlashCam': 2
16
+ 'NectarCam': 2
17
+ 'CHEC': 0
18
+ 'SCTCam': 0
19
+ 'LSTSiPMCam': 2
20
+ 'MAGICCam': 2
21
+ Input:
22
+ batch_size_per_worker: 64
23
+ concat_telescopes: false
24
+ Model:
25
+ name: 'ThinResNet'
26
+ backbone: {module: 'single_cnn', function: 'single_cnn_model'}
27
+ engine_img: {module: 'resnet', function: 'stacked_res_blocks'}
28
+ head: {module: 'head', function: 'standard_head'}
29
+ Model Parameters:
30
+ attention: {mechanism: 'Squeeze-and-Excitation', ratio: 16}
31
+ resnet:
32
+ stacked_res_blocks:
33
+ residual_block: 'bottleneck'
34
+ architecture:
35
+ - {filters: 48, blocks: 2}
36
+ - {filters: 96, blocks: 3}
37
+ - {filters: 128, blocks: 3}
38
+ - {filters: 256, blocks: 3}
39
+ standard_head:
40
+ particletype: {fc_head: [512, 256], weight: 1.0}
41
+ energy: {fc_head: [512, 256], weight: 1.0}
42
+ direction: {fc_head: [512, 256], weight: 1.0}
43
+ Training:
44
+ validation_split: 0.1
45
+ num_epochs: 10
46
+ verbose: 2
47
+ workers: 1
48
+ optimizer: 'Adam'
49
+ adam_epsilon: 1.0e-8
50
+ base_learning_rate: 0.0001
51
+ lr_reducing_patience: 5
52
+ lr_reducing_factor: 0.5
53
+ lr_reducing_mindelta: 0.01
54
+ lr_reducing_minlr: 0.00001
@@ -0,0 +1,58 @@
1
+ Data:
2
+ mode: 'mono'
3
+ waveform: 'calibrated'
4
+ waveform_sequence_length: 5
5
+ waveform_format: 'timechannel_last'
6
+ mapping_settings:
7
+ mapping_method:
8
+ 'LSTCam': 'bilinear_interpolation'
9
+ 'FlashCam': 'bilinear_interpolation'
10
+ 'NectarCam': 'bilinear_interpolation'
11
+ 'CHEC': 'oversampling'
12
+ 'SCTCam': 'oversampling'
13
+ 'LSTSiPMCam': 'bilinear_interpolation'
14
+ 'MAGICCam': 'bilinear_interpolation'
15
+ padding:
16
+ 'LSTCam': 2
17
+ 'FlashCam': 2
18
+ 'NectarCam': 2
19
+ 'CHEC': 0
20
+ 'SCTCam': 0
21
+ 'LSTSiPMCam': 2
22
+ 'MAGICCam': 2
23
+ Input:
24
+ batch_size_per_worker: 8
25
+ concat_telescopes: false
26
+ Model:
27
+ name: 'SingleCNN'
28
+ backbone: {module: 'single_cnn', function: 'single_cnn_model'}
29
+ engine_wvf: {module: 'basic', function: 'conv_block'}
30
+ head: {module: 'head', function: 'standard_head'}
31
+ Model Parameters:
32
+ attention: {mechanism: 'Squeeze-and-Excitation', ratio: 16}
33
+ basic:
34
+ conv_block:
35
+ layers:
36
+ - {filters: 32, kernel_size: 3, number: 1}
37
+ - {filters: 32, kernel_size: 3, number: 1}
38
+ - {filters: 64, kernel_size: 3, number: 1}
39
+ - {filters: 128, kernel_size: 3, number: 1}
40
+ max_pool: {size: 2, strides: 2}
41
+ bottleneck: null
42
+ batchnorm: false
43
+ standard_head:
44
+ particletype: {fc_head: [512, 256], weight: 1.0}
45
+ energy: {fc_head: [512, 256], weight: 1.0}
46
+ direction: {fc_head: [512, 256], weight: 1.0}
47
+ Training:
48
+ validation_split: 0.05
49
+ num_epochs: 10
50
+ verbose: 2
51
+ workers: 1
52
+ optimizer: 'Adam'
53
+ adam_epsilon: 1.0e-8
54
+ base_learning_rate: 0.0001
55
+ lr_reducing_patience: 5
56
+ lr_reducing_factor: 0.5
57
+ lr_reducing_mindelta: 0.01
58
+ lr_reducing_minlr: 0.00001
@@ -0,0 +1,56 @@
1
+ Data:
2
+ mode: 'mono'
3
+ waveform: 'calibrated'
4
+ waveform_sequence_length: 5
5
+ waveform_format: 'timechannel_last'
6
+ mapping_settings:
7
+ mapping_method:
8
+ 'LSTCam': 'bilinear_interpolation'
9
+ 'FlashCam': 'bilinear_interpolation'
10
+ 'NectarCam': 'bilinear_interpolation'
11
+ 'CHEC': 'oversampling'
12
+ 'SCTCam': 'oversampling'
13
+ 'LSTSiPMCam': 'bilinear_interpolation'
14
+ 'MAGICCam': 'bilinear_interpolation'
15
+ padding:
16
+ 'LSTCam': 2
17
+ 'FlashCam': 2
18
+ 'NectarCam': 2
19
+ 'CHEC': 0
20
+ 'SCTCam': 0
21
+ 'LSTSiPMCam': 2
22
+ 'MAGICCam': 2
23
+ Input:
24
+ batch_size_per_worker: 8
25
+ concat_telescopes: false
26
+ Model:
27
+ name: 'ThinResNetWave'
28
+ backbone: {module: 'single_cnn', function: 'single_cnn_model'}
29
+ engine_wvf: {module: 'resnet', function: 'stacked_res_blocks'}
30
+ head: {module: 'head', function: 'standard_head'}
31
+ Model Parameters:
32
+ attention: {mechanism: 'Squeeze-and-Excitation', ratio: 16}
33
+ resnet:
34
+ stacked_res_blocks:
35
+ residual_block: 'bottleneck'
36
+ architecture:
37
+ - {filters: 48, blocks: 2}
38
+ - {filters: 96, blocks: 3}
39
+ - {filters: 128, blocks: 3}
40
+ - {filters: 256, blocks: 3}
41
+ standard_head:
42
+ particletype: {fc_head: [512, 256], weight: 1.0}
43
+ energy: {fc_head: [512, 256], weight: 1.0}
44
+ direction: {fc_head: [512, 256], weight: 1.0}
45
+ Training:
46
+ validation_split: 0.05
47
+ num_epochs: 10
48
+ verbose: 2
49
+ workers: 1
50
+ optimizer: 'Adam'
51
+ adam_epsilon: 1.0e-8
52
+ base_learning_rate: 0.0001
53
+ lr_reducing_patience: 5
54
+ lr_reducing_factor: 0.5
55
+ lr_reducing_mindelta: 0.01
56
+ lr_reducing_minlr: 0.00001
@@ -0,0 +1,60 @@
1
+ Data:
2
+ mode: 'stereo'
3
+ image_channels: ['image', 'peak_time']
4
+ mapping_settings:
5
+ mapping_method:
6
+ 'LSTCam': 'bilinear_interpolation'
7
+ 'FlashCam': 'bilinear_interpolation'
8
+ 'NectarCam': 'bilinear_interpolation'
9
+ 'CHEC': 'oversampling'
10
+ 'SCTCam': 'oversampling'
11
+ 'LSTSiPMCam': 'bilinear_interpolation'
12
+ 'MAGICCam': 'bilinear_interpolation'
13
+ padding:
14
+ 'LSTCam': 2
15
+ 'FlashCam': 2
16
+ 'NectarCam': 2
17
+ 'CHEC': 0
18
+ 'SCTCam': 0
19
+ 'LSTSiPMCam': 2
20
+ 'MAGICCam': 2
21
+ Input:
22
+ batch_size_per_worker: 64
23
+ concat_telescopes: true
24
+ Model:
25
+ name: 'ThinResNet'
26
+ backbone: {module: 'single_cnn', function: 'single_cnn_model'}
27
+ engine_img: {module: 'resnet', function: 'stacked_res_blocks'}
28
+ head: {module: 'head', function: 'standard_head'}
29
+ Model Parameters:
30
+ attention: {mechanism: 'Squeeze-and-Excitation', ratio: 16}
31
+ resnet:
32
+ stacked_res_blocks:
33
+ residual_block: 'bottleneck'
34
+ architecture:
35
+ - {filters: 48, blocks: 2}
36
+ - {filters: 96, blocks: 3}
37
+ - {filters: 128, blocks: 3}
38
+ - {filters: 256, blocks: 3}
39
+ standard_head:
40
+ particletype: {fc_head: [512, 256], weight: 1.0}
41
+ energy: {fc_head: [512, 256], weight: 1.0}
42
+ direction: {fc_head: [512, 256], weight: 1.0}
43
+ Training:
44
+ validation_split: 0.1
45
+ num_epochs: 10
46
+ verbose: 2
47
+ workers: 1
48
+ optimizer: 'Adam'
49
+ adam_epsilon: 1.0e-8
50
+ base_learning_rate: 0.0001
51
+ lr_reducing_patience: 5
52
+ lr_reducing_factor: 0.5
53
+ lr_reducing_mindelta: 0.01
54
+ lr_reducing_minlr: 0.00001
55
+
56
+
57
+
58
+
59
+
60
+
@@ -0,0 +1,58 @@
1
+ Data:
2
+ mode: 'mono'
3
+ waveform: 'raw'
4
+ waveform_sequence_length: 5
5
+ waveform_format: 'timechannel_last'
6
+ mapping_settings:
7
+ mapping_method:
8
+ 'LSTCam': 'bilinear_interpolation'
9
+ 'FlashCam': 'bilinear_interpolation'
10
+ 'NectarCam': 'bilinear_interpolation'
11
+ 'CHEC': 'oversampling'
12
+ 'SCTCam': 'oversampling'
13
+ 'LSTSiPMCam': 'bilinear_interpolation'
14
+ 'MAGICCam': 'bilinear_interpolation'
15
+ padding:
16
+ 'LSTCam': 2
17
+ 'FlashCam': 2
18
+ 'NectarCam': 2
19
+ 'CHEC': 0
20
+ 'SCTCam': 0
21
+ 'LSTSiPMCam': 2
22
+ 'MAGICCam': 2
23
+ Input:
24
+ batch_size_per_worker: 8
25
+ concat_telescopes: false
26
+ Model:
27
+ name: 'SingleCNNWave'
28
+ backbone: {module: 'single_cnn', function: 'single_cnn_model'}
29
+ engine_wvf: {module: 'basic', function: 'conv_block'}
30
+ head: {module: 'head', function: 'standard_head'}
31
+ Model Parameters:
32
+ attention: {mechanism: 'Squeeze-and-Excitation', ratio: 16}
33
+ basic:
34
+ conv_block:
35
+ layers:
36
+ - {filters: 32, kernel_size: 3, number: 1}
37
+ - {filters: 32, kernel_size: 3, number: 1}
38
+ - {filters: 64, kernel_size: 3, number: 1}
39
+ - {filters: 128, kernel_size: 3, number: 1}
40
+ max_pool: {size: 2, strides: 2}
41
+ bottleneck: null
42
+ batchnorm: false
43
+ standard_head:
44
+ particletype: {fc_head: [512, 256], weight: 1.0}
45
+ energy: {fc_head: [512, 256], weight: 1.0}
46
+ direction: {fc_head: [512, 256], weight: 1.0}
47
+ Training:
48
+ validation_split: 0.05
49
+ num_epochs: 10
50
+ verbose: 2
51
+ workers: 1
52
+ optimizer: 'Adam'
53
+ adam_epsilon: 1.0e-8
54
+ base_learning_rate: 0.0001
55
+ lr_reducing_patience: 5
56
+ lr_reducing_factor: 0.5
57
+ lr_reducing_mindelta: 0.01
58
+ lr_reducing_minlr: 0.00001
@@ -0,0 +1,56 @@
1
+ Data:
2
+ mode: 'mono'
3
+ waveform: 'raw'
4
+ waveform_sequence_length: 5
5
+ waveform_format: 'timechannel_last'
6
+ mapping_settings:
7
+ mapping_method:
8
+ 'LSTCam': 'bilinear_interpolation'
9
+ 'FlashCam': 'bilinear_interpolation'
10
+ 'NectarCam': 'bilinear_interpolation'
11
+ 'CHEC': 'oversampling'
12
+ 'SCTCam': 'oversampling'
13
+ 'LSTSiPMCam': 'bilinear_interpolation'
14
+ 'MAGICCam': 'bilinear_interpolation'
15
+ padding:
16
+ 'LSTCam': 2
17
+ 'FlashCam': 2
18
+ 'NectarCam': 2
19
+ 'CHEC': 0
20
+ 'SCTCam': 0
21
+ 'LSTSiPMCam': 2
22
+ 'MAGICCam': 2
23
+ Input:
24
+ batch_size_per_worker: 8
25
+ concat_telescopes: false
26
+ Model:
27
+ name: 'ThinResNetWave'
28
+ backbone: {module: 'single_cnn', function: 'single_cnn_model'}
29
+ engine_wvf: {module: 'resnet', function: 'stacked_res_blocks'}
30
+ head: {module: 'head', function: 'standard_head'}
31
+ Model Parameters:
32
+ attention: {mechanism: 'Squeeze-and-Excitation', ratio: 16}
33
+ resnet:
34
+ stacked_res_blocks:
35
+ residual_block: 'bottleneck'
36
+ architecture:
37
+ - {filters: 48, blocks: 2}
38
+ - {filters: 96, blocks: 3}
39
+ - {filters: 128, blocks: 3}
40
+ - {filters: 256, blocks: 3}
41
+ standard_head:
42
+ particletype: {fc_head: [512, 256], weight: 1.0}
43
+ energy: {fc_head: [512, 256], weight: 1.0}
44
+ direction: {fc_head: [512, 256], weight: 1.0}
45
+ Training:
46
+ validation_split: 0.05
47
+ num_epochs: 10
48
+ verbose: 2
49
+ workers: 1
50
+ optimizer: 'Adam'
51
+ adam_epsilon: 1.0e-8
52
+ base_learning_rate: 0.0001
53
+ lr_reducing_patience: 5
54
+ lr_reducing_factor: 0.5
55
+ lr_reducing_mindelta: 0.01
56
+ lr_reducing_minlr: 0.00001