New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Egamma PFID based on Tensorflow DNNs #35403
Conversation
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-35403/25508
|
A new Pull Request was created by @valsdav (Davide Valsecchi) for master. It involves the following packages:
@jpata, @cmsbuild, @slava77 can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
it would be nice to squash a few minor commits in the history. |
Files in RecoEgamma/ElectronIdentification/data/Ele_PFID_dnn/ should be removed from the commit history and instead proposed as a PR to https://github.com/cms-data/RecoEgamma-ElectronIdentification I notice that the model files are as small as 15 kB. Is the model really so small/simple or are these "dummy" files? |
@cmsbuild please test |
abort test |
enable profiling |
@cmsbuild please test |
HI @slava77
Of course, this can be done. Should I wait the end of the tests?
I see, we can move them there.
They are so small because the models are quite simple (DNN with 128-64-64-32-16-1 nodes) and they have been saved in tensorflow graph format with the optimization performed by this nice tool from the CMS ML group: https://cms-ml.github.io/documentation/inference/tensorflow2.html#saving-your-model |
the build was already done, so the commits can be updated any time now. |
-1 Failed Tests: UnitTests RelVals AddOn Unit TestsI found errors in the following unit tests: ---> test testRecoMETMETProducers had ERRORS ---> test testTauEmbeddingProducers had ERRORS RelVals
Expand to see more relval errors ...AddOn Tests
Expand to see more addon errors ... |
tensorflow::setLogging(cfg_.log_level); | ||
// load the graph definition | ||
LogDebug("EleDNNPFid") << "Loading " << nModels_ << " graphs"; | ||
for (const auto& model_file : cfg_.models_files) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that these need to be FileInPath instead of strings; apparently the tests are not running from /src directory.
Just tagging @akanugan here who is running some check of this PR in addition to jenkins. |
@cmsbuild please test |
@valsdav please update the PR description to make sure that all the slides (latest PF validations etc) are linked there |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-a0d08a/19675/summary.html Comparison SummarySummary:
|
+reconstruction
|
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2) |
+1
|
checkHcalStatus = cms.bool(True) | ||
checkHcalStatus = cms.bool(True), | ||
PhotonDNNPFid = cms.PSet( | ||
enabled = cms.bool(False), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was this meant to be enabled ? ref #42949
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its enabled via era, as it is meant to work only for run 3.
# Activate the Egamma PFID dnn only for Run3 | |
from Configuration.Eras.Modifier_run3_common_cff import run3_common | |
run3_common.toModify(gedPhotonsTmp.PhotonDNNPFid, | |
enabled = True | |
) |
PR description:
This PR introduces the DNN based Egamma particle flow ID evaluation based on the Tensorflow internal support.
Two helper classes, ElectronDNNEstimator and PhotonDNNEstimator, are included to handle the loading and evaluation of the DNN models for GsfElectron and GEDPhotons candidates.
Multiple models are evaluated for electrons and photons in different detector and energy regions. Batch evaluation is implemented to call each Tensorflow session only 1 time for event. The evaluation of the DNN models is configurable from python config and txt files: the list of variables to be used, their scaling parameters, the model files can be changed without changes to the code.
The DNNs are evaluated before the electron and photons candidates pass through the PFEgammaFilters, where the DNN values are available in the candidates to be used for the selection. Thresholds configuration for the PFid have been added to the PFEGammaFilter producer.
In the PR, the DNN based PFid has been activated by default and default models files have been included for the testing. Final model file will be provided in a separate PR after the finalization on the CMSSW_12_0 samples.
Presentations and documentation:
PR validation:
Standard PF validation: https://akanugan.web.cern.ch/akanugan/PF_Validation_PFEGammaID_PR35403/
List of MINIAOD files and a few summary slides looking at the PF electrons & gedGsfElectrons in test vs reference are at:
https://cernbox.cern.ch/index.php/s/ki533KAwuWW1k3T