Loading [MathJax]/extensions/tex2jax.js
cuML C++ API  24.04
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-2024, 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 <cuml/common/logger.hpp>
18 #include <cuml/linear_model/qn.h>
19 
20 #include <cumlprims/opg/matrix/data.hpp>
21 #include <cumlprims/opg/matrix/part_descriptor.hpp>
22 #include <raft/core/comms.hpp>
23 
24 #include <cuda_runtime.h>
25 
26 #include <vector>
27 using namespace MLCommon;
28 
29 namespace ML {
30 namespace GLM {
31 namespace opg {
32 
40 std::vector<float> getUniquelabelsMG(const raft::handle_t& handle,
41  Matrix::PartDescriptor& input_desc,
42  std::vector<Matrix::Data<float>*>& labels);
43 
58 void qnFit(raft::handle_t& handle,
59  std::vector<Matrix::Data<float>*>& input_data,
60  Matrix::PartDescriptor& input_desc,
61  std::vector<Matrix::Data<float>*>& labels,
62  float* coef,
63  const qn_params& pams,
64  bool X_col_major,
65  bool standardization,
66  int n_classes,
67  float* f,
68  int* num_iters);
69 
89 void qnFitSparse(raft::handle_t& handle,
90  std::vector<Matrix::Data<float>*>& input_values,
91  int* input_cols,
92  int* input_row_ids,
93  int X_nnz,
94  Matrix::PartDescriptor& input_desc,
95  std::vector<Matrix::Data<float>*>& labels,
96  float* coef,
97  const qn_params& pams,
98  bool standardization,
99  int n_classes,
100  float* f,
101  int* num_iters);
102 
103 }; // namespace opg
104 }; // namespace GLM
105 }; // namespace ML
Definition: kernelparams.h:21
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, bool standardization, 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.
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, bool standardization, int n_classes, float *f, int *num_iters)
performs MNMG fit operation for the logistic regression using quasi newton methods
Definition: dbscan.hpp:30
Definition: qn.h:67