Loading [MathJax]/extensions/tex2jax.js
cuML C++ API  23.12
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
qn_mg.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2023, NVIDIA CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include <cuda_runtime.h>
18 #include <cuml/common/logger.hpp>
19 #include <cuml/linear_model/qn.h>
20 #include <raft/core/comms.hpp>
21 
22 #include <cumlprims/opg/matrix/data.hpp>
23 #include <cumlprims/opg/matrix/part_descriptor.hpp>
24 #include <vector>
25 using namespace MLCommon;
26 
27 namespace ML {
28 namespace GLM {
29 namespace opg {
30 
38 std::vector<float> getUniquelabelsMG(const raft::handle_t& handle,
39  Matrix::PartDescriptor& input_desc,
40  std::vector<Matrix::Data<float>*>& labels);
41 
55 void qnFit(raft::handle_t& handle,
56  std::vector<Matrix::Data<float>*>& input_data,
57  Matrix::PartDescriptor& input_desc,
58  std::vector<Matrix::Data<float>*>& labels,
59  float* coef,
60  const qn_params& pams,
61  bool X_col_major,
62  int n_classes,
63  float* f,
64  int* num_iters);
65 
84 void qnFitSparse(raft::handle_t& handle,
85  std::vector<Matrix::Data<float>*>& input_values,
86  int* input_cols,
87  int* input_row_ids,
88  int X_nnz,
89  Matrix::PartDescriptor& input_desc,
90  std::vector<Matrix::Data<float>*>& labels,
91  float* coef,
92  const qn_params& pams,
93  int n_classes,
94  float* f,
95  int* num_iters);
96 
97 }; // namespace opg
98 }; // namespace GLM
99 }; // namespace ML
Definition: kernelparams.h:21
void qnFit(raft::handle_t &handle, std::vector< Matrix::Data< float > * > &input_data, Matrix::PartDescriptor &input_desc, std::vector< Matrix::Data< float > * > &labels, float *coef, const qn_params &pams, bool X_col_major, int n_classes, float *f, int *num_iters)
performs MNMG fit operation for the logistic regression using quasi newton methods
void qnFitSparse(raft::handle_t &handle, std::vector< Matrix::Data< float > * > &input_values, int *input_cols, int *input_row_ids, int X_nnz, Matrix::PartDescriptor &input_desc, std::vector< Matrix::Data< float > * > &labels, float *coef, const qn_params &pams, int n_classes, float *f, int *num_iters)
support sparse vectors (Compressed Sparse Row format) for MNMG logistic regression fit using quasi ne...
std::vector< float > getUniquelabelsMG(const raft::handle_t &handle, Matrix::PartDescriptor &input_desc, std::vector< Matrix::Data< float > * > &labels)
Calculate unique class labels across multiple GPUs in a multi-node environment.
Definition: dbscan.hpp:27
Definition: qn.h:67