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

SHOGUN Machine Learning Toolbox - Documentation