![]() |
ATLAS Offline Software
|
Used by AsgElectronSelectorTool to calculate the score of a python trained DNN using lwtnn as interface to do electron ID. More...
#include <ElectronDNNCalculator.h>
Public Member Functions | |
| ElectronDNNCalculator (AsgElectronSelectorTool *owner, const std::string &modelFileName, const std::string &quantileFileName, const std::vector< std::string > &variablesName, const bool multiClass) | |
| Constructor of the class. | |
| ~ElectronDNNCalculator () | |
| Standard destructor. | |
| Eigen::Matrix< float, -1, 1 > | calculate (const std::vector< double > &) const |
| Get the prediction of the DNN model. | |
| bool | msgLvl (const MSG::Level lvl) const |
| Test the output level of the object. | |
| MsgStream & | msg () const |
| The standard message stream. | |
| MsgStream & | msg (const MSG::Level lvl) const |
| The standard message stream. | |
Private Member Functions | |
| double | transformInput (const std::vector< double > &quantiles, double value) const |
| transform the input variables according to a given QuantileTransformer. | |
| int | readQuantileTransformer (TTree *tree) |
| read the bins and values of the QuantileTransformer to transform the input variables. | |
Private Attributes | |
| std::unique_ptr< lwt::generic::FastGraph< float > > | m_graph = 0 |
| DNN interface via lwtnn. | |
| std::vector< std::vector< double > > | m_quantiles |
| Quantile values for each variable that needs to be transformed with the QuantileTransformer. | |
| std::vector< double > | m_references |
| Reference values for the QuantileTransformer. Basically just equidistant bins between 0 and 1. | |
| bool | m_multiClass |
| Whether the used model is a multiclass model or not. | |
| std::vector< std::string > | m_variables |
| Model variables. | |
| uint | m_var_size |
| std::function< MsgStream &()> | m_msg |
| the message stream we use | |
Used by AsgElectronSelectorTool to calculate the score of a python trained DNN using lwtnn as interface to do electron ID.
Also applies a transformation to the input variables based on a QuantileTransformer.
Definition at line 23 of file ElectronDNNCalculator.h.
| ElectronDNNCalculator::ElectronDNNCalculator | ( | AsgElectronSelectorTool * | owner, |
| const std::string & | modelFileName, | ||
| const std::string & | quantileFileName, | ||
| const std::vector< std::string > & | variablesName, | ||
| const bool | multiClass ) |
Constructor of the class.
Definition at line 26 of file ElectronDNNCalculator.cxx.
|
inline |
| Eigen::Matrix< float, -1, 1 > ElectronDNNCalculator::calculate | ( | const std::vector< double > & | variableValues | ) | const |
Get the prediction of the DNN model.
Definition at line 85 of file ElectronDNNCalculator.cxx.
|
inherited |
The standard message stream.
Definition at line 24 of file AsgMessagingForward.cxx.
|
inherited |
The standard message stream.
| lvl | The message level to set the stream to |
Definition at line 29 of file AsgMessagingForward.cxx.
|
inherited |
Test the output level of the object.
| lvl | The message level to test against |
true If messages at level "lvl" will be printed Definition at line 11 of file AsgMessagingForward.cxx.
|
private |
read the bins and values of the QuantileTransformer to transform the input variables.
Definition at line 142 of file ElectronDNNCalculator.cxx.
|
private |
transform the input variables according to a given QuantileTransformer.
Definition at line 110 of file ElectronDNNCalculator.cxx.
|
private |
DNN interface via lwtnn.
Definition at line 46 of file ElectronDNNCalculator.h.
|
privateinherited |
the message stream we use
This used to be a simple pointer to the MsgStream itself, but in AthenaMT the actual object used is local to the thread. So instead of pointing to it directly we are now using a function to look it up, which will get the thread-local object.
Definition at line 77 of file AsgMessagingForward.h.
|
private |
Whether the used model is a multiclass model or not.
Definition at line 53 of file ElectronDNNCalculator.h.
|
private |
Quantile values for each variable that needs to be transformed with the QuantileTransformer.
Definition at line 49 of file ElectronDNNCalculator.h.
|
private |
Reference values for the QuantileTransformer. Basically just equidistant bins between 0 and 1.
Definition at line 51 of file ElectronDNNCalculator.h.
|
private |
Definition at line 56 of file ElectronDNNCalculator.h.
|
private |
Model variables.
Definition at line 55 of file ElectronDNNCalculator.h.