-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use matrix for gradient. #9508
Use matrix for gradient. #9508
Conversation
- Use the `linalg::Matrix` for storing gradients. - New API for the custom objective. - Custom objective for multi-class/multi-target is now required to return the correct shape. - Custom objective for Python can accept arrays with any strides. (row-major, column-major)
4e6f51d
to
425d8d8
Compare
@rongou Would you like to help review this guy when time allows? |
@wbo4958 Could you please help take a look into the changes in the JVM packages? |
auto const labels_h = info.labels.HostView(); | ||
for (size_t i = 0; i < preds_h.size(); ++i) { | ||
bst_float w = info.GetWeight(i); | ||
float w = info.GetWeight(i); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't these just be auto
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a preference, just trying to clean up some of these old types.
linalg::Matrix
for storing gradients.XGBoosterTrainOneIter
for the custom objective. Deprecating theXGBoosterBoostOneIter
The new function can be extended to irregular shape of input gradient by changing the JSON array interface into a dictionary from an array.
Close #9089 .