MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / Init

Method Init

src/treelearner/data_parallel_tree_learner.cpp:23–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21
22template <typename TREELEARNER_T>
23void DataParallelTreeLearner<TREELEARNER_T>::Init(const Dataset* train_data, bool is_constant_hessian) {
24 // initialize SerialTreeLearner
25 TREELEARNER_T::Init(train_data, is_constant_hessian);
26 // Get local rank and global machine size
27 rank_ = Network::rank();
28 num_machines_ = Network::num_machines();
29 // allocate buffer for communication
30 size_t buffer_size = this->train_data_->NumTotalBin() * sizeof(HistogramBinEntry);
31
32 input_buffer_.resize(buffer_size);
33 output_buffer_.resize(buffer_size);
34
35 is_feature_aggregated_.resize(this->num_features_);
36
37 block_start_.resize(num_machines_);
38 block_len_.resize(num_machines_);
39
40 buffer_write_start_pos_.resize(this->num_features_);
41 buffer_read_start_pos_.resize(this->num_features_);
42 global_data_count_in_leaf_.resize(this->config_->num_leaves);
43}
44
45template <typename TREELEARNER_T>
46void DataParallelTreeLearner<TREELEARNER_T>::ResetConfig(const Config* config) {

Callers 1

BeforeTrainMethod · 0.45

Calls 2

NumTotalBinMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected