8 #ifndef XGBOOST_TREE_UPDATER_H_
9 #define XGBOOST_TREE_UPDATER_H_
11 #include <dmlc/registry.h>
73 std::vector<RegTree*>
const& out_trees) = 0;
75 [[nodiscard]]
virtual char const*
Name()
const = 0;
91 :
public dmlc::FunctionRegEntryBase<
92 TreeUpdaterReg, std::function<TreeUpdater*(Context const* ctx, ObjInfo const* task)>> {};
106 #define XGBOOST_REGISTER_TREE_UPDATER(UniqueId, Name) \
107 static DMLC_ATTRIBUTE_UNUSED ::xgboost::TreeUpdaterReg& \
108 __make_##TreeUpdaterReg##_##UniqueId##__ = \
109 ::dmlc::Registry<::xgboost::TreeUpdaterReg>::Get()->__REGISTER__(Name)
Defines configuration macros and basic types for xgboost.
Internal data structured used by XGBoost to hold all external data.
Definition: data.h:549
interface of tree update module, that performs update of a tree.
Definition: tree_updater.h:37
Context const * ctx_
Definition: tree_updater.h:39
~TreeUpdater() override=default
static TreeUpdater * Create(const std::string &name, Context const *ctx, ObjInfo const *task)
Create a tree updater given name.
virtual bool CanModifyTree() const
Whether this updater can be used for updating existing trees.
Definition: tree_updater.h:56
virtual void Update(tree::TrainParam const *param, GradientContainer *gpair, DMatrix *p_fmat, common::Span< HostDeviceVector< bst_node_t >> out_position, std::vector< RegTree * > const &out_trees)=0
perform update to the tree models
TreeUpdater(const Context *ctx)
Definition: tree_updater.h:42
virtual void Configure(const Args &args)=0
Initialize the updater with given arguments.
virtual char const * Name() const =0
span class implementation, based on ISO++20 span<T>. The interface should be the same.
Definition: span.h:435
The input data structure of xgboost.
A device-and-host vector abstraction layer.
Linear algebra related utilities.
Defines the abstract interface for different components in XGBoost.
Learner interface that integrates objective, gbm and evaluation together. This is the user facing XGB...
Definition: base.h:89
std::vector< std::pair< std::string, std::string > > Args
Definition: base.h:306
Runtime context for XGBoost. Contains information like threads and device.
Definition: context.h:142
Container for gradient produced by objective.
Definition: gradient.h:16
A struct returned by objective, which determines task at hand. The struct is not used by any algorith...
Definition: task.h:22
Registry entry for tree updater.
Definition: tree_updater.h:92