Remove leaf vector, add tree serialisation test, fix Windows tests (#3989)
This commit is contained in:
@@ -408,8 +408,6 @@ template <typename ParamT>
|
||||
}
|
||||
/*! \return whether the statistics is not used yet */
|
||||
inline bool Empty() const { return sum_hess == 0.0; }
|
||||
/*! \brief set leaf vector value based on statistics */
|
||||
inline void SetLeafVec(const TrainParam& param, bst_float* vec) const {}
|
||||
// constructor to allow inheritance
|
||||
GradStats() = default;
|
||||
/*! \brief add statistics to the data */
|
||||
|
||||
@@ -130,7 +130,6 @@ class ColMaker: public TreeUpdater {
|
||||
p_tree->Stat(nid).loss_chg = snode_[nid].best.loss_chg;
|
||||
p_tree->Stat(nid).base_weight = snode_[nid].weight;
|
||||
p_tree->Stat(nid).sum_hess = static_cast<float>(snode_[nid].stats.sum_hess);
|
||||
snode_[nid].stats.SetLeafVec(param_, p_tree->Leafvec(nid));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -263,7 +263,6 @@ class HistMaker: public BaseMaker {
|
||||
inline void SetStats(RegTree *p_tree, int nid, const TStats &node_sum) {
|
||||
p_tree->Stat(nid).base_weight = static_cast<bst_float>(node_sum.CalcWeight(param_));
|
||||
p_tree->Stat(nid).sum_hess = static_cast<bst_float>(node_sum.sum_hess);
|
||||
node_sum.SetLeafVec(param_, p_tree->Leafvec(nid));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -203,7 +203,6 @@ void QuantileHistMaker::Builder::Update(const GHistIndexMatrix& gmat,
|
||||
p_tree->Stat(nid).loss_chg = snode_[nid].best.loss_chg;
|
||||
p_tree->Stat(nid).base_weight = snode_[nid].weight;
|
||||
p_tree->Stat(nid).sum_hess = static_cast<float>(snode_[nid].stats.sum_hess);
|
||||
snode_[nid].stats.SetLeafVec(param_, p_tree->Leafvec(nid));
|
||||
}
|
||||
|
||||
pruner_->Update(gpair, p_fmat, std::vector<RegTree*>{p_tree});
|
||||
|
||||
@@ -127,7 +127,6 @@ class TreeRefresher: public TreeUpdater {
|
||||
RegTree &tree = *p_tree;
|
||||
tree.Stat(nid).base_weight = static_cast<bst_float>(gstats[nid].CalcWeight(param_));
|
||||
tree.Stat(nid).sum_hess = static_cast<bst_float>(gstats[nid].sum_hess);
|
||||
gstats[nid].SetLeafVec(param_, tree.Leafvec(nid));
|
||||
if (tree[nid].IsLeaf()) {
|
||||
if (param_.refresh_leaf) {
|
||||
tree[nid].SetLeaf(tree.Stat(nid).base_weight * param_.learning_rate);
|
||||
|
||||
@@ -128,9 +128,6 @@ class SketchMaker: public BaseMaker {
|
||||
inline static void Reduce(SKStats &a, const SKStats &b) { // NOLINT(*)
|
||||
a.Add(b);
|
||||
}
|
||||
/*! \brief set leaf vector value based on statistics */
|
||||
inline void SetLeafVec(const TrainParam ¶m, bst_float *vec) const {
|
||||
}
|
||||
};
|
||||
inline void BuildSketch(const std::vector<GradientPair> &gpair,
|
||||
DMatrix *p_fmat,
|
||||
@@ -303,7 +300,6 @@ class SketchMaker: public BaseMaker {
|
||||
inline void SetStats(int nid, const SKStats &node_sum, RegTree *p_tree) {
|
||||
p_tree->Stat(nid).base_weight = static_cast<bst_float>(node_sum.CalcWeight(param_));
|
||||
p_tree->Stat(nid).sum_hess = static_cast<bst_float>(node_sum.sum_hess);
|
||||
node_sum.SetLeafVec(param_, p_tree->Leafvec(nid));
|
||||
}
|
||||
inline void EnumerateSplit(const WXQSketch::Summary &pos_grad,
|
||||
const WXQSketch::Summary &neg_grad,
|
||||
|
||||
Reference in New Issue
Block a user