qn.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2021-2022, NVIDIA CORPORATION.
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 #pragma once
6 
7 #include <stdbool.h>
8 
9 #ifdef __cplusplus
10 namespace ML::GLM {
11 
12 extern "C" {
13 #endif
14 
50  QN_LOSS_UNKNOWN = 99
51 };
52 #ifndef __cplusplus
53 typedef enum qn_loss_type qn_loss_type;
54 #endif
55 
56 struct qn_params {
60  double penalty_l1;
62  double penalty_l2;
64  double grad_tol;
66  double change_tol;
68  int max_iter;
74  int verbose;
86 
87 #ifdef __cplusplus
88  qn_params()
89  : loss(QN_LOSS_UNKNOWN),
90  penalty_l1(0),
91  penalty_l2(0),
92  grad_tol(1e-4),
93  change_tol(1e-5),
94  max_iter(1000),
95  linesearch_max_iter(50),
96  lbfgs_memory(5),
97  verbose(0),
98  fit_intercept(true),
99  penalty_normalized(true)
100  {
101  }
102 #endif
103 };
104 
105 #ifndef __cplusplus
106 typedef struct qn_params qn_params;
107 #endif
108 
109 #ifdef __cplusplus
110 }
111 }
112 #endif
Definition: glm.hpp:12
struct qn_params qn_params
Definition: qn.h:106
qn_loss_type
Definition: qn.h:16
@ QN_LOSS_UNKNOWN
Definition: qn.h:50
@ QN_LOSS_SOFTMAX
Definition: qn.h:28
@ QN_LOSS_SVR_L1
Definition: qn.h:40
@ QN_LOSS_SQUARED
Definition: qn.h:24
@ QN_LOSS_SVR_L2
Definition: qn.h:44
@ QN_LOSS_SVC_L1
Definition: qn.h:32
@ QN_LOSS_ABS
Definition: qn.h:48
@ QN_LOSS_SVC_L2
Definition: qn.h:36
@ QN_LOSS_LOGISTIC
Definition: qn.h:20
Definition: qn.h:56
bool fit_intercept
Definition: qn.h:76
int lbfgs_memory
Definition: qn.h:72
double grad_tol
Definition: qn.h:64
bool penalty_normalized
Definition: qn.h:85
double penalty_l1
Definition: qn.h:60
qn_loss_type loss
Definition: qn.h:58
int verbose
Definition: qn.h:74
double change_tol
Definition: qn.h:66
int max_iter
Definition: qn.h:68
double penalty_l2
Definition: qn.h:62
int linesearch_max_iter
Definition: qn.h:70