Medial Code Documentation
Loading...
Searching...
No Matches
Public Member Functions
xgboost::tree::TreeSyncher Class Reference

syncher that synchronize the tree in all distributed nodes can implement various strategies, so far it is always set to node 0's tree More...

Inheritance diagram for xgboost::tree::TreeSyncher:
xgboost::TreeUpdater xgboost::Configurable

Public Member Functions

 TreeSyncher (Context const *tparam)
 
void Configure (const Args &) override
 Initialize the updater with given arguments.
 
void LoadConfig (Json const &) override
 Load configuration from JSON object.
 
void SaveConfig (Json *) const override
 Save configuration to JSON object.
 
char const * Name () const override
 
void Update (TrainParam const *, HostDeviceVector< GradientPair > *, DMatrix *, common::Span< HostDeviceVector< bst_node_t > >, const std::vector< RegTree * > &trees) override
 perform update to the tree models
 
- Public Member Functions inherited from xgboost::TreeUpdater
 TreeUpdater (const Context *ctx)
 
 ~TreeUpdater () override=default
 virtual destructor
 
virtual bool CanModifyTree () const
 Whether this updater can be used for updating existing trees.
 
virtual bool HasNodePosition () const
 Wether the out_position in Update is valid. This determines whether adaptive tree can be used.
 
virtual bool UpdatePredictionCache (const DMatrix *, linalg::MatrixView< float >)
 determines whether updater has enough knowledge about a given dataset to quickly update prediction cache its training data and performs the update if possible.
 

Additional Inherited Members

- Static Public Member Functions inherited from xgboost::TreeUpdater
static TreeUpdaterCreate (const std::string &name, Context const *ctx, ObjInfo const *task)
 Create a tree updater given name.
 
- Protected Attributes inherited from xgboost::TreeUpdater
Context const * ctx_ = nullptr
 

Detailed Description

syncher that synchronize the tree in all distributed nodes can implement various strategies, so far it is always set to node 0's tree

Member Function Documentation

◆ Configure()

void xgboost::tree::TreeSyncher::Configure ( const Args &  args)
inlineoverridevirtual

Initialize the updater with given arguments.

Parameters
argsarguments to the objective function.

Implements xgboost::TreeUpdater.

◆ LoadConfig()

void xgboost::tree::TreeSyncher::LoadConfig ( Json const &  in)
inlineoverridevirtual

Load configuration from JSON object.

Parameters
inJSON object containing the configuration

Implements xgboost::Configurable.

◆ Name()

char const * xgboost::tree::TreeSyncher::Name ( ) const
inlineoverridevirtual

Implements xgboost::TreeUpdater.

◆ SaveConfig()

void xgboost::tree::TreeSyncher::SaveConfig ( Json out) const
inlineoverridevirtual

Save configuration to JSON object.

Parameters
outpointer to output JSON object

Implements xgboost::Configurable.

◆ Update()

void xgboost::tree::TreeSyncher::Update ( TrainParam const *  param,
HostDeviceVector< GradientPair > *  gpair,
DMatrix data,
common::Span< HostDeviceVector< bst_node_t > >  out_position,
const std::vector< RegTree * > &  out_trees 
)
inlineoverridevirtual

perform update to the tree models

Parameters
paramHyper-parameter for constructing trees.
gpairthe gradient pair statistics of the data
dataThe data matrix passed to the updater.
out_positionThe leaf index for each row. The index is negated if that row is removed during sampling. So the 3th node is ~3.
out_treesreferences the trees to be updated, updater will change the content of trees note: all the trees in the vector are updated, with the same statistics, but maybe different random seeds, usually one tree is passed in at a time, there can be multiple trees when we train random forest style model

Implements xgboost::TreeUpdater.


The documentation for this class was generated from the following file: