qn.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021-2022, 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 #pragma once
17 
18 #include <stdbool.h>
19 
20 #ifdef __cplusplus
21 namespace ML::GLM {
22 
23 extern "C" {
24 #endif
25 
61  QN_LOSS_UNKNOWN = 99
62 };
63 #ifndef __cplusplus
64 typedef enum qn_loss_type qn_loss_type;
65 #endif
66 
67 struct qn_params {
71  double penalty_l1;
73  double penalty_l2;
75  double grad_tol;
77  double change_tol;
79  int max_iter;
85  int verbose;
97 
98 #ifdef __cplusplus
99  qn_params()
100  : loss(QN_LOSS_UNKNOWN),
101  penalty_l1(0),
102  penalty_l2(0),
103  grad_tol(1e-4),
104  change_tol(1e-5),
105  max_iter(1000),
106  linesearch_max_iter(50),
107  lbfgs_memory(5),
108  verbose(0),
109  fit_intercept(true),
110  penalty_normalized(true)
111  {
112  }
113 #endif
114 };
115 
116 #ifndef __cplusplus
117 typedef struct qn_params qn_params;
118 #endif
119 
120 #ifdef __cplusplus
121 }
122 }
123 #endif
Definition: glm.hpp:23
struct qn_params qn_params
Definition: qn.h:117
qn_loss_type
Definition: qn.h:27
@ QN_LOSS_UNKNOWN
Definition: qn.h:61
@ QN_LOSS_SOFTMAX
Definition: qn.h:39
@ QN_LOSS_SVR_L1
Definition: qn.h:51
@ QN_LOSS_SQUARED
Definition: qn.h:35
@ QN_LOSS_SVR_L2
Definition: qn.h:55
@ QN_LOSS_SVC_L1
Definition: qn.h:43
@ QN_LOSS_ABS
Definition: qn.h:59
@ QN_LOSS_SVC_L2
Definition: qn.h:47
@ QN_LOSS_LOGISTIC
Definition: qn.h:31
Definition: qn.h:67
bool fit_intercept
Definition: qn.h:87
int lbfgs_memory
Definition: qn.h:83
double grad_tol
Definition: qn.h:75
bool penalty_normalized
Definition: qn.h:96
double penalty_l1
Definition: qn.h:71
qn_loss_type loss
Definition: qn.h:69
int verbose
Definition: qn.h:85
double change_tol
Definition: qn.h:77
int max_iter
Definition: qn.h:79
double penalty_l2
Definition: qn.h:73
int linesearch_max_iter
Definition: qn.h:81