Skip to content

Commit

Permalink
Implement visitors for creating statistics backed by a `BitDecomposab…
Browse files Browse the repository at this point in the history
…leStatisticView`.
  • Loading branch information
michael-rapp committed Oct 2, 2024
1 parent 7070088 commit de5aae4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ namespace boosting {
};
auto bitDecomposableMatrixVisitor =
[&](std::unique_ptr<IQuantizationMatrix<BitDecomposableStatisticView>>& quantizationMatrixPtr) {
// TODO Implement
throw std::runtime_error("not implemented");
statisticsPtr = std::make_unique<
DenseDecomposableStatistics<Loss, OutputMatrix, IQuantizationMatrix<BitDecomposableStatisticView>,
BitDecomposableStatisticVector, EvaluationMeasure>>(
std::move(quantizationMatrixPtr), std::move(lossPtr), std::move(evaluationMeasurePtr),
ruleEvaluationFactory, outputMatrix, std::move(statisticMatrixPtr), std::move(scoreMatrixPtr));
};
quantizationPtr->visitQuantizationMatrix(denseDecomposableMatrixVisitor, bitDecomposableMatrixVisitor, {}, {});
return statisticsPtr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,12 @@ namespace boosting {
};
auto bitDecomposableMatrixVisitor =
[&](std::unique_ptr<IQuantizationMatrix<BitDecomposableStatisticView>>& quantizationMatrixPtr) {
// TODO Implement
throw std::runtime_error("not implemented");
statisticsPtr = std::make_unique<
DenseDecomposableStatistics<Loss, OutputMatrix, IQuantizationMatrix<BitDecomposableStatisticView>,
BitDecomposableStatisticVector, EvaluationMeasure>>(
std::move(quantizationMatrixPtr), std::move(this->lossPtr_),
std::move(this->evaluationMeasurePtr_), ruleEvaluationFactory, this->outputMatrix_,
std::move(decomposableStatisticMatrixPtr), std::move(this->scoreMatrixPtr_));
};
quantizationPtr->visitQuantizationMatrix(denseDecomposableMatrixVisitor, bitDecomposableMatrixVisitor,
{}, {});
Expand Down

0 comments on commit de5aae4

Please sign in to comment.