File size: 6,410 Bytes
fd4e297
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
backend: tensorflow

cache: caches/cms_gen

dataset:
  schema: cms
  target_particles: gen
  num_input_features: 42
#       NONE = 0,
#       TRACK = 1,
#       PS1 = 2,
#       PS2 = 3,
#       ECAL = 4,
#       HCAL = 5,
#       GSF = 6,
#       BREM = 7,
#       HFEM = 8,
#       HFHAD = 9,
#       SC = 10,
#       HO = 11,
  num_input_classes: 12
  #(none=0, ch.had=1, n.had=2, hfem=3, hfhad=4, gamma=5, e=6, mu=7)
  num_output_classes: 8
  padded_num_elem_size: 6400
  cls_weight_by_pt: no
  reg_weight_by_pt: no
  enable_tfds_caching: no

loss:
  classification_loss_coef: 100.0
  charge_loss_coef: 1.0
  pt_loss_coef: 1.0
  eta_loss_coef: 1.0
  sin_phi_loss_coef: 1.0
  cos_phi_loss_coef: 1.0
  energy_loss_coef: 1.0
  cls_loss:
    type: SigmoidFocalCrossEntropy
    from_logits: yes
    gamma: 2.0
  charge_loss:
    type: CategoricalCrossentropy
    from_logits: yes
  energy_loss:
    type: Huber
  pt_loss:
    type: Huber
  sin_phi_loss:
    type: Huber
    delta: 0.1
  cos_phi_loss:
    type: Huber
    delta: 0.1
  eta_loss:
    type: Huber
    delta: 0.1
  event_loss: none #none, sliced_wasserstein, gen_jet_logcosh, gen_jet_mse, hist_2d
  event_loss_coef: 1.0
  met_loss: none
  met_loss_coef: 1.0

tensorflow:
  eager: no

setup:
  train: yes
  weights:
  weights_config:
  lr: 0.00005
  num_epochs: 55
  dtype: float32
  trainable:
  lr_schedule: none  # cosinedecay, exponentialdecay, onecycle, none
  optimizer: adam  # adam, adamw, sgd
  horovod_enabled: no
  cls_output_as_logits: yes
  #if enabled, do not create LSH bins for small graphs (less than one bin size)
  #enabling results in some speedup for gun samples, but must be disabled for XLA
  small_graph_opt: yes
  use_normalizer: no

batching:
  # if enabled, use dynamic batching instead of the fixed-size batches configured in batch_per_gpu
  bucket_by_sequence_length: yes
  bucket_batch_sizes: auto
  batch_multiplier: 1

optimizer:
  adam:
    amsgrad: no
  adamw:
    amsgrad: yes
    weight_decay: 0.001
  sgd:
    nesterov: no
    momentum: 0.9

# LR Schedules
exponentialdecay:
  decay_steps: 2000
  decay_rate: 0.99
  staircase: yes
onecycle:
  mom_min: 0.85
  mom_max: 0.95
  warmup_ratio: 0.3
  div_factor: 25.0
  final_div: 100000.0

parameters:
  model: gnn_dense
  input_encoding: cms
  node_update_mode: additive
  do_node_encoding: yes
  node_encoding_hidden_dim: 512

  combined_graph_layer:
    bin_size: 640
    max_num_bins: 200
    distance_dim: 128
    layernorm: yes
    dropout: 0.0
    dist_activation: elu
    ffn_dist_num_layers: 2
    ffn_dist_hidden_dim: 128

    # GCN
    kernel:
      type: NodePairGaussianKernel
      dist_mult: 0.1
      clip_value_low: 0.0
      dist_norm: l2
    num_node_messages: 2
    node_message:
      type: GHConvDense
      output_dim: 512
      activation: elu
      #if this is enabled, it will break float16 training
      normalize_degrees: no
    activation: elu

  num_graph_layers_id: 3
  num_graph_layers_reg: 3
  output_decoding:
    activation: elu
    regression_use_classification: yes
    dropout: 0.1

    pt_as_correction: yes

    id_dim_decrease: yes
    charge_dim_decrease: yes
    pt_dim_decrease: yes
    eta_dim_decrease: yes
    phi_dim_decrease: yes
    energy_dim_decrease: yes

    id_hidden_dim: 512
    charge_hidden_dim: 256
    pt_hidden_dim: 512
    eta_hidden_dim: 256
    phi_hidden_dim: 256
    energy_hidden_dim: 512

    id_num_layers: 3
    charge_num_layers: 2
    pt_num_layers: 2
    eta_num_layers: 2
    phi_num_layers: 2
    energy_num_layers: 2
    layernorm: yes
    mask_reg_cls0: yes

  skip_connection: no
  debug: no

