-
-
Notifications
You must be signed in to change notification settings - Fork 1k
/
slep_options.h
104 lines (91 loc) · 1.86 KB
/
slep_options.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* Written (W) 2012 Sergey Lisitsyn
* Copyright (C) 2012 Sergey Lisitsyn
*/
#ifndef SLEP_OPTIONS_H_
#define SLEP_OPTIONS_H_
#define IGNORE_IN_CLASSLIST
#include <shogun/lib/config.h>
#ifdef USE_GPL_SHOGUN
#include <stdlib.h>
#include <shogun/lib/SGMatrix.h>
#include <shogun/lib/SGVector.h>
namespace shogun
{
#ifndef DOXYGEN_SHOULD_SKIP_THIS
IGNORE_IN_CLASSLIST enum slep_mode
{
MULTITASK_GROUP,
MULTITASK_TREE,
FEATURE_GROUP,
FEATURE_TREE,
PLAIN,
FUSED
};
IGNORE_IN_CLASSLIST enum slep_loss
{
LOGISTIC,
LEAST_SQUARES
};
IGNORE_IN_CLASSLIST struct slep_result_t
{
SGMatrix<double> w;
SGVector<double> c;
slep_result_t(SGMatrix<double> w_, SGVector<double> c_)
{
w = w_;
c = c_;
}
};
IGNORE_IN_CLASSLIST struct slep_options
{
bool general;
int termination;
double tolerance;
int max_iter;
int restart_num;
int n_nodes;
int n_tasks;
int regularization;
int n_feature_blocks;
int* ind;
double rsL2;
double* ind_t;
double* G;
double* gWeight;
double q;
SGVector<index_t>* tasks_indices;
slep_loss loss;
slep_mode mode;
slep_result_t* last_result;
static slep_options default_options()
{
slep_options opts;
opts.general = false;
opts.termination = 0;
opts.tolerance = 1e-3;
opts.max_iter = 1000;
opts.restart_num = 100;
opts.regularization = 0;
opts.q = 2.0;
opts.gWeight = NULL;
opts.ind = NULL;
opts.ind_t = NULL;
opts.G = NULL;
opts.rsL2 = 0.0;
opts.last_result = NULL;
opts.tasks_indices = NULL;
opts.loss = LOGISTIC;
opts.mode = MULTITASK_GROUP;
return opts;
}
};
#endif
}
#endif //USE_GPL_SHOGUN
#endif /* ----- #ifndef SLEP_OPTIONS_H_ ----- */