31namespace Experimental {
34template <
typename Backend = BranchlessJittedForest<
float>>
37 using Value_t =
typename Backend::Value_t;
47 RBDT(
const std::string &key,
const std::string &filename)
51 auto numOutputs = Internal::GetObjectSafe<std::vector<int>>(
file, filename, key +
"/num_outputs");
56 auto objective = Internal::GetObjectSafe<std::string>(
file, filename, key +
"/objective");
57 if (objective->compare(
"softmax") == 0)
74 template <
typename Vector>
92 std::vector<Value_t>
Compute(
const std::vector<Value_t> &
x) {
return this->Compute<std::vector<Value_t>>(
x); }
97 const auto rows =
x.GetShape()[0];
101 fBackends[i].Inference(
x.GetData(), rows, layout, &
y(0, i));
104 for (
int i = 0; i < static_cast<int>(rows); i++) {
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
Fast boosted decision tree inference.
RTensor< Value_t > Compute(const RTensor< Value_t > &x)
Compute model prediction on input RTensor.
std::vector< Value_t > Compute(const std::vector< Value_t > &x)
Compute model prediction on a single event.
typename Backend::Value_t Value_t
RBDT(const std::string &key, const std::string &filename)
Construct backends from model in ROOT file.
Vector Compute(const Vector &x)
Compute model prediction on a single event.
std::vector< Backend_t > fBackends
RTensor is a container with contiguous memory and shape information.
static constexpr double s
create variable transformations