timing:
  num_ev: 100
  num_iter: 3

callbacks:
  checkpoint:
    monitor: "val_loss"
  plot_freq: 1
  tensorboard:
    dump_history: yes
    hist_freq: 1

hypertune:
  algorithm: hyperband  # random, bayesian, hyperband
  random:
    objective: val_loss
    max_trials: 100
  bayesian:
    objective: val_loss
    max_trials: 100
    num_initial_points: 2
  hyperband:
    objective: val_loss
    max_epochs: 10
    factor: 3
    iterations: 1
    executions_per_trial: 1

raytune:
  local_dir:  # Note: please specify an absolute path
  sched:  asha # asha, hyperband
  search_alg:  # bayes, bohb, hyperopt, nevergrad, scikit
  default_metric: "val_loss"
  default_mode: "min"
  # Tune schedule specific parameters
  asha:
    max_t: 200
    reduction_factor: 4
    brackets: 1
    grace_period: 10
  hyperband:
    max_t: 200
    reduction_factor: 4
  hyperopt:
    n_random_steps: 10
  nevergrad:
    n_random_steps: 10

train_test_datasets:
  multiparticlegun:
    batch_per_gpu: 1
    event_pad_size: -1
    datasets:
      - cms_pf_multi_particle_gun
  physical:
    batch_per_gpu: 1
    event_pad_size: -1
    datasets:
      - cms_pf_ttbar
      - cms_pf_ztt
      - cms_pf_qcd
      - cms_pf_qcd_high_pt
      - cms_pf_sms_t1tttt
  gun:
    batch_per_gpu: 50
    event_pad_size: -1
    datasets:
      - cms_pf_single_electron
      - cms_pf_single_gamma
      - cms_pf_single_neutron
      - cms_pf_single_pi0
      - cms_pf_single_pi
      - cms_pf_single_tau
      - cms_pf_single_mu
      - cms_pf_single_proton

evaluation_datasets:
  cms_pf_qcd_high_pt:
    batch_size: 5
    num_events: -1
  cms_pf_single_neutron:
    batch_size: 100
    num_events: -1

validation_dataset: cms_pf_qcd_high_pt
validation_batch_size: 5
validation_num_events: 500

evaluation_jet_algo: antikt_algorithm

datasets:
  cms_pf_ttbar:
    version: 1.6.0
    data_dir:
    manual_dir:
  cms_pf_ztt:
    version: 1.6.0
    data_dir:
    manual_dir:
  cms_pf_qcd:
    version: 1.6.0
    data_dir:
    manual_dir:
  cms_pf_qcd_high_pt:
    version: 1.6.0
    data_dir:
    manual_dir:
  cms_pf_single_electron:
    version: 1.6.0
    data_dir:
    manual_dir:
  cms_pf_single_gamma:
    version: 1.6.0
    data_dir:
    manual_dir:
  cms_pf_single_pi0:
    version: 1.6.0
    data_dir:
    manual_dir:
  cms_pf_single_neutron:
    version: 1.6.0
    data_dir:
    manual_dir:
  cms_pf_single_pi:
    version: 1.6.0
    data_dir:
    manual_dir:
  cms_pf_single_tau:
    version: 1.6.0
    data_dir:
    manual_dir:
  cms_pf_single_mu:
    version: 1.6.0
    data_dir:
    manual_dir:
  cms_pf_single_proton:
    version: 1.6.0
    data_dir:
    manual_dir:
  cms_pf_multi_particle_gun:
    version: 1.6.0
    data_dir:
    manual_dir:
  cms_pf_sms_t1tttt:
    version: 1.6.0
    data_dir:
    manual_dir: