#include <TRTPIDNN.h>
|
| | TRTPIDNN ()=default |
| virtual | ~TRTPIDNN ()=default |
| const std::string & | getDefaultOutputNode () const |
| const std::string & | getDefaultOutputLabel () const |
| const std::map< std::string, std::map< std::string, double > > & | getScalarInputs () const |
| const std::map< std::string, std::map< std::string, std::vector< double > > > & | getVectorInputs () const |
| double | evaluate (std::map< std::string, std::map< std::string, double > > &scalarInputs, std::map< std::string, std::map< std::string, std::vector< double > > > &vectorInputs) const |
| double | evaluate (std::map< std::string, std::map< std::string, double > > &scalarInputs, std::map< std::string, std::map< std::string, std::vector< double > > > &vectorInputs, const std::string &outputNode, const std::string &outputLabel) const |
| StatusCode | configure (const std::string &json) |
Definition at line 28 of file TRTPIDNN.h.
◆ TRTPIDNN()
| InDet::TRTPIDNN::TRTPIDNN |
( |
| ) |
|
|
default |
◆ ~TRTPIDNN()
| virtual InDet::TRTPIDNN::~TRTPIDNN |
( |
| ) |
|
|
virtualdefault |
◆ configure()
| StatusCode InDet::TRTPIDNN::configure |
( |
const std::string & | json | ) |
|
Definition at line 35 of file TRTPIDNN.cxx.
35 {
37 try {
38 std::istringstream inputCfg(
json);
40 } catch (boost::property_tree::ptree_error& err) {
41 log << MSG::ERROR <<
" NN not readable: " <<
err.what() <<
endmsg;
42 return StatusCode::FAILURE;
43 }
44
45 try {
47 } catch (lwt::NNConfigurationException& err) {
48 log << MSG::ERROR <<
" NN configuration failed: " <<
err.what() <<
endmsg;
49 return StatusCode::FAILURE;
50 }
51
52
54 log << MSG::ERROR <<
" unable to define NN output." <<
endmsg;
55 return StatusCode::FAILURE;
56 }
59
60
64 for (
const auto& variable :
input.variables) {
66 }
67 }
69 for (
const auto& input :
m_nnConfig.input_sequences) {
71 for (
const auto& variable :
input.variables) {
73 }
74 }
75
76 return StatusCode::SUCCESS;
77}
std::map< std::string, std::map< std::string, std::vector< double > > > m_vectorInputs
std::map< std::string, std::map< std::string, double > > m_scalarInputs
lwt::GraphConfig m_nnConfig
std::string m_outputLabel
std::unique_ptr< lwt::LightweightGraph > m_nn
IMessageSvc * getMessageSvc(bool quiet=false)
◆ evaluate() [1/2]
| double InDet::TRTPIDNN::evaluate |
( |
std::map< std::string, std::map< std::string, double > > & | scalarInputs, |
|
|
std::map< std::string, std::map< std::string, std::vector< double > > > & | vectorInputs ) const |
|
inline |
Definition at line 52 of file TRTPIDNN.h.
53 {
55 }
double evaluate(std::map< std::string, std::map< std::string, double > > &scalarInputs, std::map< std::string, std::map< std::string, std::vector< double > > > &vectorInputs) const
◆ evaluate() [2/2]
| double InDet::TRTPIDNN::evaluate |
( |
std::map< std::string, std::map< std::string, double > > & | scalarInputs, |
|
|
std::map< std::string, std::map< std::string, std::vector< double > > > & | vectorInputs, |
|
|
const std::string & | outputNode, |
|
|
const std::string & | outputLabel ) const |
Definition at line 22 of file TRTPIDNN.cxx.
24 {
26 const auto result =
m_nn->compute(scalarInputs, vectorInputs, outputNode);
28 if (itResult ==
result.end()) {
29 log << MSG::ERROR <<
" unable to find output: node=" << outputNode <<
", label=" <<
outputLabel <<
endmsg;
30 return 0.5;
31 }
32 return itResult->second;
33}
const std::string outputLabel
◆ getDefaultOutputLabel()
| const std::string & InDet::TRTPIDNN::getDefaultOutputLabel |
( |
| ) |
const |
|
inline |
◆ getDefaultOutputNode()
| const std::string & InDet::TRTPIDNN::getDefaultOutputNode |
( |
| ) |
const |
|
inline |
◆ getScalarInputs()
| const std::map< std::string, std::map< std::string, double > > & InDet::TRTPIDNN::getScalarInputs |
( |
| ) |
const |
|
inline |
◆ getVectorInputs()
| const std::map< std::string, std::map< std::string, std::vector< double > > > & InDet::TRTPIDNN::getVectorInputs |
( |
| ) |
const |
|
inline |
◆ m_nn
| std::unique_ptr<lwt::LightweightGraph> InDet::TRTPIDNN::m_nn |
|
private |
◆ m_nnConfig
| lwt::GraphConfig InDet::TRTPIDNN::m_nnConfig |
|
private |
◆ m_outputLabel
| std::string InDet::TRTPIDNN::m_outputLabel |
|
private |
◆ m_outputNode
| std::string InDet::TRTPIDNN::m_outputNode |
|
private |
◆ m_scalarInputs
| std::map<std::string, std::map<std::string, double> > InDet::TRTPIDNN::m_scalarInputs |
|
private |
◆ m_vectorInputs
| std::map<std::string, std::map<std::string, std::vector<double> > > InDet::TRTPIDNN::m_vectorInputs |
|
private |
The documentation for this class was generated from the following files: