xgboost
include
xgboost
linear_updater.h
转到此文件的文档。
1
/*
2
* 由 Contributors 2018 版权所有
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
}
// 命名空间 gbm
26
30
/** \brief interface of linear updater */
class
LinearUpdater
:
public
Configurable
{
31
protected
32
Context
const
*
ctx_
;
33
34
public
36
/** \brief virtual destructor */
~LinearUpdater
()
override
=
default
;
41
/**
42
* \brief Initialize the updater with given arguments.
43
*/
52
/**
53
* \brief Updates linear model given gradients.
54
*/
59
/**
60
* \brief Create a linear updater given name.
61
*/
65
/** \brief Registry entry for linear updater. */
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
}
// 命名空间 xgboost
base.h
定义 xgboost 的配置宏和基本类型。
xgboost::DMatrix
xgboost 用于存放所有外部数据的内部数据结构。
定义:
data.h:549
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:762
data.h
xgboost 的输入数据结构。
host_device_vector.h
一个设备和主机向量抽象层。
model.h
定义 XGBoost 中不同组件的抽象接口。
xgboost
多目标树的核心数据结构。
定义:
base.h:89
xgboost::Configurable
定义:
model.h:31
xgboost::Context
XGBoost 的运行时上下文。包含线程和设备等信息。
定义:
context.h:133
xgboost::LinearUpdaterReg
线性更新器的注册表条目。
定义:
linear_updater.h:67
于 2025 年 5 月 26 日 21:34:52 为 xgboost 生成,由
1.9.1 生成