FCCAnalyses
Loading...
Searching...
No Matches
WeaverInterface Class Reference

#include <addons/ONNXRuntime/WeaverInterface.h>

Collaboration diagram for WeaverInterface:

Classes

struct  PreprocessParams
 

Public Types

using ConstituentVars = rv::RVec<float>
 

Public Member Functions

 WeaverInterface (const std::string &onnx_filename="", const std::string &json_filename="", const rv::RVec< std::string > &vars={})
 Initialise an inference model from Weaver output ONNX/JSON files and a list of variables to be provided for each event/jet.
 
rv::RVec< float > run (const rv::RVec< ConstituentVars > &)
 Run inference given a list of jet constituents variables.
 

Private Member Functions

std::vector< float > center_norm_pad (const rv::RVec< float > &input, float center, float scale, size_t min_length, size_t max_length, float pad_value=0, float replace_inf_value=0, float min=0, float max=-1)
 
size_t variablePos (const std::string &) const
 

Private Attributes

std::unique_ptr< ONNXRuntimeonnx_
 
std::vector< std::string > variables_names_
 
ONNXRuntime::Tensor< long > input_shapes_
 
std::vector< unsigned int > input_sizes_
 
std::unordered_map< std::string, PreprocessParamsprep_info_map_
 
ONNXRuntime::Tensor< float > data_
 

Member Typedef Documentation

◆ ConstituentVars

using WeaverInterface::ConstituentVars = rv::RVec<float>

Constructor & Destructor Documentation

◆ WeaverInterface()

WeaverInterface::WeaverInterface ( const std::string & onnx_filename = "",
const std::string & json_filename = "",
const rv::RVec< std::string > & vars = {} )
explicit

Initialise an inference model from Weaver output ONNX/JSON files and a list of variables to be provided for each event/jet.

Member Function Documentation

◆ center_norm_pad()

std::vector< float > WeaverInterface::center_norm_pad ( const rv::RVec< float > & input,
float center,
float scale,
size_t min_length,
size_t max_length,
float pad_value = 0,
float replace_inf_value = 0,
float min = 0,
float max = -1 )
private

◆ run()

rv::RVec< float > WeaverInterface::run ( const rv::RVec< ConstituentVars > & constituents)

Run inference given a list of jet constituents variables.

◆ variablePos()

size_t WeaverInterface::variablePos ( const std::string & var_name) const
private

Member Data Documentation

◆ data_

ONNXRuntime::Tensor<float> WeaverInterface::data_
private

◆ input_shapes_

ONNXRuntime::Tensor<long> WeaverInterface::input_shapes_
private

◆ input_sizes_

std::vector<unsigned int> WeaverInterface::input_sizes_
private

◆ onnx_

std::unique_ptr<ONNXRuntime> WeaverInterface::onnx_
private

◆ prep_info_map_

std::unordered_map<std::string, PreprocessParams> WeaverInterface::prep_info_map_
private

◆ variables_names_

std::vector<std::string> WeaverInterface::variables_names_
private

The documentation for this class was generated from the following files: