Skip to content

Commit

Permalink
debug.
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed Jan 19, 2023
1 parent 23a2a19 commit 3fa18b5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/observer.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class TrainingObserver {
#if defined(XGBOOST_USE_DEBUG_OUTPUT)
bool constexpr static kObserve {true};
#else
bool constexpr static kObserve {false};
bool constexpr static kObserve {true};
#endif // defined(XGBOOST_USE_DEBUG_OUTPUT)

public:
Expand Down
6 changes: 6 additions & 0 deletions src/objective/rank_obj.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class LambdaMARTNDCG : public FitIntercept {
auto tj_low = make_slice(&tj_low_);
auto li = make_slice(&li_);
auto lj = make_slice(&lj_);
std::cout << "inv_idcg:" << inv_IDCG << ", q:" << query_id << std::endl;

for (std::size_t i = 0; i < cnt - 1 && i < ndcg_param_.lambdamart_truncation; ++i) {
for (std::size_t j = i + 1; j < cnt; ++j) {
Expand Down Expand Up @@ -194,6 +195,11 @@ class LambdaMARTNDCG : public FitIntercept {
}
});

std::cout << "gpairs" << std::endl;
for (auto v : h_gpair) {
std::cout << v << ", ";
}
std::cout << std::endl;
this->UpdatePositionBias(info);
}

Expand Down
1 change: 1 addition & 0 deletions src/objective/rank_obj.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ XGBOOST_DEVICE inline void LambdaNDCG(linalg::TensorView<float const, 1> labels,
hessian_ij /= (tj(rank_high) * ti(rank_low));
}

std::cout << "i:" << i << "j:" << j << ", h:" << idx_high << " l:" << idx_low << ", |Z|:" << delta_NDCG << ", lij:" << lambda_ij << ", hij:" << hessian_ij << std::endl;
auto pg = GradientPair{static_cast<float>(lambda_ij), static_cast<float>(hessian_ij)};
auto ng = GradientPair{static_cast<float>(-lambda_ij), static_cast<float>(hessian_ij)};

Expand Down

0 comments on commit 3fa18b5

Please sign in to comment.