Implement slope for Pseduo-Huber. (#7727)

* Add objective and metric.
* Some refactoring for CPU/GPU dispatching using linalg module.
This commit is contained in:
Jiaming Yuan
2022-03-14 21:42:38 +08:00
committed by GitHub
parent 4dafb5fac8
commit 98d6faefd6
28 changed files with 456 additions and 290 deletions

View File

@@ -430,8 +430,8 @@ TEST(Learner, MultiTarget) {
size_t constexpr kRows{128}, kCols{10}, kTargets{3};
auto m = RandomDataGenerator{kRows, kCols, 0}.GenerateDMatrix();
m->Info().labels.Reshape(kRows, kTargets);
linalg::ElementWiseKernelHost(m->Info().labels.HostView(), omp_get_max_threads(),
[](auto i, auto) { return i; });
linalg::ElementWiseTransformHost(m->Info().labels.HostView(), omp_get_max_threads(),
[](auto i, auto) { return i; });
{
std::unique_ptr<Learner> learner{Learner::Create({m})};