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>
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
定义 xgboost 的配置宏和基本类型。
xgboost 用于存放所有外部数据的内部数据结构。
定义: data.h:549
线性更新器的接口
定义: linear_updater.h:30
Context const * ctx_
定义: linear_updater.h:32
virtual void Update(linalg::Matrix< GradientPair > *in_gpair, DMatrix *data, gbm::GBLinearModel *model, double sum_instance_weight)=0
根据梯度更新线性模型。
static LinearUpdater * Create(const std::string &name, Context const *)
根据名称创建线性更新器。
virtual void Configure(const std::vector< std::pair< std::string, std::string > > &args)=0
使用给定参数初始化更新器。
~LinearUpdater() override=default
虚析构函数
张量存储。要将其用于其他功能,如切片,需要先获取视图...。
定义: linalg.h:762
xgboost 的输入数据结构。
一个设备和主机向量抽象层。
定义 XGBoost 中不同组件的抽象接口。
多目标树的核心数据结构。
定义: base.h:89
定义: model.h:31
XGBoost 的运行时上下文。包含线程和设备等信息。
定义: context.h:133
线性更新器的注册表条目。
定义: linear_updater.h:67