Skip to content

Commit

Permalink
Fixed source installation for single and double precision.
Browse files Browse the repository at this point in the history
  • Loading branch information
Smantii committed Nov 15, 2024
1 parent 7130a87 commit f9a5d1f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/evaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ void InitEval(py::module_ &m)

}, py::arg("tree"), py::arg("dataset"), py::arg("range"), py::arg("target"), py::arg("metric") = "rsquared");

m.def("PoissonLikelihood", [](py::array_t<float> x, py::array_t<float> y){
m.def("PoissonLikelihood", [](py::array_t<Operon::Scalar> x, py::array_t<Operon::Scalar> y){
return detail::PoissonLikelihood(std::move(x), std::move(y));
});

m.def("PoissonLikelihood", [](py::array_t<float> x, py::array_t<float> y, py::array_t<float> w){
m.def("PoissonLikelihood", [](py::array_t<Operon::Scalar> x, py::array_t<Operon::Scalar> y, py::array_t<Operon::Scalar> w){
return detail::PoissonLikelihood(std::move(x), std::move(y), std::move(w));
});

Expand All @@ -142,12 +142,12 @@ void InitEval(py::module_ &m)

TDispatch dtable;

auto result = py::array_t<double>(static_cast<pybind11::ssize_t>(trees.size()));
auto result = py::array_t<Operon::Scalar>(static_cast<pybind11::ssize_t>(trees.size()));
auto buf = result.request();
auto values = d.GetValues(target).subspan(r.Start(), r.Size());

// TODO: make this run in parallel with taskflow
std::transform(trees.begin(), trees.end(), static_cast<double*>(buf.ptr), [&](auto const& t) -> double {
std::transform(trees.begin(), trees.end(), static_cast<Operon::Scalar*>(buf.ptr), [&](auto const& t) -> double {
auto estimated = TInterpreter{dtable, d, t}.Evaluate({}, r);
return (*error)(estimated, values);
});
Expand Down

0 comments on commit f9a5d1f

Please sign in to comment.