-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathcmd.sh
976 lines (847 loc) · 58.4 KB
/
cmd.sh
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
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
# recap previous Dawei's training with new QCD sample
NGPUS=1
PREFIX=ak8_MD_split_cq ## needs modification
config=/home/olympus/licq/hww/incl-train/weaver-core/weaver/data_new/incl/${PREFIX//./_}.yaml
python /home/olympus/licq/hww/incl-train/weaver-core/weaver/train.py \
--batch-size 512 --start-lr 5e-3 --num-epochs 30 --optimizer ranger \
--gpus 1 --data-train \
'/home/olympus/licq/data/hww/tmp/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
'/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/BulkGravitonToHHTo4W_MX-600to6000_MH-15to250_JHUVariableWMass/*/*.root' \
'/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/ZprimeToTT_M1200to4500_W12to45_TuneCP2_PSweights/*/*.root' \
'/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/BulkGravToWWToWhadWhad_narrow_M-500to8000_TuneCP5/*/*.root' \
--samples-per-epoch $((15000 * 512 / $NGPUS)) --samples-per-epoch-val $((1000 * 512)) \
--data-config ${config} --num-workers 10 \
--network-config /home/olympus/licq/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv.py \
--model-prefix /home/olympus/licq/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net \
--log /home/olympus/licq/hww/incl-train/weaver-core/weaver/logs/${PREFIX}/pre_train.log --tensorboard _${PREFIX}
## pure test
NGPUS=2
PREFIX=ak8_MD_addHqq_pre1 ## needs modification
config=/home/olympus/licq/hww/incl-train/weaver-core/weaver/data_new/incl/${PREFIX//./_}.yaml
python /home/olympus/licq/hww/incl-train/weaver-core/weaver/train.py --gpus 1 \
--batch-size 512 --start-lr 1e-2 --num-epochs 30 --optimizer ranger \
--data-train \
'/home/olympus/licq/data/hww/tmp/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*00.root' \
'/home/olympus/licq/data/hww/tmp/BulkGravitonToHHTo4QTau_MX-600to6000_MH-15to250/*/*00.root' \
'/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/BulkGravitonToHHTo4W_MX-600to6000_MH-15to250_JHUVariableWMass/*/*00.root' \
'/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/ZprimeToTT_M1200to4500_W12to45_TuneCP2_PSweights/*/*0.root' \
'/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/BulkGravToWWToWhadWhad_narrow_M-500to8000_TuneCP5/*/*00.root' \
--samples-per-epoch $((7500 * 512)) --samples-per-epoch-val $((1000 * 512)) \
--data-config ${config} --num-workers 10 \
--network-config /home/olympus/licq/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv.py \
--model-prefix /home/olympus/licq/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net
# now start
# but first, let's generate reweighting map with full events
NGPUS=1
PREFIX=ak8_MD_addHqq_pre1 ## needs modification
config=/home/olympus/licq/hww/incl-train/weaver-core/weaver/data_new/incl/${PREFIX//./_}.yaml
python /home/olympus/licq/hww/incl-train/weaver-core/weaver/train.py \
--batch-size 512 --start-lr 5e-3 --num-epochs 30 --optimizer ranger \
--gpus 1 --data-train \
'/home/olympus/licq/data/hww/tmp/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
'/home/olympus/licq/data/hww/tmp/BulkGravitonToHHTo4QTau_MX-600to6000_MH-15to250/*/*.root' \
'/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/BulkGravitonToHHTo4W_MX-600to6000_MH-15to250_JHUVariableWMass/*/*.root' \
'/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/ZprimeToTT_M1200to4500_W12to45_TuneCP2_PSweights/*/*.root' \
'/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/BulkGravToWWToWhadWhad_narrow_M-500to8000_TuneCP5/*/*.root' \
--samples-per-epoch $((15000 * 512 / $NGPUS)) --samples-per-epoch-val $((1000 * 512)) \
--data-config ${config} --num-workers 10 \
--network-config /home/olympus/licq/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv.py \
--model-prefix /home/olympus/licq/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net \
--log /home/olympus/licq/hww/incl-train/weaver-core/weaver/logs/${PREFIX}/pre_train.log --tensorboard _${PREFIX}
NGPUS=1
PREFIX=ak8_MD_addHqq_pre2 ## needs modification
config=/home/olympus/licq/hww/incl-train/weaver-core/weaver/data_new/incl/${PREFIX//./_}.yaml
python /home/olympus/licq/hww/incl-train/weaver-core/weaver/train.py \
--batch-size 512 --start-lr 5e-3 --num-epochs 30 --optimizer ranger \
--gpus 1 --data-train \
'/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
'/mldata/licq/deepjetak8/20220915_ak8_UL17_v5/BulkGravitonToHHTo4QTau_MX-600to6000_MH-15to250/*/*.root' \
'/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/BulkGravitonToHHTo4W_MX-600to6000_MH-15to250_JHUVariableWMass/*/*.root' \
'/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/ZprimeToTT_M1200to4500_W12to45_TuneCP2_PSweights/*/*.root' \
'/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/BulkGravToWWToWhadWhad_narrow_M-500to8000_TuneCP5/*/*.root' \
--samples-per-epoch $((15000 * 512 / $NGPUS)) --samples-per-epoch-val $((1000 * 512)) \
--data-config ${config} --num-workers 10 \
--network-config /home/olympus/licq/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv.py \
--model-prefix /home/olympus/licq/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net \
--log /home/olympus/licq/hww/incl-train/weaver-core/weaver/logs/${PREFIX}/pre_train.log --tensorboard _${PREFIX}
# formal training
NGPUS=2
PREFIX=ak8_MD_addHqq_pre2 ## needs modification
config=/home/olympus/licq/hww/incl-train/weaver-core/weaver/data_new/incl/${PREFIX//./_}.yaml
CUDA_VISIBLE_DEVICES=1,2 torchrun --standalone --nnodes=1 --nproc_per_node=$NGPUS /home/olympus/licq/hww/incl-train/weaver-core/weaver/train.py \
--batch-size 512 --start-lr 5e-3 --num-epochs 30 --optimizer ranger \
--backend nccl --data-train \
'/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
'/mldata/licq/deepjetak8/20220915_ak8_UL17_v5/BulkGravitonToHHTo4QTau_MX-600to6000_MH-15to250/*/*.root' \
'/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/BulkGravitonToHHTo4W_MX-600to6000_MH-15to250_JHUVariableWMass/*/*.root' \
'/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/ZprimeToTT_M1200to4500_W12to45_TuneCP2_PSweights/*/*.root' \
'/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/BulkGravToWWToWhadWhad_narrow_M-500to8000_TuneCP5/*/*.root' \
--samples-per-epoch $((15000 * 512 / $NGPUS)) --samples-per-epoch-val $((1000 * 512)) \
--data-config ${config} --num-workers 10 \
--network-config /home/olympus/licq/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv.py \
--model-prefix /home/olympus/licq/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net \
--log /home/olympus/licq/hww/incl-train/weaver-core/weaver/logs/${PREFIX}/train.log --tensorboard _${PREFIX}
############
# now starts inference
# HWW: higgs signal vs. QCD
GPU=0
PREFIX=ak8_MD_split_cq ## needs modification
config=/home/olympus/licq/hww/incl-train/weaver-core/weaver/data_new/incl/${PREFIX//./_}_infer.yaml
python /home/olympus/licq/hww/incl-train/weaver-core/weaver/train.py --predict \
--data-test \
'hww:/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/GluGluToBulkGravitonToHHTo4W_JHUGen_M-1000_narrow/*/*.root' \
'qcd:/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
--data-config ${config} \
--network-config /home/olympus/licq/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv.py \
--model-prefix /home/olympus/fudawei/tagger/boosted-HWW/model/$PREFIX/_best_epoch_state.pt \
--gpus ${GPU} --batch-size 512 --start-lr 5e-3 --num-workers 3 \
--predict-output /home/olympus/licq/hww/incl-train/weaver-core/weaver/predict/$PREFIX/pred.root
# HWW previous v1 (fake)
GPU=0
PREFIX=ak8_MD_sdmass_5PIDvar_previous ## needs modification
config=/home/olympus/licq/hww/incl-train/weaver-core/weaver/data_new/incl/${PREFIX//./_}_infer.yaml
python /home/olympus/licq/hww/incl-train/weaver-core/weaver/train.py --predict \
--data-test \
'hww:/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/GluGluToBulkGravitonToHHTo4W_JHUGen_M-1000_narrow/*/*.root' \
'qcd:/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
--data-config ${config} \
--network-config /home/olympus/licq/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv.py \
--model-prefix /home/olympus/fudawei/tagger/boosted-HWW/model/$PREFIX/_best_epoch_state.pt \
--gpus ${GPU} --batch-size 512 --start-lr 5e-3 --num-workers 6 \
--predict-output /home/olympus/licq/hww/incl-train/weaver-core/weaver/predict/$PREFIX/pred.root
# real v1
GPU=0
PREFIX=ak8_MD_HWWv1 ## needs modification
config=/home/olympus/licq/hww/incl-train/weaver-core/weaver/data_new/incl/ak8_MD_sdmass_5PIDvar_previous_infer.yaml
python /home/olympus/licq/hww/incl-train/weaver-core/weaver/train.py --predict \
--data-test \
'hww:/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/GluGluToBulkGravitonToHHTo4W_JHUGen_M-1000_narrow/*/*.root' \
'qcd:/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
--data-config ${config} \
--network-config /home/olympus/licq/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv.py \
--model-prefix /home/olympus/fudawei/weaver/output/hwwVsQCD/pnet.hwwVsQCD.sdmass.fine.addis.20million/pnet.hwwVsQCD.sdmass.fine.addis.20million \
--gpus ${GPU} --batch-size 512 --start-lr 5e-3 --num-workers 6 \
--predict-output /home/olympus/licq/hww/incl-train/weaver-core/weaver/predict/$PREFIX/pred.root
# real v1 updated (0921, with new v1 training from Dawei)
GPU=0
PREFIX=ak8_MD_HWWv1_retrain ## needs modification
config=/home/olympus/licq/hww/incl-train/weaver-core/weaver/data_new/incl/ak8_MD_sdmass_5PIDvar_previous_infer.yaml
python /home/olympus/licq/hww/incl-train/weaver-core/weaver/train.py --predict \
--data-test \
'hww:/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/GluGluToBulkGravitonToHHTo4W_JHUGen_M-1000_narrow/*/*.root' \
'qcd:/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
--data-config ${config} \
--network-config /home/olympus/licq/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv.py \
--model-prefix /home/olympus/fudawei/tagger/boosted-HWW/model/ak8_MD_v1/_best_epoch_state.pt \
--gpus ${GPU} --batch-size 512 --start-lr 5e-3 --num-workers 6 \
--predict-output /home/olympus/licq/hww/incl-train/weaver-core/weaver/predict/$PREFIX/pred.root
# Hbb: original higgs->bb sig vs. QCD
GPU=3
PREFIX=ak8_points_pf_sv_mass_decorr ## needs modification
config=/home/olympus/licq/hww/incl-train/weaver-core/weaver/data_new/legacy/${PREFIX//./_}.yaml
python /home/olympus/licq/hww/incl-train/weaver-core/weaver/train.py --predict \
--data-test \
'xqq:/mldata/licq/deepjetak8/20220915_ak8_UL17_v5/BulkGravitonToHHTo4QTau_MX-600to6000_MH-15to250/*/*0.root' \
'hqq:/mldata/licq/deepjetak8/20200601_ak8_UL17/GluGluToBulkGravitonToHHTo4B_M-1000_narrow_WZHtag_TuneCP5_PSWeights_13TeV-madgraph-pythia8/*/*/*/*.root' \
'qcd:/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
--data-config ${config} \
--network-config /home/olympus/licq/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv.py \
--model-prefix /home/olympus/licq/hww/incl-train/weaver-core/weaver/model/legacy/ParticleNetMD_UL.pt \
--gpus ${GPU} --batch-size 512 --start-lr 5e-3 --num-workers 6 \
--predict-output /home/olympus/licq/hww/incl-train/weaver-core/weaver/predict/$PREFIX/pred.root
# latest incl sample
GPU=1
PREFIX=ak8_MD_addHqq_pre2 ## needs modification
config=/home/olympus/licq/hww/incl-train/weaver-core/weaver/data_new/incl/${PREFIX//./_}_infer2.yaml
python /home/olympus/licq/hww/incl-train/weaver-core/weaver/train.py --predict \
--data-test \
'xqq:/mldata/licq/deepjetak8/20220915_ak8_UL17_v5/BulkGravitonToHHTo4QTau_MX-600to6000_MH-15to250/*/*0.root' \
'hww:/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/GluGluToBulkGravitonToHHTo4W_JHUGen_M-1000_narrow/*/*.root' \
'qcd:/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
'ttbar:/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/ZprimeToTT_M1200to4500_W12to45_TuneCP2_PSweights/*/*.root' \
--data-config ${config} \
--network-config /home/olympus/licq/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv.py \
--model-prefix /home/olympus/licq/hww/incl-train/weaver-core/weaver/model/$PREFIX/net \
--gpus ${GPU} --batch-size 512 --start-lr 5e-3 --num-workers 6 \
--predict-output /home/olympus/licq/hww/incl-train/weaver-core/weaver/predict/$PREFIX/pred.root
### 22.10.01
# Regresion
### test
NGPUS=2
PREFIX=ak8_MD_hwwOnly ## needs modification
config=/home/olympus/licq/hww/incl-train/weaver-core/weaver/data_new/regression/${PREFIX//./_}.yaml
python /home/olympus/licq/hww/incl-train/weaver-core/weaver/train.py --regression-mode \
--batch-size 512 --start-lr 5e-3 --num-epochs 30 --optimizer ranger \
--gpus 1 --data-train \
'/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/BulkGravitonToHHTo4W_MX-600to6000_MH-15to250_JHUVariableWMass/*/*.root' \
--samples-per-epoch $((15000 * 512 / $NGPUS)) --samples-per-epoch-val $((1000 * 512)) \
--data-config ${config} --num-workers 10 \
--network-config /home/olympus/licq/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv_mass_regression.py \
--model-prefix /home/olympus/licq/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net \
--log /home/olympus/licq/hww/incl-train/weaver-core/weaver/logs/${PREFIX}/pre_train.log
# formal run
CUDA_VISIBLE_DEVICES=0,1 torchrun --standalone --nnodes=1 --nproc_per_node=$NGPUS /home/olympus/licq/hww/incl-train/weaver-core/weaver/train.py --regression-mode \
--batch-size 512 --start-lr 5e-3 --num-epochs 30 --optimizer ranger \
--backend nccl --data-train \
'/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/BulkGravitonToHHTo4W_MX-600to6000_MH-15to250_JHUVariableWMass/*/*.root' \
--samples-per-epoch $((15000 * 512 / $NGPUS)) --samples-per-epoch-val $((1000 * 512)) \
--data-config ${config} --num-workers 10 \
--network-config /home/olympus/licq/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv_mass_regression.py \
--model-prefix /home/olympus/licq/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net \
--log /home/olympus/licq/hww/incl-train/weaver-core/weaver/logs/${PREFIX}/train.log --tensorboard _${PREFIX}
# prediction
GPU=0
PREFIX=ak8_MD_hwwOnly ## needs modification
config=/home/olympus/licq/hww/incl-train/weaver-core/weaver/data_new/regression/${PREFIX//./_}_infer.yaml
python /home/olympus/licq/hww/incl-train/weaver-core/weaver/train.py --train-mode regression --predict \
--data-test \
'hww:/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/GluGluToBulkGravitonToHHTo4W_JHUGen_M-1000_narrow/*/*.root' \
--data-config ${config} \
--network-config /home/olympus/licq/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv.py \
--model-prefix /home/olympus/licq/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net \
--gpus ${GPU} --batch-size 512 --start-lr 5e-3 --num-workers 3 \
--predict-output /home/olympus/licq/hww/incl-train/weaver-core/weaver/predict/$PREFIX/pred.root
## 22.10.06
# get factors first
NGPUS=1
PREFIX=ak8_MD_vmincl_pre3 ## needs modification
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/incl/${PREFIX//./_}.yaml
DATAPATH=/mldata/licq/deepjetak8
python $HOME/hww/incl-train/weaver-core/weaver/train.py \
--batch-size 512 --start-lr 5e-3 --num-epochs 30 --optimizer ranger \
--gpus 1 --data-train \
$DATAPATH'/20220625_ak8_UL17_v4/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
$DATAPATH'/20220915_ak8_UL17_v5/BulkGravitonToHHTo4QTau_MX-600to6000_MH-15to250/*/*.root' \
$DATAPATH'/20220625_ak8_UL17_v4/BulkGravitonToHHTo4W_MX-600to6000_MH-15to250_JHUVariableWMass/*/*.root' \
$DATAPATH'/20220915_ak8_UL17_v5/Spin0ToTT_VariableMass_W*_MX-600to6000_MH-15to250/*/*.root' \
--samples-per-epoch $((15000 * 512 / $NGPUS)) --samples-per-epoch-val $((1000 * 512)) \
--data-config ${config} --num-workers 10 \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net \
--log $HOME/hww/incl-train/weaver-core/weaver/logs/${PREFIX}/pre_train.log
# formal training
NGPUS=4
PREFIX=ak8_MD_vmincl_pre3 ## needs modification
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/incl/${PREFIX//./_}.yaml
DATAPATH=/mldata/licq/deepjetak8
CUDA_VISIBLE_DEVICES=0,1,2,3 torchrun --standalone --nnodes=1 --nproc_per_node=$NGPUS $HOME/hww/incl-train/weaver-core/weaver/train.py \
--batch-size 512 --start-lr 5e-3 --num-epochs 30 --optimizer ranger \
--backend nccl --data-train \
$DATAPATH'/20220625_ak8_UL17_v4/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
$DATAPATH'/20220915_ak8_UL17_v5/BulkGravitonToHHTo4QTau_MX-600to6000_MH-15to250/*/*.root' \
$DATAPATH'/20220625_ak8_UL17_v4/BulkGravitonToHHTo4W_MX-600to6000_MH-15to250_JHUVariableWMass/*/*.root' \
$DATAPATH'/20220915_ak8_UL17_v5/Spin0ToTT_VariableMass_W*_MX-600to6000_MH-15to250/*/*.root' \
--samples-per-epoch $((15000 * 512 / $NGPUS)) --samples-per-epoch-val $((1000 * 512)) \
--data-config ${config} --num-workers 5 \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net \
--log $HOME/hww/incl-train/weaver-core/weaver/logs/${PREFIX}/train.log --tensorboard _${PREFIX}
# predict
GPU=0
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/incl/${PREFIX//./_}_infer.yaml
python $HOME/hww/incl-train/weaver-core/weaver/train.py --predict \
--data-test \
'xqq:/mldata/licq/deepjetak8/20220915_ak8_UL17_v5/BulkGravitonToHHTo4QTau_MX-600to6000_MH-15to250/*/*0.root' \
'hww:/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/GluGluToBulkGravitonToHHTo4W_JHUGen_M-1000_narrow/*/*.root' \
'qcd:/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
'ttbar:/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/ZprimeToTT_M1200to4500_W12to45_TuneCP2_PSweights/*/*.root' \
--data-config ${config} \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/$PREFIX/net \
--gpus ${GPU} --batch-size 512 --start-lr 5e-3 --num-workers 6 \
--predict-output $HOME/hww/incl-train/weaver-core/weaver/predict/$PREFIX/pred.root
### 10.08 test training on ParT
NGPUS=1
PREFIX=ak8_MD_vminclParT_test ## needs modification
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/incl/${PREFIX//./_}.yaml
DATAPATH=/mldata/licq/deepjetak8
python $HOME/hww/incl-train/weaver-core/weaver/train.py \
--use-amp --batch-size 512 --start-lr 1e-3 --num-epochs 30 --optimizer ranger \
--gpus 1 --data-train \
$DATAPATH'/20220625_ak8_UL17_v4/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
$DATAPATH'/20220915_ak8_UL17_v5/BulkGravitonToHHTo4QTau_MX-600to6000_MH-15to250/*/*.root' \
$DATAPATH'/20220625_ak8_UL17_v4/BulkGravitonToHHTo4W_MX-600to6000_MH-15to250_JHUVariableWMass/*/*.root' \
$DATAPATH'/20220915_ak8_UL17_v5/Spin0ToTT_VariableMass_W*_MX-600to6000_MH-15to250/*/*.root' \
--samples-per-epoch $((15000 * 512 / $NGPUS)) --samples-per-epoch-val $((1000 * 512)) \
--data-config ${config} --num-workers 10 \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/example_ParticleTransformerTagger.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net
## 10.10 test cls+regression
NGPUS=1
PREFIX=ak8_MD_vmincl_pre3_addreg_manual ## needs modification
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/incl/${PREFIX//./_}.yaml
python $HOME/hww/incl-train/weaver-core/weaver/train.py --train-mode hybrid -o loss_gamma 0.05 \
--batch-size 512 --start-lr 5e-3 --num-epochs 30 --optimizer ranger \
--gpus 1 --data-train \
'/mldata/licq/deepjetak8/20220625_ak8_UL17_v4/BulkGravitonToHHTo4W_MX-600to6000_MH-15to250_JHUVariableWMass/*/*00.root' \
--samples-per-epoch $((5 * 512 / $NGPUS)) --samples-per-epoch-val $((5 * 512)) \
--data-config ${config} --num-workers 10 \
--network-config /home/olympus/licq/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv_hybrid.py \
--model-prefix /home/olympus/licq/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net
## formal training on ParticleNet
NGPUS=4
PREFIX=ak8_MD_vmincl_pre3_addreg_manual ## needs modification
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/incl/${PREFIX//./_}.yaml
DATAPATH=/mldata/licq/deepjetak8
CUDA_VISIBLE_DEVICES=0,1,2,3 torchrun --standalone --nnodes=1 --nproc_per_node=$NGPUS $HOME/hww/incl-train/weaver-core/weaver/train.py \
--train-mode hybrid -o loss_gamma 0.05 \
--batch-size 512 --start-lr 5e-3 --num-epochs 30 --optimizer ranger \
--backend nccl --data-train \
$DATAPATH'/20220625_ak8_UL17_v4/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
$DATAPATH'/20220915_ak8_UL17_v5/BulkGravitonToHHTo4QTau_MX-600to6000_MH-15to250/*/*.root' \
$DATAPATH'/20220625_ak8_UL17_v4/BulkGravitonToHHTo4W_MX-600to6000_MH-15to250_JHUVariableWMass/*/*.root' \
$DATAPATH'/20220915_ak8_UL17_v5/Spin0ToTT_VariableMass_W*_MX-600to6000_MH-15to250/*/*.root' \
--samples-per-epoch $((15000 * 512 / $NGPUS)) --samples-per-epoch-val $((1000 * 512)) \
--data-config ${config} --num-workers 5 \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv_hybrid.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net \
--log $HOME/hww/incl-train/weaver-core/weaver/logs/${PREFIX}/train.log --tensorboard _${PREFIX}
# predict
GPU=0
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/incl/${PREFIX//./_}.yaml
# hqq is added after v6
python $HOME/hww/incl-train/weaver-core/weaver/train.py --predict \
--train-mode hybrid -o loss_gamma 0.05 --batch-size 512 --num-workers 3 \
--gpus ${GPU} --data-test \
'hww:'$DATAPATH'/20220625_ak8_UL17_v4/GluGluToBulkGravitonToHHTo4W_JHUGen_M-1000_narrow/*/*.root' \
'xqq:'$DATAPATH'/20220915_ak8_UL17_v5/BulkGravitonToHHTo4QTau_MX-600to6000_MH-15to250/*/*0.root' \
'qcd:'$DATAPATH'/20220625_ak8_UL17_v4/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
'ttbar:'$DATAPATH'/20220625_ak8_UL17_v4/ZprimeToTT_M1200to4500_W12to45_TuneCP2_PSweights/*/*.root' \
'hqq:'$DATAPATH'/20221023_ak8_UL17_v6/GluGluToBulkGravitonToHHTo4QTau_M-1000_narrow/*/*.root' \
--data-config ${config} \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv_hybrid.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/$PREFIX/net \
--predict-output $HOME/hww/incl-train/weaver-core/weaver/predict/$PREFIX/pred.root
python $HOME/hww/incl-train/weaver-core/weaver/train.py --predict \
--batch-size 512 --num-workers 3 \
--gpus ${GPU} --data-test \
'hww:'$DATAPATH'/20220625_ak8_UL17_v4/GluGluToBulkGravitonToHHTo4W_JHUGen_M-1000_narrow/*/*.root' \
'xqq:'$DATAPATH'/20220915_ak8_UL17_v5/BulkGravitonToHHTo4QTau_MX-600to6000_MH-15to250/*/*0.root' \
'qcd:'$DATAPATH'/20220625_ak8_UL17_v4/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
'ttbar:'$DATAPATH'/20220625_ak8_UL17_v4/ZprimeToTT_M1200to4500_W12to45_TuneCP2_PSweights/*/*.root' \
'hqq:'$DATAPATH'/20221023_ak8_UL17_v6/GluGluToBulkGravitonToHHTo4QTau_M-1000_narrow/*/*.root' \
--data-config ${config} \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/$PREFIX/net \
--predict-output $HOME/hww/incl-train/weaver-core/weaver/predict/$PREFIX/pred.root
python $HOME/hww/incl-train/weaver-core/weaver/train.py --predict \
--train-mode hybrid -o loss_gamma 0.05 --batch-size 512 --num-workers 3 \
--gpus ${GPU} --data-test \
'hww:'$DATAPATH'/20220625_ak8_UL17_v4/GluGluToBulkGravitonToHHTo4W_JHUGen_M-1000_narrow/*/*.root' \
'xqq:'$DATAPATH'/20220915_ak8_UL17_v5/BulkGravitonToHHTo4QTau_MX-600to6000_MH-15to250/*/*0.root' \
'qcd:'$DATAPATH'/20220625_ak8_UL17_v4/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
'ttbar:'$DATAPATH'/20220625_ak8_UL17_v4/ZprimeToTT_M1200to4500_W12to45_TuneCP2_PSweights/*/*.root' \
'hqq:'$DATAPATH'/20221023_ak8_UL17_v6/GluGluToBulkGravitonToHHTo4QTau_M-1000_narrow/*/*.root' \
--data-config ${config} \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/example_ParticleTransformerTagger_hybrid.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/$PREFIX/net \
--predict-output $HOME/hww/incl-train/weaver-core/weaver/predict/$PREFIX/pred.root
## 10.12 finally, comes the last story
# get reweight factors
NGPUS=1
PREFIX=ak8_MD_vminclv2_pre2 ## needs modification
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/incl/${PREFIX//./_}.yaml
DATAPATH=/mldata/licq/deepjetak8
python $HOME/hww/incl-train/weaver-core/weaver/train.py \
--train-mode hybrid -o loss_gamma 0.05 \
--batch-size 512 --start-lr 5e-3 --num-epochs 30 --optimizer ranger \
--gpus 0 --data-train \
$DATAPATH'/20220625_ak8_UL17_v4/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
$DATAPATH'/20220915_ak8_UL17_v5/BulkGravitonToHHTo4QTau_MX-600to6000_MH-15to250/*/*.root' \
$DATAPATH'/20220625_ak8_UL17_v4/BulkGravitonToHHTo4W_MX-600to6000_MH-15to250_JHUVariableWMass/*/*.root' \
$DATAPATH'/20220915_ak8_UL17_v5/Spin0ToTT_VariableMass_W*_MX-600to6000_MH-15to250/*/*.root' \
--samples-per-epoch $((15000 * 512 / $NGPUS)) --samples-per-epoch-val $((1000 * 512)) \
--data-config ${config} --num-workers 3 \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv_hybrid.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net \
--log $HOME/hww/incl-train/weaver-core/weaver/logs/${PREFIX}/pre_train.log
# formal training
NGPUS=4
PREFIX=ak8_MD_vminclv2_pre2 ## needs modification
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/incl/${PREFIX//./_}.yaml
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/incl/${PREFIX//./_}_inferhqq.yaml
DATAPATH=/mldata/licq/deepjetak8
CUDA_VISIBLE_DEVICES=0,1,2,3 torchrun --standalone --nnodes=1 --nproc_per_node=$NGPUS $HOME/hww/incl-train/weaver-core/weaver/train.py \
--train-mode hybrid -o loss_gamma 0.05 \
--batch-size 512 --start-lr 5e-3 --num-epochs 30 --optimizer ranger \
--backend nccl --data-train \
$DATAPATH'/20220625_ak8_UL17_v4/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
$DATAPATH'/20220915_ak8_UL17_v5/BulkGravitonToHHTo4QTau_MX-600to6000_MH-15to250/*/*.root' \
$DATAPATH'/20220625_ak8_UL17_v4/BulkGravitonToHHTo4W_MX-600to6000_MH-15to250_JHUVariableWMass/*/*.root' \
$DATAPATH'/20220915_ak8_UL17_v5/Spin0ToTT_VariableMass_W*_MX-600to6000_MH-15to250/*/*.root' \
--samples-per-epoch $((15000 * 512 / $NGPUS)) --samples-per-epoch-val $((1000 * 512)) \
--data-config ${config} --num-workers 5 \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv_hybrid.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net \
--log $HOME/hww/incl-train/weaver-core/weaver/logs/${PREFIX}/train.log --tensorboard _${PREFIX}
## actually also rerun it in the original mode (10.25)
NGPUS=4
PREFIX=ak8_MD_vminclv2_pre2_noreg_manual ## needs modification
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/incl/${PREFIX//./_}.yaml
DATAPATH=/mldata/licq/deepjetak8
CUDA_VISIBLE_DEVICES=0,1,2,3 torchrun --standalone --nnodes=1 --nproc_per_node=$NGPUS $HOME/hww/incl-train/weaver-core/weaver/train.py \
--batch-size 512 --start-lr 5e-3 --num-epochs 30 --optimizer ranger \
--backend nccl --data-train \
$DATAPATH'/20220625_ak8_UL17_v4/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
$DATAPATH'/20220915_ak8_UL17_v5/BulkGravitonToHHTo4QTau_MX-600to6000_MH-15to250/*/*.root' \
$DATAPATH'/20220625_ak8_UL17_v4/BulkGravitonToHHTo4W_MX-600to6000_MH-15to250_JHUVariableWMass/*/*.root' \
$DATAPATH'/20220915_ak8_UL17_v5/Spin0ToTT_VariableMass_W*_MX-600to6000_MH-15to250/*/*.root' \
--samples-per-epoch $((15000 * 512 / $NGPUS)) --samples-per-epoch-val $((1000 * 512)) \
--data-config ${config} --num-workers 5 \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net \
--log $HOME/hww/incl-train/weaver-core/weaver/logs/${PREFIX}/train.log --tensorboard _${PREFIX}
# and for inference
DATAPATH=/data/pubfs/licq/deepjetak8
## 10.13 export ParT model...
## first let's test previous ParT
GPU=0
PREFIX=ak8_MD_vminclParT_addreg_manual
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/incl/${PREFIX//./_}.yaml
DATAPATH=/data/licq/samples/deepjetak8
python $HOME/hww/incl-train/weaver-core/weaver/train.py \
--train-mode hybrid -o loss_gamma 0.05 \
--use-amp \
--data-config ${config} \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/example_ParticleTransformerTagger_hybrid_outputWithHidNeurons.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/$PREFIX/net_best_epoch_state.pt \
--export-onnx $HOME/hww/incl-train/weaver-core/weaver/model/$PREFIX/model_opset14.onnx
# also try exporting previous v1 model again, with the new config
GPU=0
PREFIX=ak8_MD_HWWv1 ## needs modification
config=/home/olympus/licq/hww/incl-train/weaver-core/weaver/data_new/incl/ak8_MD_sdmass_5PIDvar_previous_infer.yaml
python $HOME/hww/incl-train/weaver-core/weaver/train.py \
--data-config ${config} \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv.py \
--model-prefix /home/olympus/fudawei/weaver/output/hwwVsQCD/pnet.hwwVsQCD.sdmass.fine.addis.20million/pnet.hwwVsQCD.sdmass.fine.addis.20million_best_epoch_state.pt \
--export-onnx $HOME/hww/incl-train/weaver-core/weaver/model/$PREFIX/model.onnx
## okay finally we do some onnx val
GPU=0
PREFIX=ak8_MD_vminclParT_addreg_manual
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/incl/${PREFIX//./_}.yaml
python $HOME/hww/incl-train/weaver-core/weaver/train.py --predict \
--train-mode hybrid -o loss_gamma 0.05 \
--use-amp --batch-size 512 --num-workers 3 \
--gpus ${GPU} --data-test \
'hww_onnxtest:/home/olympus/licq/hww/incl-train/data/output_onnxtest.root' \
--data-config ${config} \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/example_ParticleTransformerTagger_hybrid.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/$PREFIX/net \
--predict-output $HOME/hww/incl-train/weaver-core/weaver/predict/$PREFIX/pred.root
GPU=0
PREFIX=ak8_MD_HWWv1 ## needs modification
config=/home/olympus/licq/hww/incl-train/weaver-core/weaver/data_new/incl/ak8_MD_sdmass_5PIDvar_previous_infer.yaml
python /home/olympus/licq/hww/incl-train/weaver-core/weaver/train.py --predict \
--data-test \
'hww_onnxtest:/home/olympus/licq/hww/incl-train/data/output_onnxtest.root' \
--data-config ${config} \
--network-config /home/olympus/licq/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv.py \
--model-prefix /home/olympus/fudawei/weaver/output/hwwVsQCD/pnet.hwwVsQCD.sdmass.fine.addis.20million/pnet.hwwVsQCD.sdmass.fine.addis.20million \
--gpus ${GPU} --batch-size 512 --start-lr 5e-3 --num-workers 6 \
--predict-output /home/olympus/licq/hww/incl-train/weaver-core/weaver/predict/$PREFIX/pred.root
# so you know it's because wrap?
GPU=0
PREFIX=ak8_MD_vminclParT_addreg_manual
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/incl/${PREFIX//./_}_fixwrap.yaml
python $HOME/hww/incl-train/weaver-core/weaver/train.py --predict \
--train-mode hybrid -o loss_gamma 0.05 \
--use-amp --batch-size 512 --num-workers 3 \
--gpus ${GPU} --data-test \
'hww_onnxtest_fixwrap:/home/olympus/licq/hww/incl-train/data/output_onnxtest.root' \
--data-config ${config} \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/example_ParticleTransformerTagger_hybrid.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/$PREFIX/net \
--predict-output $HOME/hww/incl-train/weaver-core/weaver/predict/$PREFIX/pred.root
## one last step! exporting onnx...
GPU=0
PREFIX=ak8_MD_vminclv2ParT_manual_fixwrap
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/incl/${PREFIX//./_}.yaml
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/incl/${PREFIX//./_}_inferhqq.yaml
python $HOME/hww/incl-train/weaver-core/weaver/train.py \
--train-mode hybrid -o loss_gamma 0.05 \
--use-amp \
--data-config ${config} \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/example_ParticleTransformerTagger_hybrid_outputWithHidNeurons.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/$PREFIX/net_best_epoch_state.pt \
--export-onnx $HOME/hww/incl-train/weaver-core/weaver/model/$PREFIX/model.onnx
##################################
# fine-tune
NGPUS=1
PREFIX=ak8_rawscores_topVsQCD_manual_pre1.0layer ## needs modification
PREFIX=ak8_hidneurons_topVsQCD_manual_pre1.0layer ## needs modification
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/finetune/${PREFIX%%.*}.yaml
DATAPATH=/mldata/licq/deepjetak8
python $HOME/hww/incl-train/weaver-core/weaver/train.py \
--batch-size 512 --start-lr 2e-2 --num-epochs 30 --optimizer ranger \
--gpus 0 --data-train \
$DATAPATH'/20221023_ak8_UL17_v6/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/*/*.root' \
$DATAPATH'/20221023_ak8_UL17_v6/ZprimeToTT_M1200to4500_W12to45_TuneCP2_PSweights/*/*.root' \
--samples-per-epoch $((500 * 512 / $NGPUS)) --samples-per-epoch-val $((500 * 512)) \
--data-config ${config} --num-workers 30 \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/mlp.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net \
--log $HOME/hww/incl-train/weaver-core/weaver/logs/${PREFIX}/train_{auto}.log --tensorboard _${PREFIX}_{auto}
GPU=0
python $HOME/hww/incl-train/weaver-core/weaver/train.py --predict \
--batch-size 512 --num-workers 3 \
--gpus ${GPU} --data-test \
'qcd:'$DATAPATH'/20221023_ak8_UL17_v6/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
'ttbar:'$DATAPATH'/20221023_ak8_UL17_v6/ZprimeToTT_M1200to4500_W12to45_TuneCP2_PSweights/*/*.root' \
--data-config ${config} \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/mlp.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/$PREFIX/net \
--predict-output $HOME/hww/incl-train/weaver-core/weaver/predict/$PREFIX/pred.root
# try 2-path mlp
NGPUS=1
PREFIX=ak8_rawscores_topVsQCD_manual_pre2 ## needs modification
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/finetune/${PREFIX%%.*}.yaml
DATAPATH=/mldata/licq/deepjetak8
python $HOME/hww/incl-train/weaver-core/weaver/train.py \
--batch-size 512 --start-lr 2e-2 --num-epochs 30 --optimizer ranger \
--gpus 2 --data-train \
$DATAPATH'/20221023_ak8_UL17_v6/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/*/*.root' \
$DATAPATH'/20221023_ak8_UL17_v6/ZprimeToTT_M1200to4500_W12to45_TuneCP2_PSweights/*/*.root' \
--samples-per-epoch $((500 * 512 / $NGPUS)) --samples-per-epoch-val $((500 * 512)) \
--data-config ${config} --num-workers 30 \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/mlp_2p.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net \
--log $HOME/hww/incl-train/weaver-core/weaver/logs/${PREFIX}/train_{auto}.log --tensorboard _${PREFIX}_{auto}
# combined version
NGPUS=1
GPU=3
DATAPATH=/mldata/licq/deepjetak8
PREFIX=ak8_hidneurons_topVsQCD_manual_pre1.0layer; network_name=mlp; ext_opt= # raw score, two path (stoped) ## needs modification
PREFIX=ak8_hidneurons_topVsQCD_manual_pre1_rmbasic.0layer.onecycle; network_name=mlp; ext_opt= # raw score, two path (stoped) ## needs modification
PREFIX=ak8_rawscores_topVsQCD_manual_pre2; network_name=mlp_2p; ext_opt= # raw score, two path (stoped)
PREFIX=ak8_rawscores_topVsQCD_manual_pre1.candle; network_name=fintune_test/candle; ext_opt= # try out candle, without any learnable params.. failed
PREFIX=ak8_hidneurons_topVsQCD_manual_pre2.gated; network_name=fintune_test/mlp_2p_gated; ext_opt= # first try using gates. killed (lr not properly set?)
PREFIX=ak8_hidneurons_topVsQCD_manual_pre2.gated; network_name=fintune_test/mlp_2p_gated; ext_opt= # second try # sucess! a benchmark indeed
PREFIX=ak8_hidneurons_topVsQCD_manual_pre2.gated.neurons_in_preprocess; network_name=fintune_test/mlp_2p_gated; ext_opt="-o neurons_in_preprocess True" # third try (even better performance, good)
PREFIX=ak8_hidneurons_topVsQCD_manual_pre2.gated.neurons_in_preprocess.mult; network_name=fintune_test/mlp_2p_gated; ext_opt="-o neurons_in_preprocess True" # not working at all!
PREFIX=ak8_hidneurons_topVsQCD_manual_pre2_extfeat.gated.neurons_in_preprocess; network_name=fintune_test/mlp_2p_gated; ext_opt="-o neurons_in_preprocess True" # adding extra jet feats: similar performance
PREFIX=ak8_hidneurons_topVsQCD_manual_pre2.gated_on_hid.neurons_in_preprocess; network_name=fintune_test/mlp_2p_gated_on_hid; ext_opt="-o neurons_in_preprocess True" # similar performance..
# would you try back to use raw scores?
PREFIX=ak8_rawscores_topVsQCD_manual_pre2.gated.neurons_in_preprocess; network_name=fintune_test/mlp_2p_gated; ext_opt="-o neurons_in_preprocess True"
PREFIX=ak8_rawscores_topVsQCD_manual_pre2.gated_presoftmax.neurons_in_preprocess; network_name=fintune_test/mlp_2p_gated_forrawscores; ext_opt="-o neurons_in_preprocess True"
PREFIX=ak8_rawscores_topVsQCD_manual_pre2.gated_presoftmax.neurons_in_preprocess.skip_mlp; network_name=fintune_test/mlp_2p_gated_forrawscores; ext_opt="-o neurons_in_preprocess True -o skip_mlp True"
PREFIX=ak8_hidneurons_topVsQCD_manual_pre2.gated.neurons_in_preprocess.ly128; network_name=fintune_test/mlp_2p_gated; ext_opt="-o neurons_in_preprocess True -o layer_params 128,"
# 11.07 try
PREFIX=ak8_hidneurons_topVsQCD_manual_pre2.gated.neurons_in_preprocess.mlp_std; network_name=fintune_test/mlp_2p_gated; ext_opt="-o neurons_in_preprocess True -o no_last_relu True"
PREFIX=ak8_rawscores_topVsQCD_manual_pre2.gated_presoftmax.neurons_in_preprocess.skip_mlp.mlp_std; network_name=fintune_test/mlp_2p_gated_forrawscores; ext_opt="-o neurons_in_preprocess True -o skip_mlp True -o no_last_relu True"
PREFIX=ak8_rawscores_topVsQCD_manual_pre2.gated_presoftmax.skip_mlp.mlp_std; network_name=fintune_test/mlp_2p_gated_forrawscores; ext_opt="-o skip_mlp True -o no_last_relu True"
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/finetune/${PREFIX%%.*}.yaml
python $HOME/hww/incl-train/weaver-core/weaver/train.py \
--batch-size 512 --start-lr 2e-2 --num-epochs 30 --optimizer ranger --lr-scheduler one-cycle ${ext_opt} \
--gpus $GPU --data-train \
$DATAPATH'/20221023_ak8_UL17_v6/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/*/*.root' \
$DATAPATH'/20221023_ak8_UL17_v6/ZprimeToTT_M1200to4500_W12to45_TuneCP2_PSweights/*/*.root' \
--data-test \
'qcd:'$DATAPATH'/20221023_ak8_UL17_v6/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
'ttbar:'$DATAPATH'/20221023_ak8_UL17_v6/ZprimeToTT_M1200to4500_W12to45_TuneCP2_PSweights/*/*.root' \
--samples-per-epoch $((500 * 512 / $NGPUS)) --samples-per-epoch-val $((500 * 512)) \
--data-config ${config} --num-workers 20 \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/$network_name.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net \
--predict-output $HOME/hww/incl-train/weaver-core/weaver/predict/$PREFIX/pred.root \
--log $HOME/hww/incl-train/weaver-core/weaver/logs/${PREFIX}/train_{auto}.log --tensorboard _${PREFIX}_{auto}
## fine-tunings study #2
# adding H->bc scores
NGPUS=4
PREFIX=ak8_MD_vminclv2_pre2_addhbc ## needs modification
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/inclv6/${PREFIX//./_}.yaml
DATAPATH=/mldata/licq/deepjetak8
# well... why the performance get even worse..?
NGPUS=4
PREFIX=ak8_MD_vminclv2_pre2_origrecast ## needs modification
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/inclv6/${PREFIX//./_}.yaml
DATAPATH=/mldata/licq/deepjetak8
# get reweighting factors
NGPUS=1
python $HOME/hww/incl-train/weaver-core/weaver/train.py \
--train-mode hybrid -o loss_gamma 0.05 \
--batch-size 512 --start-lr 5e-3 --num-epochs 30 --optimizer ranger \
--gpus 0 --data-train \
$DATAPATH'/20221023_ak8_UL17_v6/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
$DATAPATH'/20221023_ak8_UL17_v6/BulkGravitonToHHTo4QTau_MX-600to6000_MH-15to250/*/*.root' \
$DATAPATH'/20221023_ak8_UL17_v6/BulkGravitonToHHTo4W_MX-600to6000_MH-15to250_JHUVariableWMass/*/*.root' \
$DATAPATH'/20221023_ak8_UL17_v6/Spin0ToTT_VariableMass_W*_MX-600to6000_MH-15to250/*/*.root' \
$DATAPATH'/20221023_ak8_UL17_v6/ChargedHiggs_HplusToBC_HminusToBC/*/*.root' \
--samples-per-epoch $((15000 * 512 / $NGPUS)) --samples-per-epoch-val $((1000 * 512)) \
--data-config ${config} --num-workers 3 \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv_hybrid.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net \
--log $HOME/hww/incl-train/weaver-core/weaver/logs/${PREFIX}/pre_train.log
# formal training
NGPUS=4
CUDA_VISIBLE_DEVICES=0,1,2,3 torchrun --standalone --nnodes=1 --nproc_per_node=$NGPUS $HOME/hww/incl-train/weaver-core/weaver/train.py \
--train-mode hybrid -o loss_gamma 0.05 \
--batch-size 512 --start-lr 5e-3 --num-epochs 30 --optimizer ranger \
--backend nccl --data-train \
$DATAPATH'/20221023_ak8_UL17_v6/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
$DATAPATH'/20221023_ak8_UL17_v6/BulkGravitonToHHTo4QTau_MX-600to6000_MH-15to250/*/*.root' \
$DATAPATH'/20221023_ak8_UL17_v6/BulkGravitonToHHTo4W_MX-600to6000_MH-15to250_JHUVariableWMass/*/*.root' \
$DATAPATH'/20221023_ak8_UL17_v6/Spin0ToTT_VariableMass_W*_MX-600to6000_MH-15to250/*/*.root' \
$DATAPATH'/20221023_ak8_UL17_v6/ChargedHiggs_HplusToBC_HminusToBC/*/*.root' \
--data-test \
'hww:'$DATAPATH'/20221023_ak8_UL17_v6/GluGluToBulkGravitonToHHTo4W_JHUGen_M-1000_narrow/*/*.root' \
'xqq:'$DATAPATH'/20221023_ak8_UL17_v6/BulkGravitonToHHTo4QTau_MX-600to6000_MH-15to250/*/*0.root' \
'qcd:'$DATAPATH'/20221023_ak8_UL17_v6/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
'ttbar:'$DATAPATH'/20221023_ak8_UL17_v6/ZprimeToTT_M1200to4500_W12to45_TuneCP2_PSweights/*/*.root' \
'xbc:'$DATAPATH'/20221023_ak8_UL17_v6/ChargedHiggs_HplusToBC_HminusToBC/*/*0.root' \
--samples-per-epoch $((15000 * 512 / $NGPUS)) --samples-per-epoch-val $((1000 * 512)) \
--data-config ${config} --num-workers 5 \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv_hybrid.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net \
--log $HOME/hww/incl-train/weaver-core/weaver/logs/${PREFIX}/train.log --tensorboard _${PREFIX} \
--predict-output $HOME/hww/incl-train/weaver-core/weaver/predict/$PREFIX/pred.root
# retry particlenet, but only with classification head
NGPUS=4
PREFIX=ak8_MD_vminclv2_fin_finetune_hbc_manual.zeus ## needs modification
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/inclv6/${PREFIX%%.*}.yaml
DATAPATH=/mldata/licq/deepjetak8
CUDA_VISIBLE_DEVICES=0,1,2,3 torchrun --standalone --nnodes=1 --nproc_per_node=$NGPUS $HOME/hww/incl-train/weaver-core/weaver/train.py \
--batch-size 512 --start-lr 5e-3 --num-epochs 30 --optimizer ranger \
--backend nccl --data-train \
$DATAPATH'/20221023_ak8_UL17_v6/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
$DATAPATH'/20221023_ak8_UL17_v6/BulkGravitonToHHTo4QTau_MX-600to6000_MH-15to250/*/*.root' \
$DATAPATH'/20221023_ak8_UL17_v6/ChargedHiggs_HplusToBC_HminusToBC/*/*.root' \
--data-test \
'qcd:'$DATAPATH'/20221023_ak8_UL17_v6/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
'xqq:'$DATAPATH'/20221023_ak8_UL17_v6/BulkGravitonToHHTo4QTau_MX-600to6000_MH-15to250/*/*0.root' \
'xbc:'$DATAPATH'/20221023_ak8_UL17_v6/ChargedHiggs_HplusToBC_HminusToBC/*/*0.root' \
--samples-per-epoch $((15000 * 512 / $NGPUS)) --samples-per-epoch-val $((1000 * 512)) \
--data-config ${config} --num-workers 5 \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net \
--log $HOME/hww/incl-train/weaver-core/weaver/logs/${PREFIX}/train.log --tensorboard _${PREFIX} \
--predict-output $HOME/hww/incl-train/weaver-core/weaver/predict/$PREFIX/pred.root
# let's inference Huilin's model!! (11.09)
PREFIX=ak8_MD_ParT_HQ ## needs modification
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/inclv6/${PREFIX%%.*}.yaml
DATAPATH=/mldata/licq/deepjetak8
python $HOME/hww/incl-train/weaver-core/weaver/train.py --predict \
--batch-size 512 --num-workers 3 \
--gpus ${GPU} --data-test \
'qcd:'$DATAPATH'/20221023_ak8_UL17_v6/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
'xqq:'$DATAPATH'/20221023_ak8_UL17_v6/BulkGravitonToHHTo4QTau_MX-600to6000_MH-15to250/*/*0.root' \
--data-config ${config} \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/example_ParticleTransformerTagger.py \
--model-prefix /home/olympus/hqu/work/nn/particle_transformer_CMS/particle_transformer/training/CMSAK8/MD/ParT/20220426-084550_example_ParticleTransformerTagger_ranger_lr0.002_batch512/net \
--predict-output $HOME/hww/incl-train/weaver-core/weaver/predict/$PREFIX/pred.root
## 22.11.07 try finetuning ParT!!
NGPUS=4
PREFIX=ak8_MD_vminclv2ParT_fin_finetune_hbc ## needs modification
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/inclv6/${PREFIX//./_}.yaml
DATAPATH=/mldata/licq/deepjetak8
# first get the reweighting factor
NGPUS=1
python $HOME/hww/incl-train/weaver-core/weaver/train.py \
--use-amp --batch-size 512 --start-lr 1e-3 --num-epochs 50 --optimizer ranger \
--gpus 0 --data-train \
$DATAPATH'/20221023_ak8_UL17_v6/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
$DATAPATH'/20221023_ak8_UL17_v6/BulkGravitonToHHTo4QTau_MX-600to6000_MH-15to250/*/*.root' \
$DATAPATH'/20221023_ak8_UL17_v6/ChargedHiggs_HplusToBC_HminusToBC/*/*.root' \
--samples-per-epoch $((15000 * 512 / $NGPUS)) --samples-per-epoch-val $((1000 * 512)) \
--data-config ${config} --num-workers 3 \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/example_ParticleTransformerTagger.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net \
--log $HOME/hww/incl-train/weaver-core/weaver/logs/${PREFIX}/pre_train.log
# ok let's tranfer to farm221
--use-amp --batch-size 512 --start-lr 1e-4 --num-epochs 30 --optimizer ranger \
--optimizer-option lr_mult (\"fc.*\",50) --lr-scheduler one-cycle --load-model-weights model/ak8_MD_vminclv2ParT_manual_fixwrap/net_best_epoch_state.pt \
--gpus 0 --data-train \
$DATAPATH'/20221023_ak8_UL17_v6/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
$DATAPATH'/20221023_ak8_UL17_v6/BulkGravitonToHHTo4QTau_MX-600to6000_MH-15to250/*/*.root' \
$DATAPATH'/20221023_ak8_UL17_v6/ChargedHiggs_HplusToBC_HminusToBC/*/*.root' \
--data-test \
'qcd:'$DATAPATH'/20221023_ak8_UL17_v6/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
'xqq:'$DATAPATH'/20221023_ak8_UL17_v6/BulkGravitonToHHTo4QTau_MX-600to6000_MH-15to250/*/*0.root' \
'xbc:'$DATAPATH'/20221023_ak8_UL17_v6/ChargedHiggs_HplusToBC_HminusToBC/*/*0.root' \
--samples-per-epoch $((15000 * 512 / $NGPUS)) --samples-per-epoch-val $((1000 * 512)) \
--data-config ${config} --num-workers 3 \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/example_ParticleTransformerTagger.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net \
--log $HOME/hww/incl-train/weaver-core/weaver/logs/${PREFIX}/pre_train.log
# meanwhile we'll play with finetuning
NGPUS=1
GPU=0
DATAPATH=/mldata/licq/deepjetak8
PREFIX=ak8_hidneurons_hbc_manual; network_name=mlp_std; ext_opt="-o layer_params ''"
PREFIX=ak8_hidneurons_hbc_manual.lr1e-2; network_name=mlp_std; ext_opt="-o layer_params ''"
PREFIX=ak8_hidneurons_hbc_manual.ly128; network_name=mlp_std; ext_opt="-o layer_params 128,"
PREFIX=ak8_rawscores_hbc_manual; network_name=mlp_std; ext_opt="-o layer_params '' -o prep_log True"
PREFIX=ak8_rawscores_hbc_manual.ly128; network_name=mlp_std; ext_opt="-o layer_params 128, -o prep_log True"
PREFIX=ak8_rawscores_hqqonly_hbc_manual; network_name=mlp_std; ext_opt="-o layer_params '' -o prep_log True -o prep_norm True"
PREFIX=ak8_rawscores_hqqonly_hbc_manual.lr1e-2; network_name=mlp_std; ext_opt="-o layer_params '' -o prep_log True -o prep_norm True"
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/finetune_hbc/${PREFIX%%.*}.yaml
python $HOME/hww/incl-train/weaver-core/weaver/train.py \
--batch-size 512 --start-lr 2e-2 --num-epochs 30 --optimizer ranger --lr-scheduler one-cycle ${ext_opt} \
--gpus $GPU --data-train \
$DATAPATH'/20221023_ak8_UL17_v6/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
$DATAPATH'/20221023_ak8_UL17_v6/BulkGravitonToHHTo4QTau_MX-600to6000_MH-15to250/*/*.root' \
$DATAPATH'/20221023_ak8_UL17_v6/ChargedHiggs_HplusToBC_HminusToBC/*/*.root' \
--data-test \
'qcd:'$DATAPATH'/20221023_ak8_UL17_v6/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
'xqq:'$DATAPATH'/20221023_ak8_UL17_v6/BulkGravitonToHHTo4QTau_MX-600to6000_MH-15to250/*/*0.root' \
'xbc:'$DATAPATH'/20221023_ak8_UL17_v6/ChargedHiggs_HplusToBC_HminusToBC/*/*0.root' \
--samples-per-epoch $((500 * 512 / $NGPUS)) --samples-per-epoch-val $((500 * 512)) \
--data-config ${config} --num-workers 20 \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/$network_name.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net \
--predict-output $HOME/hww/incl-train/weaver-core/weaver/predict/$PREFIX/pred.root \
--log $HOME/hww/incl-train/weaver-core/weaver/logs/${PREFIX}/train_{auto}.log --tensorboard _${PREFIX}_{auto}
# now add hqq!! (finally)
PREFIX=ak8_hidneurons_hbc_manual; network_name=mlp_std; ext_opt="-o layer_params ''"
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/finetune_hbc/${PREFIX%%.*}.yaml
python $HOME/hww/incl-train/weaver-core/weaver/train.py --predict \
--batch-size 512 --start-lr 2e-2 --num-epochs 30 --optimizer ranger --lr-scheduler one-cycle ${ext_opt} \
--gpus $GPU \
--data-test \
'hqq:'$DATAPATH'/20221023_ak8_UL17_v6/GluGluToBulkGravitonToHHTo4QTau_M-1000_narrow/*/*.root' \
--samples-per-epoch $((500 * 512 / $NGPUS)) --samples-per-epoch-val $((500 * 512)) \
--data-config ${config} --num-workers 3 \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/$network_name.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net \
--predict-output $HOME/hww/incl-train/weaver-core/weaver/predict/$PREFIX/pred.root
################################################################
# a long gap
# 22.12.13 finetune the HWW mass
NGPUS=1
GPU=0
DATAPATH=/mldata/licq/deepjetak8
PREFIX=ak8_hidneurons_gghww_manual; network_name=fintune_test/mlp_2p_gated_regression; ext_opt="-o neurons_in_preprocess True -o no_last_relu True" # overlapping dir with diff LR. Last one is 0.04
PREFIX=ak8_hidneurons_gghww_addFullInvMass.lr2e-2; network_name=fintune_test/mlp_2p_gated_regression; ext_opt="-o neurons_in_preprocess True -o no_last_relu True"
PREFIX=ak8_hidneurons_gghww_noInvMass.lr2e-2; network_name=fintune_test/mlp_2p_gated_regression; ext_opt="-o neurons_in_preprocess True -o no_last_relu True"
PREFIX=ak8_hidneurons_gghww_dummyMET.lr2e-2; network_name=fintune_test/mlp_2p_gated_regression; ext_opt="-o neurons_in_preprocess True -o no_last_relu True"
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/finetune_gghww/${PREFIX%%.*}.yaml
python $HOME/hww/incl-train/weaver-core/weaver/train.py --train-mode regression --load-model-weights finetune_gghww_custom \
--batch-size 512 --start-lr 2e-2 --num-epochs 30 --optimizer ranger --lr-scheduler one-cycle ${ext_opt} \
--gpus $GPU --data-train \
$DATAPATH'/20221023_ak8_UL17_v6/GluGluToH1JetToWW_HEFT_MH-15to250_JHUVariableWMass/01/*.root' \
--data-test \
'gghww:'$DATAPATH'/20221023_ak8_UL17_v6/GluGluToH1JetToWW_HEFT_MH-15to250_JHUVariableWMass/01/*.root' \
--samples-per-epoch $((500 * 512 / $NGPUS)) --samples-per-epoch-val $((500 * 512)) \
--data-config ${config} --num-workers 20 \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/$network_name.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net \
--predict-output $HOME/hww/incl-train/weaver-core/weaver/predict/$PREFIX/pred.root \
--log $HOME/hww/incl-train/weaver-core/weaver/logs/${PREFIX}/train_{auto}.log --tensorboard _${PREFIX}_{auto}
''
# infer ttbar samples
NGPUS=1
GPU=0
DATAPATH=/mldata/licq/deepjetak8
PREFIX=ak8_hidneurons_gghww_addFullInvMass.lr2e-2; network_name=fintune_test/mlp_2p_gated_regression; ext_opt="-o neurons_in_preprocess True -o no_last_relu True"
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/finetune_gghww/${PREFIX%%.*}_infer.yaml
python $HOME/hww/incl-train/weaver-core/weaver/train.py --train-mode regression --predict ${ext_opt} \
--batch-size 512 --gpus $GPU \
--data-test \
'ofcttbarsemilep:'$DATAPATH'/20221023_ak8_UL17_v6/TTToSemiLeptonic_TuneCP5_13TeV-powheg-pythia8/01/*.root' \
'ofcttbarfulllep:'$DATAPATH'/20221023_ak8_UL17_v6/TTTo2L2Nu_TuneCP5_13TeV-powheg-pythia8/01/*.root' \
--data-config ${config} \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/$network_name.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net \
--predict-output $HOME/hww/incl-train/weaver-core/weaver/predict/$PREFIX/pred.root
# infer the Z'->ttbar sample (but it's for other studies. the MET all assigned zero...)
NGPUS=1
GPU=0
DATAPATH=/mldata/licq/deepjetak8
PREFIX=ak8_hidneurons_gghww_addFullInvMass.lr2e-2; network_name=fintune_test/mlp_2p_gated_regression; ext_opt="-o neurons_in_preprocess True -o no_last_relu True"
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/finetune_gghww/${PREFIX%%.*}_inferttbarfull.yaml
python $HOME/hww/incl-train/weaver-core/weaver/train.py --train-mode regression --predict ${ext_opt} \
--batch-size 512 --gpus $GPU \
--data-test \
'ttbarfull:'$DATAPATH'/20221023_ak8_UL17_v6/ZprimeToTT_M1200to4500_W12to45_TuneCP2_PSweights/*/*.root' \
--data-config ${config} \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/$network_name.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net \
--predict-output $HOME/hww/incl-train/weaver-core/weaver/predict/$PREFIX/pred.root
# re-infer Z'->ttbar sample with more events...
GPU=0
PREFIX=ak8_MD_vminclv2ParT_manual_fixwrap ## needs modification
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/incl/${PREFIX//./_}_inferttbarfull.yaml
DATAPATH=/data/pubfs/licq/deepjetak8
python $HOME/hww/incl-train/weaver-core/weaver/train.py --predict \
--train-mode hybrid -o loss_gamma 0.05 --batch-size 512 --num-workers 3 \
--gpus ${GPU} --data-test \
'ttbarfull:'$DATAPATH'/20220625_ak8_UL17_v4/ZprimeToTT_M1200to4500_W12to45_TuneCP2_PSweights/*/*.root' \
--data-config ${config} \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/example_ParticleTransformerTagger_hybrid.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/$PREFIX/net \
--predict-output $HOME/hww/incl-train/weaver-core/weaver/predict/$PREFIX/pred.root
# 23.04.15 train PNet with regression only..
NGPUS=2
PREFIX=ak8_MD_vminclv2_pre2_regonly_manual ## needs modification
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/incl/${PREFIX//./_}.yaml
DATAPATH=/mldata/licq/deepjetak8
CUDA_VISIBLE_DEVICES=0,1 torchrun --standalone --nnodes=1 --nproc_per_node=$NGPUS $HOME/hww/incl-train/weaver-core/weaver/train.py \
--train-mode regression \
--batch-size 512 --start-lr 5e-3 --num-epochs 30 --optimizer ranger \
--backend nccl --data-train \
$DATAPATH'/20220625_ak8_UL17_v4/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
$DATAPATH'/20220915_ak8_UL17_v5/BulkGravitonToHHTo4QTau_MX-600to6000_MH-15to250/*/*.root' \
$DATAPATH'/20220625_ak8_UL17_v4/BulkGravitonToHHTo4W_MX-600to6000_MH-15to250_JHUVariableWMass/*/*.root' \
$DATAPATH'/20220915_ak8_UL17_v5/Spin0ToTT_VariableMass_W*_MX-600to6000_MH-15to250/*/*.root' \
--samples-per-epoch $((15000 * 512 / $NGPUS)) --samples-per-epoch-val $((1000 * 512)) \
--data-config ${config} --num-workers 5 \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv_mass_regression.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net \
--log $HOME/hww/incl-train/weaver-core/weaver/logs/${PREFIX}/train.log --tensorboard _${PREFIX}
### then inference the ofcttbar samples for both cls-only and reg-only
GPU=1
PREFIX=ak8_MD_vminclv2_pre2_regonly_manual ## needs modification
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/incl/${PREFIX//./_}_inferofcttbarv6.yaml
DATAPATH=/mldata/licq/deepjetak8
DATAPATHIFR=/data/pubfs/licq/deepjetak8
python $HOME/hww/incl-train/weaver-core/weaver/train.py --train-mode regression --predict \
--batch-size 512 --gpus $GPU \
--data-test \
'ofcttbarsemilep:'$DATAPATHIFR'/20221023_ak8_UL17_v6/TTToSemiLeptonic_TuneCP5_13TeV-powheg-pythia8/01/*.root' \
'ofcttbarfulllep:'$DATAPATHIFR'/20221023_ak8_UL17_v6/TTTo2L2Nu_TuneCP5_13TeV-powheg-pythia8/01/*.root' \
--data-config ${config} \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv_mass_regression.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net \
--predict-output $HOME/hww/incl-train/weaver-core/weaver/predict/$PREFIX/pred.root
GPU=1
PREFIX=ak8_MD_vminclv2_pre2_noreg_manual ## needs modification
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/incl/${PREFIX//./_}_inferofcttbarv6.yaml
DATAPATH=/mldata/licq/deepjetak8
DATAPATHIFR=/data/pubfs/licq/deepjetak8
python $HOME/hww/incl-train/weaver-core/weaver/train.py --predict \
--batch-size 512 --gpus $GPU \
--data-test \
'ofcttbarsemilep:'$DATAPATHIFR'/20221023_ak8_UL17_v6/TTToSemiLeptonic_TuneCP5_13TeV-powheg-pythia8/01/*.root' \
'ofcttbarfulllep:'$DATAPATHIFR'/20221023_ak8_UL17_v6/TTTo2L2Nu_TuneCP5_13TeV-powheg-pythia8/01/*.root' \
--data-config ${config} \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net \
--predict-output $HOME/hww/incl-train/weaver-core/weaver/predict/$PREFIX/pred.root
# 23.04.22
NGPUS=2
PREFIX=ak8_MD_vminclv2_pre2 ## needs modification
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/incl/${PREFIX//./_}.yaml
DATAPATH=/mldata/licq/deepjetak8
CUDA_VISIBLE_DEVICES=0,1 torchrun --standalone --nnodes=1 --nproc_per_node=$NGPUS $HOME/hww/incl-train/weaver-core/weaver/train.py \
--train-mode hybrid -o loss_gamma 0.05 \
--batch-size 512 --start-lr 5e-3 --num-epochs 30 --optimizer ranger \
--backend nccl --data-train \
$DATAPATH'/20220625_ak8_UL17_v4/QCD_Pt_170toInf_ptBinned_TuneCP5_13TeV_pythia8/01/*.root' \
$DATAPATH'/20220915_ak8_UL17_v5/BulkGravitonToHHTo4QTau_MX-600to6000_MH-15to250/*/*.root' \
$DATAPATH'/20220625_ak8_UL17_v4/BulkGravitonToHHTo4W_MX-600to6000_MH-15to250_JHUVariableWMass/*/*.root' \
$DATAPATH'/20220915_ak8_UL17_v5/Spin0ToTT_VariableMass_W*_MX-600to6000_MH-15to250/*/*.root' \
--samples-per-epoch $((15000 * 512 / $NGPUS)) --samples-per-epoch-val $((1000 * 512)) \
--data-config ${config} --num-workers 5 \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/particle_net_pf_sv_hybrid.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net
PREFIX=ak8_MD_vminclv2ParT_manual_fixwrap ## needs modification
config=$HOME/hww/incl-train/weaver-core/weaver/data_new/incl/${PREFIX//./_}.yaml
DATAPATH=/mldata/licq/deepjetak8
python $HOME/hww/incl-train/weaver-core/weaver/train.py \
--train-mode hybrid -o loss_gamma 0.05 \
--batch-size 256 --start-lr 5e-3 --num-epochs 30 --optimizer ranger \
--gpus 0 --data-train \
$DATAPATH'/20220915_ak8_UL17_v5/BulkGravitonToHHTo4QTau_MX-600to6000_MH-15to250/*/*0.root' \
--samples-per-epoch $((15000 * 512 / $NGPUS)) --samples-per-epoch-val $((1000 * 512)) \
--data-config ${config} --num-workers 5 \
--network-config $HOME/hww/incl-train/weaver-core/weaver/networks/example_ParticleTransformerTagger_hybrid.py \
--model-prefix $HOME/hww/incl-train/weaver-core/weaver/model/${PREFIX}/net