Skip to content

Commit

Permalink
Remove saving cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed Sep 13, 2019
1 parent fe69a6a commit 791b878
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
2 changes: 1 addition & 1 deletion plugin/example/custom_obj.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class MyLogistic : public ObjFunction {
}

void Load(Json const& in) override {
param_.InitAllowUnknown(fromJson(get<Object>(in["MyLogisticParam"])));
fromJson(in["MyLogisticParam"], &param_);
}

private:
Expand Down
11 changes: 0 additions & 11 deletions src/learner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -407,12 +407,6 @@ class LearnerImpl : public Learner {
metrics[i] = String(metrics_[i]->Name());
}
learner["metrics"] = Array(metrics);

std::map<std::string, Json> j_cfg;
for (auto const& kv : cfg_) {
j_cfg[kv.first] = kv.second;
}
learner["cfg_cache"] = Object(std::move(j_cfg));
}

void Load(Json const& in) override {
Expand Down Expand Up @@ -442,11 +436,6 @@ class LearnerImpl : public Learner {
metric_names_[i]= get<String>(j_metrics[i]);
metrics_[i] = std::unique_ptr<Metric>(Metric::Create(metric_names_.back(), &generic_param_));
}

auto j_cfg = get<Object const>(learner.at("cfg_cache"));
for (auto const& kv : j_cfg) {
cfg_[kv.first] = get<String const>(kv.second);
}
}

// rabit save model to rabit checkpoint
Expand Down
8 changes: 2 additions & 6 deletions tests/cpp/gbm/test_gbtree.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ TEST(GBTree, SelectTreeMethod) {
{"num_feature", n_feat}});
ASSERT_EQ(tparam.updater, "grow_gpu_hist");
ASSERT_EQ(tparam.predictor, "gpu_predictor");
#endif
#endif // XGBOOST_USE_CUDA
}

#ifdef XGBOOST_USE_CUDA
Expand Down Expand Up @@ -109,9 +109,7 @@ TEST(GBTree, ChoosePredictor) {
// data is not pulled back into host
ASSERT_FALSE(data.HostCanWrite());
}
<<<<<<< HEAD
#endif
=======
#endif // XGBOOST_USE_CUDA

// Some other parts of test are in `Tree.Json_IO'.
TEST(GBTree, Json_IO) {
Expand Down Expand Up @@ -159,6 +157,4 @@ TEST(Dart, Json_IO) {
auto j_weight_drop = get<Array>(model["weight_drop"]);
ASSERT_EQ(j_weight_drop.size(), 1); // One tree is trained.
}

>>>>>>> Add JSON IO for various components.
} // namespace xgboost

0 comments on commit 791b878

Please sign in to comment.