Commit 548cec82 authored by Jeff Daily's avatar Jeff Daily
Browse files

Merge branch 'master' into rocm3

parents 2f7bd8ef 5dbfcdc4
......@@ -4,8 +4,8 @@
* license information.
*/
#ifndef LIGHTGBM_TREELEARNER_CUDA_CUDA_GRADIENT_DISCRETIZER_HPP_
#define LIGHTGBM_TREELEARNER_CUDA_CUDA_GRADIENT_DISCRETIZER_HPP_
#ifndef LIGHTGBM_SRC_TREELEARNER_CUDA_CUDA_GRADIENT_DISCRETIZER_HPP_
#define LIGHTGBM_SRC_TREELEARNER_CUDA_CUDA_GRADIENT_DISCRETIZER_HPP_
#ifdef USE_CUDA
......@@ -115,4 +115,4 @@ class CUDAGradientDiscretizer: public GradientDiscretizer {
} // namespace LightGBM
#endif // USE_CUDA
#endif // LIGHTGBM_TREELEARNER_CUDA_CUDA_GRADIENT_DISCRETIZER_HPP_
#endif // LIGHTGBM_SRC_TREELEARNER_CUDA_CUDA_GRADIENT_DISCRETIZER_HPP_
......@@ -9,6 +9,7 @@
#include "cuda_histogram_constructor.hpp"
#include <algorithm>
#include <vector>
namespace LightGBM {
......
......@@ -3,8 +3,8 @@
* Licensed under the MIT License. See LICENSE file in the project root for
* license information.
*/
#ifndef LIGHTGBM_TREELEARNER_CUDA_CUDA_HISTOGRAM_CONSTRUCTOR_HPP_
#define LIGHTGBM_TREELEARNER_CUDA_CUDA_HISTOGRAM_CONSTRUCTOR_HPP_
#ifndef LIGHTGBM_SRC_TREELEARNER_CUDA_CUDA_HISTOGRAM_CONSTRUCTOR_HPP_
#define LIGHTGBM_SRC_TREELEARNER_CUDA_CUDA_HISTOGRAM_CONSTRUCTOR_HPP_
#ifdef USE_CUDA
......@@ -193,4 +193,4 @@ class CUDAHistogramConstructor {
} // namespace LightGBM
#endif // USE_CUDA
#endif // LIGHTGBM_TREELEARNER_CUDA_CUDA_HISTOGRAM_CONSTRUCTOR_HPP_
#endif // LIGHTGBM_SRC_TREELEARNER_CUDA_CUDA_HISTOGRAM_CONSTRUCTOR_HPP_
......@@ -3,8 +3,8 @@
* Licensed under the MIT License. See LICENSE file in the project root for
* license information.
*/
#ifndef LIGHTGBM_TREELEARNER_CUDA_CUDA_LEAF_SPLITS_HPP_
#define LIGHTGBM_TREELEARNER_CUDA_CUDA_LEAF_SPLITS_HPP_
#ifndef LIGHTGBM_SRC_TREELEARNER_CUDA_CUDA_LEAF_SPLITS_HPP_
#define LIGHTGBM_SRC_TREELEARNER_CUDA_CUDA_LEAF_SPLITS_HPP_
#ifdef USE_CUDA
......@@ -176,4 +176,4 @@ class CUDALeafSplits {
} // namespace LightGBM
#endif // USE_CUDA
#endif // LIGHTGBM_TREELEARNER_CUDA_CUDA_LEAF_SPLITS_HPP_
#endif // LIGHTGBM_SRC_TREELEARNER_CUDA_CUDA_LEAF_SPLITS_HPP_
......@@ -16,6 +16,7 @@
#include <algorithm>
#include <memory>
#include <vector>
namespace LightGBM {
......
......@@ -3,8 +3,8 @@
* Licensed under the MIT License. See LICENSE file in the project root for
* license information.
*/
#ifndef LIGHTGBM_TREELEARNER_CUDA_CUDA_SINGLE_GPU_TREE_LEARNER_HPP_
#define LIGHTGBM_TREELEARNER_CUDA_CUDA_SINGLE_GPU_TREE_LEARNER_HPP_
#ifndef LIGHTGBM_SRC_TREELEARNER_CUDA_CUDA_SINGLE_GPU_TREE_LEARNER_HPP_
#define LIGHTGBM_SRC_TREELEARNER_CUDA_CUDA_SINGLE_GPU_TREE_LEARNER_HPP_
#include <memory>
#include <vector>
......@@ -162,4 +162,4 @@ class CUDASingleGPUTreeLearner: public SerialTreeLearner {
} // namespace LightGBM
#endif // USE_CUDA
#endif // LIGHTGBM_TREELEARNER_CUDA_CUDA_SINGLE_GPU_TREE_LEARNER_HPP_
#endif // LIGHTGBM_SRC_TREELEARNER_CUDA_CUDA_SINGLE_GPU_TREE_LEARNER_HPP_
......@@ -2,6 +2,7 @@
* Copyright (c) 2016 Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*/
#include <algorithm>
#include <cstring>
#include <tuple>
#include <vector>
......@@ -11,8 +12,7 @@
namespace LightGBM {
template <typename TREELEARNER_T>
DataParallelTreeLearner<TREELEARNER_T>::DataParallelTreeLearner(const Config* config)
:TREELEARNER_T(config) {
DataParallelTreeLearner<TREELEARNER_T>::DataParallelTreeLearner(const Config* config):TREELEARNER_T(config) {
}
template <typename TREELEARNER_T>
......
......@@ -2,8 +2,8 @@
* Copyright (c) 2016 Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*/
#ifndef LIGHTGBM_TREELEARNER_DATA_PARTITION_HPP_
#define LIGHTGBM_TREELEARNER_DATA_PARTITION_HPP_
#ifndef LIGHTGBM_SRC_TREELEARNER_DATA_PARTITION_HPP_
#define LIGHTGBM_SRC_TREELEARNER_DATA_PARTITION_HPP_
#include <LightGBM/dataset.h>
#include <LightGBM/meta.h>
......@@ -167,4 +167,4 @@ class DataPartition {
};
} // namespace LightGBM
#endif // LightGBM_TREELEARNER_DATA_PARTITION_HPP_
#endif // LIGHTGBM_SRC_TREELEARNER_DATA_PARTITION_HPP_
......@@ -6,6 +6,9 @@
#include "feature_histogram.hpp"
#include <algorithm>
#include <vector>
namespace LightGBM {
void FeatureHistogram::FuncForCategorical() {
......@@ -381,8 +384,11 @@ void FeatureHistogram::FindBestThresholdCategoricalInner(double sum_gradient,
}
}
template <bool USE_RAND, bool USE_MC, bool USE_L1, bool USE_MAX_OUTPUT, bool USE_SMOOTHING, typename PACKED_HIST_BIN_T, typename PACKED_HIST_ACC_T,
typename HIST_BIN_T, typename HIST_ACC_T, int HIST_BITS_BIN, int HIST_BITS_ACC>
template <
bool USE_RAND, bool USE_MC, bool USE_L1, bool USE_MAX_OUTPUT, bool USE_SMOOTHING,
typename PACKED_HIST_BIN_T, typename PACKED_HIST_ACC_T, typename HIST_BIN_T, typename HIST_ACC_T,
int HIST_BITS_BIN, int HIST_BITS_ACC
>
void FeatureHistogram::FindBestThresholdCategoricalIntInner(int64_t int_sum_gradient_and_hessian,
const double grad_scale, const double hess_scale,
data_size_t num_data,
......
......@@ -3,8 +3,8 @@
* Licensed under the MIT License. See LICENSE file in the project root for
* license information.
*/
#ifndef LIGHTGBM_TREELEARNER_FEATURE_HISTOGRAM_HPP_
#define LIGHTGBM_TREELEARNER_FEATURE_HISTOGRAM_HPP_
#ifndef LIGHTGBM_SRC_TREELEARNER_FEATURE_HISTOGRAM_HPP_
#define LIGHTGBM_SRC_TREELEARNER_FEATURE_HISTOGRAM_HPP_
#include <LightGBM/bin.h>
#include <LightGBM/dataset.h>
......@@ -1594,4 +1594,4 @@ class HistogramPool {
};
} // namespace LightGBM
#endif // LightGBM_TREELEARNER_FEATURE_HISTOGRAM_HPP_
#endif // LIGHTGBM_SRC_TREELEARNER_FEATURE_HISTOGRAM_HPP_
......@@ -11,8 +11,7 @@ namespace LightGBM {
template <typename TREELEARNER_T>
FeatureParallelTreeLearner<TREELEARNER_T>::FeatureParallelTreeLearner(const Config* config)
:TREELEARNER_T(config) {
FeatureParallelTreeLearner<TREELEARNER_T>::FeatureParallelTreeLearner(const Config* config):TREELEARNER_T(config) {
}
template <typename TREELEARNER_T>
......
......@@ -11,6 +11,11 @@
#include <LightGBM/utils/array_args.h>
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include "../io/dense_bin.hpp"
......
......@@ -2,8 +2,8 @@
* Copyright (c) 2017 Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*/
#ifndef LIGHTGBM_TREELEARNER_GPU_TREE_LEARNER_H_
#define LIGHTGBM_TREELEARNER_GPU_TREE_LEARNER_H_
#ifndef LIGHTGBM_SRC_TREELEARNER_GPU_TREE_LEARNER_H_
#define LIGHTGBM_SRC_TREELEARNER_GPU_TREE_LEARNER_H_
#include <LightGBM/dataset.h>
#include <LightGBM/feature_group.h>
......@@ -284,4 +284,4 @@ class GPUTreeLearner: public SerialTreeLearner {
#endif // USE_GPU
#endif // LightGBM_TREELEARNER_GPU_TREE_LEARNER_H_
#endif // LIGHTGBM_SRC_TREELEARNER_GPU_TREE_LEARNER_H_
......@@ -3,8 +3,8 @@
* Licensed under the MIT License. See LICENSE file in the project root for
* license information.
*/
#ifndef LIGHTGBM_TREE_LEARNER_GRADIENT_DISCRETIZER_HPP_
#define LIGHTGBM_TREE_LEARNER_GRADIENT_DISCRETIZER_HPP_
#ifndef LIGHTGBM_SRC_TREELEARNER_GRADIENT_DISCRETIZER_HPP_
#define LIGHTGBM_SRC_TREELEARNER_GRADIENT_DISCRETIZER_HPP_
#include <LightGBM/bin.h>
#include <LightGBM/meta.h>
......@@ -125,4 +125,4 @@ class GradientDiscretizer {
} // namespace LightGBM
#endif // LIGHTGBM_TREE_LEARNER_GRADIENT_DISCRETIZER_HPP_
#endif // LIGHTGBM_SRC_TREELEARNER_GRADIENT_DISCRETIZER_HPP_
......@@ -2,8 +2,8 @@
* Copyright (c) 2016 Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*/
#ifndef LIGHTGBM_TREELEARNER_LEAF_SPLITS_HPP_
#define LIGHTGBM_TREELEARNER_LEAF_SPLITS_HPP_
#ifndef LIGHTGBM_SRC_TREELEARNER_LEAF_SPLITS_HPP_
#define LIGHTGBM_SRC_TREELEARNER_LEAF_SPLITS_HPP_
#include <LightGBM/config.h>
#include <LightGBM/meta.h>
......@@ -272,4 +272,4 @@ class LeafSplits {
};
} // namespace LightGBM
#endif // LightGBM_TREELEARNER_LEAF_SPLITS_HPP_
#endif // LIGHTGBM_SRC_TREELEARNER_LEAF_SPLITS_HPP_
......@@ -7,6 +7,8 @@
#include <Eigen/Dense>
#include <algorithm>
#include <memory>
#include <vector>
namespace LightGBM {
......@@ -188,7 +190,7 @@ void LinearTreeLearner<TREE_LEARNER_TYPE>::CalculateLinear(Tree* tree, bool is_r
return;
}
// calculate coefficients using the method described in Eq 3 of https://arxiv.org/pdf/1802.05640.pdf
// calculate coefficients using the method described in Eq 3 of https://arxiv.org/abs/1802.05640
// the coefficients vector is given by
// - (X_T * H * X + lambda) ^ (-1) * (X_T * g)
// where:
......
......@@ -2,8 +2,8 @@
* Copyright (c) 2020 Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*/
#ifndef LIGHTGBM_TREELEARNER_LINEAR_TREE_LEARNER_H_
#define LIGHTGBM_TREELEARNER_LINEAR_TREE_LEARNER_H_
#ifndef LIGHTGBM_SRC_TREELEARNER_LINEAR_TREE_LEARNER_H_
#define LIGHTGBM_SRC_TREELEARNER_LINEAR_TREE_LEARNER_H_
#include <cmath>
#include <cstdio>
......@@ -126,4 +126,4 @@ class LinearTreeLearner: public TREE_LEARNER_TYPE {
};
} // namespace LightGBM
#endif // LightGBM_TREELEARNER_LINEAR_TREE_LEARNER_H_
#endif // LIGHTGBM_SRC_TREELEARNER_LINEAR_TREE_LEARNER_H_
......@@ -3,8 +3,8 @@
* Licensed under the MIT License. See LICENSE file in the project root for
* license information.
*/
#ifndef LIGHTGBM_TREELEARNER_MONOTONE_CONSTRAINTS_HPP_
#define LIGHTGBM_TREELEARNER_MONOTONE_CONSTRAINTS_HPP_
#ifndef LIGHTGBM_SRC_TREELEARNER_MONOTONE_CONSTRAINTS_HPP_
#define LIGHTGBM_SRC_TREELEARNER_MONOTONE_CONSTRAINTS_HPP_
#include <LightGBM/tree.h>
......@@ -1183,4 +1183,4 @@ LeafConstraintsBase* LeafConstraintsBase::Create(const Config* config,
}
} // namespace LightGBM
#endif // LIGHTGBM_TREELEARNER_MONOTONE_CONSTRAINTS_HPP_
#endif // LIGHTGBM_SRC_TREELEARNER_MONOTONE_CONSTRAINTS_HPP_
......@@ -2,8 +2,8 @@
* Copyright (c) 2016 Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*/
#ifndef LIGHTGBM_TREELEARNER_PARALLEL_TREE_LEARNER_H_
#define LIGHTGBM_TREELEARNER_PARALLEL_TREE_LEARNER_H_
#ifndef LIGHTGBM_SRC_TREELEARNER_PARALLEL_TREE_LEARNER_H_
#define LIGHTGBM_SRC_TREELEARNER_PARALLEL_TREE_LEARNER_H_
#include <LightGBM/network.h>
#include <LightGBM/utils/array_args.h>
......@@ -232,4 +232,4 @@ inline void SyncUpGlobalBestSplit(char* input_buffer_, char* output_buffer_, Spl
}
} // namespace LightGBM
#endif // LightGBM_TREELEARNER_PARALLEL_TREE_LEARNER_H_
#endif // LIGHTGBM_SRC_TREELEARNER_PARALLEL_TREE_LEARNER_H_
......@@ -10,10 +10,13 @@
#include <LightGBM/utils/common.h>
#include <algorithm>
#include <memory>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
#include "cost_effective_gradient_boosting.hpp"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment