SHOGUN  3.2.1
 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 <shogun/lib/config.h>
17 
18 #include <stdlib.h>
19 #include <shogun/lib/SGMatrix.h>
20 #include <shogun/lib/SGVector.h>
21 
22 namespace shogun
23 {
24 
25 #ifndef DOXYGEN_SHOULD_SKIP_THIS
26 IGNORE_IN_CLASSLIST enum slep_mode
27 {
28  MULTITASK_GROUP,
29  MULTITASK_TREE,
30  FEATURE_GROUP,
31  FEATURE_TREE,
32  PLAIN,
33  FUSED
34 };
35 
36 IGNORE_IN_CLASSLIST enum slep_loss
37 {
38  LOGISTIC,
39  LEAST_SQUARES
40 };
41 
42 IGNORE_IN_CLASSLIST struct slep_result_t
43 {
44  SGMatrix<double> w;
45  SGVector<double> c;
46 
47  slep_result_t(SGMatrix<double> w_, SGVector<double> c_)
48  {
49  w = w_;
50  c = c_;
51  }
52 };
53 
54 IGNORE_IN_CLASSLIST struct slep_options
55 {
56  bool general;
57  int termination;
58  double tolerance;
59  int max_iter;
60  int restart_num;
61  int n_nodes;
62  int n_tasks;
63  int regularization;
64  int n_feature_blocks;
65  int* ind;
66  double rsL2;
67  double* ind_t;
68  double* G;
69  double* gWeight;
70  double q;
71  SGVector<index_t>* tasks_indices;
72  slep_loss loss;
73  slep_mode mode;
74  slep_result_t* last_result;
75 
76  static slep_options default_options()
77  {
78  slep_options opts;
79  opts.general = false;
80  opts.termination = 0;
81  opts.tolerance = 1e-3;
82  opts.max_iter = 1000;
83  opts.restart_num = 100;
84  opts.regularization = 0;
85  opts.q = 2.0;
86  opts.gWeight = NULL;
87  opts.ind = NULL;
88  opts.ind_t = NULL;
89  opts.G = NULL;
90  opts.rsL2 = 0.0;
91  opts.last_result = NULL;
92  opts.tasks_indices = NULL;
93  opts.loss = LOGISTIC;
94  opts.mode = MULTITASK_GROUP;
95  return opts;
96  }
97 };
98 #endif
99 }
100 #endif /* ----- #ifndef SLEP_OPTIONS_H_ ----- */

SHOGUN Machine Learning Toolbox - Documentation