xgboost
include
xgboost
linear_updater.h
前往此文件文档。
1
/*
2
* 版权所有 2018 Contributors
3
*/
4
#pragma once
5
6
#include <dmlc/registry.h>
7
#include <
xgboost/base.h
>
8
#include <
xgboost/data.h
>
9
#include <
xgboost/host_device_vector.h
>
10
#include <
xgboost/model.h
>
11
12
#include <functional>
13
#include <string>
14
#include <utility>
15
#include <vector>
16
17
18
namespace
xgboost
{
19
20
class
Json;
21
struct
Context;
22
23
namespace
gbm {
24
class
GBLinearModel;
25
}
// namespace gbm
26
30
class
LinearUpdater
:
public
Configurable
{
31
protected
32
Context
const
*
ctx_
;
33
34
public
36
~LinearUpdater
()
override
=
default
;
41
virtual
void
Configure
(
42
const
std::vector<std::pair<std::string, std::string> >& args) = 0;
43
52
virtual
void
Update
(
linalg::Matrix<GradientPair>
* in_gpair,
DMatrix
* data,
53
gbm::GBLinearModel* model,
double
sum_instance_weight) = 0;
54
59
static
LinearUpdater
*
Create
(
const
std::string& name,
Context
const
*);
60
};
61
65
struct
LinearUpdaterReg
66
:
public
dmlc::FunctionRegEntryBase<LinearUpdaterReg,
67
std::function<LinearUpdater*()> > {};
68
72
#define XGBOOST_REGISTER_LINEAR_UPDATER(UniqueId, Name) \
73
static DMLC_ATTRIBUTE_UNUSED ::xgboost::LinearUpdaterReg& \
74
__make_##LinearUpdaterReg##_##UniqueId##__ = \
75
::dmlc::Registry< ::xgboost::LinearUpdaterReg>::Get()->__REGISTER__( \
76
Name)
77
78
}
// namespace xgboost
base.h
为 xgboost 定义配置宏和基本类型。
xgboost::DMatrix
内部数据结构,由XGBoost用于保存所有外部数据。
Definition:
data.h:573
xgboost::LinearUpdater
线性更新器的接口
定义:
linear_updater.h:30
xgboost::LinearUpdater::ctx_
Context const * ctx_
定义:
linear_updater.h:32
xgboost::LinearUpdater::Update
virtual void Update(linalg::Matrix< GradientPair > *in_gpair, DMatrix *data, gbm::GBLinearModel *model, double sum_instance_weight)=0
根据梯度更新线性模型。
xgboost::LinearUpdater::Create
static LinearUpdater * Create(const std::string &name, Context const *)
根据名称创建线性更新器。
xgboost::LinearUpdater::Configure
virtual void Configure(const std::vector< std::pair< std::string, std::string > > &args)=0
使用给定参数初始化更新器。
xgboost::LinearUpdater::~LinearUpdater
~LinearUpdater() override=default
虚析构函数
xgboost::linalg::Tensor
一个张量存储。要将其用于切片等其他功能,首先需要获取一个视图...
定义:
linalg.h:745
data.h
xgboost 的输入数据结构。
host_device_vector.h
设备与主机向量抽象层。
model.h
定义 XGBoost 中不同组件的抽象接口。
xgboost
集成目标、gbm和评估的学习器接口。这是用户面临的XGB...
Definition:
base.h:97
xgboost::Configurable
定义:
model.h:28
xgboost::Context
XGBoost的运行时上下文。包含线程和设备等信息。
Definition:
context.h:133
xgboost::LinearUpdaterReg
线性更新器的注册条目。
定义:
linear_updater.h:67
生成于 2025 年 10 月 17 日星期五 23:27:08,由
1.9.1 为 xgboost 生成