17 std::vector<std::vector<int64_t>> l_edge_index_ = {{}, {}};
18 std::vector<std::vector<float>> l_edge_attr_s_ = {};
19 for (std::size_t i = 0; i < static_cast<std::size_t>(hyperGraph.
nEdges());
21 l_edge_index_[0].push_back(
23 l_edge_index_[1].push_back(
29 static_cast<int64_t
>(l_edge_index_[0].size()),
44 std::vector<std::vector<float>> l_x_s_ = {};
45 std::vector<int64_t> l_batch_ = {};
46 for (std::size_t i = 0; i < static_cast<std::size_t>(hyperGraph.
nNodes());
49 l_batch_.push_back(
static_cast<int64_t
>(0));
56 m_l_batch_shape = std::vector<int64_t>{
static_cast<int64_t
>(l_batch_.size())};
61 std::vector<std::vector<float>> l_u_s_ = {hyperGraph.
getGlobalFeats()};
66 std::vector<std::vector<int64_t>> l_edge_index_h_ = {};
67 std::vector<int64_t> l_edge_index_h_batch_ = {};
68 bool h_batch_filled =
false;
69 for (std::size_t i = 0;
71 std::vector<int64_t> e_m = {};
72 for (std::size_t j = 0;
73 j < static_cast<std::size_t>(hyperGraph.
nHyperEdges()); j++) {
74 if (!h_batch_filled) {
75 l_edge_index_h_batch_.push_back(
static_cast<int64_t
>(0));
79 l_edge_index_h_.push_back(e_m);
80 h_batch_filled =
true;
84 static_cast<int64_t
>(l_edge_index_h_[0].size()),
94 std::vector<int64_t>{
static_cast<int64_t
>(l_edge_index_h_batch_.size())};
105 std::vector<std::string> outputNames = hyperModel.
getOutputNames();
108 float* hyperedge_out = hyperModel.
getOutputs<
float>(outputNames[0]);
109 float* edge_out = hyperModel.
getOutputs<
float>(outputNames[1]);
117 using namespace asg::msgUserCode;
118 setMsgLevel(MSG::INFO);
120 std::string row =
"[";
122 for (
const auto j : i) {
123 row += std::to_string(j) +
", ";
132 for (
const auto j : i) {
133 row += std::to_string(j) +
", ";
Features getEdgeFeats(std::size_t index) const
Features getNodeFeats(std::size_t index) const
Features getGlobalFeats() const
int64_t hyperEdgeOrder() const
const std::vector< EdgeIndex > & getEdgeIndicesVector() const
int64_t nHyperEdges() const
HyperEdgeIndex getHyperEdgeIndices(std::size_t index) const
T * getOutputs(const std::string &node)
Pointer to the buffer of the named output.
virtual std::vector< std::string > getOutputNames() const =0
Model-specific output names consumed by the parser.
void setInputs(const std::string &node, std::vector< T > &values, const std::vector< int64_t > &shape)
Bind an input by node name.
std::vector< int64_t > m_l_edge_index_h_batch_shape
std::vector< int64_t > m_hyperedge_out_shape
std::vector< int64_t > m_l_edge_index_shape
std::vector< std::vector< int64_t > > m_reco_indices_out
const std::string m_l_edge_index_h_name
const std::string m_l_edge_index_name
const std::string m_l_batch_name
std::vector< std::vector< float > > m_hyperedge_out
std::vector< int64_t > m_l_edge_attr_s_shape
void getONNXOutputs(HyPERModel &hyperModel) override
This method takes the information from the onnxruntime object and builds the outputs on the parser ob...
std::vector< int64_t > m_l_batch_
std::vector< float > m_l_u_s_
std::vector< int64_t > m_l_x_s_shape
std::vector< std::vector< float > > m_edge_out
const std::string m_l_edge_index_h_batch_name
virtual void printOutputsForValidation() const override
void buildONNXInputs(const HyPERGraph &hyperGraph, HyPERModel &hyperModel) override
This method takes the information from the graph object and builds the inputs for the onnxruntime obj...
const std::string m_l_u_s_name
std::vector< float > m_l_x_s_
std::vector< std::string > m_reco_labels_out
std::vector< int64_t > m_l_batch_shape
std::vector< int64_t > m_l_edge_index_h_batch_
std::vector< int64_t > m_l_u_s_shape
std::vector< int64_t > m_l_edge_index_
std::vector< int64_t > m_edge_out_shape
void clear() override
This method clears the parser object.
const std::string m_l_x_s_name
std::vector< int64_t > m_l_edge_index_h_shape
void reconstructOutputs(const HyPERGraph &hyperGraph) override
This method implements the reconstruction of the outputs from the parser object into physcally meanin...
const std::string m_l_edge_attr_s_name
std::vector< float > m_l_edge_attr_s_
std::vector< int64_t > m_l_edge_index_h_
std::vector< float > m_reco_scores_out
void RecoTtbarAllHadronic(const HyPERGraph &hyperGraph, const scores &edge_scores, const scores &hyperedge_scores, indices &reco_indices, std::vector< float > &reco_scores, std::vector< std::string > &reco_labels)
Reconstruct the ttbar all hadronic topology.
void flatTensorAndSetShape(const std::vector< std::vector< T > > &input, std::vector< T > &flatTensor, std::vector< int64_t > &shape)
std::vector< std::vector< T > > convertONNXOutput(T *onnxOutput, const std::vector< int64_t > &shape)