DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
triggeralgs
include
triggeralgs
ProtoDUNEBSMWindow
CompiledModelInterface.hpp
Go to the documentation of this file.
1
#ifndef TRIGGERALGS_COMPILEDMODELINTERFACE_HPP_
2
#define TRIGGERALGS_COMPILEDMODELINTERFACE_HPP_
3
4
#include "
triggeralgs/ProtoDUNEBSMWindow/treelitemodel.hpp
"
5
#include <string>
6
#include <fstream>
7
#include <algorithm>
8
9
namespace
triggeralgs
{
10
11
// Interface for deploying XGBoost model using compiled C-code
12
// XGBoost model converted to treelite and then converted to c-code
13
14
// Foward declare base class for the treelite model
15
class
TreeliteModelBase
;
16
17
class
CompiledModelInterface
{
18
public
:
19
20
CompiledModelInterface
(
int
nbatch,
bool
is_pdvd);
21
22
~CompiledModelInterface
();
23
24
// Get number of features in model
25
int
GetNumFeatures
();
26
27
// Run prediction with GBDT
28
void
Predict
(
Entry
*input,
float
*result);
29
30
// Is it a neutrino or cosmic according to GBDT?
31
bool
Classify
(
const
float
*result,
float
bdt_threshold);
32
33
protected
:
34
35
std::unique_ptr<TreeliteModelBase>
model_ptr
;
36
int
num_batch
;
37
38
};
39
}
// triggeralgs
40
41
#endif
// TRIGGERALGS_COMPILEDMODELINTERFACE_HPP_
triggeralgs::CompiledModelInterface::Predict
void Predict(Entry *input, float *result)
Definition
CompiledModelInterface.cpp:21
triggeralgs::CompiledModelInterface::GetNumFeatures
int GetNumFeatures()
Definition
CompiledModelInterface.cpp:17
triggeralgs::CompiledModelInterface::num_batch
int num_batch
Definition
CompiledModelInterface.hpp:36
triggeralgs::CompiledModelInterface::model_ptr
std::unique_ptr< TreeliteModelBase > model_ptr
Definition
CompiledModelInterface.hpp:35
triggeralgs::CompiledModelInterface::Classify
bool Classify(const float *result, float bdt_threshold)
Definition
CompiledModelInterface.cpp:27
triggeralgs::CompiledModelInterface::CompiledModelInterface
CompiledModelInterface(int nbatch, bool is_pdvd)
Definition
CompiledModelInterface.cpp:7
triggeralgs::CompiledModelInterface::~CompiledModelInterface
~CompiledModelInterface()
Definition
CompiledModelInterface.cpp:15
triggeralgs::TreeliteModelBase
Base class: defines shared interface and utilities for all models.
Definition
treelitemodel.hpp:27
triggeralgs
Definition
AbstractFactory.hpp:18
treelitemodel.hpp
triggeralgs::Entry
Definition
treelitemodel.hpp:20
Generated on
for DUNE-DAQ by
1.17.0