Medial Code Documentation
Loading...
Searching...
No Matches
meta.h
1#ifndef LIGHTGBM_META_H_
2#define LIGHTGBM_META_H_
3
4#include <cstdint>
5
6#include <limits>
7#include <vector>
8#include <functional>
9#include <memory>
10
11namespace LightGBM {
12
14typedef int32_t data_size_t;
15
16// Enable following marco to use double for score_t
17// #define SCORE_T_USE_DOUBLE
18
19// Enable following marco to use double for label_t
20// #define LABEL_T_USE_DOUBLE
21
23#ifdef SCORE_T_USE_DOUBLE
24typedef double score_t;
25#else
26typedef float score_t;
27#endif
28
30#ifdef LABEL_T_USE_DOUBLE
31typedef double label_t;
32#else
33typedef float label_t;
34#endif
35
36const score_t kMinScore = -std::numeric_limits<score_t>::infinity();
37
38const score_t kEpsilon = 1e-15f;
39
40const double kZeroThreshold = 1e-35f;
41
42
43typedef int32_t comm_size_t;
44
45using PredictFunction =
46std::function<void(const std::vector<std::pair<int, double>>&, double* output)>;
47
48typedef void(*ReduceFunction)(const char* input, char* output, int type_size, comm_size_t array_size);
49
50
51typedef void(*ReduceScatterFunction)(char* input, comm_size_t input_size, int type_size,
52 const comm_size_t* block_start, const comm_size_t* block_len, int num_block, char* output, comm_size_t output_size,
53 const ReduceFunction& reducer);
54
55typedef void(*AllgatherFunction)(char* input, comm_size_t input_size, const comm_size_t* block_start,
56 const comm_size_t* block_len, int num_block, char* output, comm_size_t output_size);
57
58
59#define NO_SPECIFIC (-1)
60
61#if (_MSC_VER <= 1800)
62#define __func__ __FUNCTION__
63#endif
64
65} // namespace LightGBM
66
67#endif // LightGBM_META_H_
desc and descl2 fields must be written in reStructuredText format
Definition application.h:10
float score_t
Type of score, and gradients.
Definition meta.h:26
float label_t
Type of metadata, include weight and label.
Definition meta.h:33
int32_t data_size_t
Type of data size, it is better to use signed type.
Definition meta.h:14