How can I manually fit a single tree with a customized cost function ( from pytorch) and then update the model trees in xgboost?

Hello,

I am working this paper : Multi-Label Learning to Rank through Multi-Objective
Optimization

The algorithm is to used an customized gradient “lambda” from multiple cost functions (c_1, c_2, …c_K) in the xgboost training process.
image

Within the algorithm mentioned in the paper, I need to fit the t-th tree using the data ( see equation (3) below) where the label is constructed with the new gradients “lambda”. image
image

My question here is:

When I use Pytorch to build a customized cost function as well as its gradient, how can I use xgboost package to

  • fit a single tree with the new data (i.e. the set of (feature, residual) pairs )
  • update the model by adding the newly fitted tree in xgboost package.

Thank you here for your help.

Best,
Zongjun

Have you looked into custom objective?