SHOGUN
v3.2.0
|
00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License as published by 00004 * the Free Software Foundation; either version 3 of the License, or 00005 * (at your option) any later version. 00006 * 00007 * Written (W) 2012 Sergey Lisitsyn 00008 * Copyright (C) 2012 Sergey Lisitsyn 00009 */ 00010 00011 #ifndef SLEP_OPTIONS_H_ 00012 #define SLEP_OPTIONS_H_ 00013 00014 #define IGNORE_IN_CLASSLIST 00015 00016 #include <stdlib.h> 00017 #include <shogun/lib/SGMatrix.h> 00018 #include <shogun/lib/SGVector.h> 00019 00020 namespace shogun 00021 { 00022 00023 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00024 IGNORE_IN_CLASSLIST enum slep_mode 00025 { 00026 MULTITASK_GROUP, 00027 MULTITASK_TREE, 00028 FEATURE_GROUP, 00029 FEATURE_TREE, 00030 PLAIN, 00031 FUSED 00032 }; 00033 00034 IGNORE_IN_CLASSLIST enum slep_loss 00035 { 00036 LOGISTIC, 00037 LEAST_SQUARES 00038 }; 00039 00040 IGNORE_IN_CLASSLIST struct slep_result_t 00041 { 00042 SGMatrix<double> w; 00043 SGVector<double> c; 00044 00045 slep_result_t(SGMatrix<double> w_, SGVector<double> c_) 00046 { 00047 w = w_; 00048 c = c_; 00049 } 00050 }; 00051 00052 IGNORE_IN_CLASSLIST struct slep_options 00053 { 00054 bool general; 00055 int termination; 00056 double tolerance; 00057 int max_iter; 00058 int restart_num; 00059 int n_nodes; 00060 int n_tasks; 00061 int regularization; 00062 int n_feature_blocks; 00063 int* ind; 00064 double rsL2; 00065 double* ind_t; 00066 double* G; 00067 double* gWeight; 00068 double q; 00069 SGVector<index_t>* tasks_indices; 00070 slep_loss loss; 00071 slep_mode mode; 00072 slep_result_t* last_result; 00073 00074 static slep_options default_options() 00075 { 00076 slep_options opts; 00077 opts.general = false; 00078 opts.termination = 0; 00079 opts.tolerance = 1e-3; 00080 opts.max_iter = 1000; 00081 opts.restart_num = 100; 00082 opts.regularization = 0; 00083 opts.q = 2.0; 00084 opts.gWeight = NULL; 00085 opts.ind = NULL; 00086 opts.ind_t = NULL; 00087 opts.G = NULL; 00088 opts.rsL2 = 0.0; 00089 opts.last_result = NULL; 00090 opts.tasks_indices = NULL; 00091 opts.loss = LOGISTIC; 00092 opts.mode = MULTITASK_GROUP; 00093 return opts; 00094 } 00095 }; 00096 #endif 00097 } 00098 #endif /* ----- #ifndef SLEP_OPTIONS_H_ ----- */