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-2013 Heiko Strathmann 00008 */ 00009 00010 #ifndef __MMDKERNELSELECTIONCOMB_H_ 00011 #define __MMDKERNELSELECTIONCOMB_H_ 00012 00013 #include <shogun/lib/config.h> 00014 00015 #include <shogun/statistics/MMDKernelSelection.h> 00016 #include <shogun/lib/SGMatrix.h> 00017 #include <shogun/lib/external/libqp.h> 00018 00019 namespace shogun 00020 { 00021 00022 class CLinearTimeMMD; 00023 00028 class CMMDKernelSelectionComb: public CMMDKernelSelection 00029 { 00030 public: 00031 00033 CMMDKernelSelectionComb(); 00034 00040 CMMDKernelSelectionComb(CKernelTwoSampleTestStatistic* mmd); 00041 00043 virtual ~CMMDKernelSelectionComb(); 00044 00045 #ifdef HAVE_LAPACK 00046 00050 virtual SGVector<float64_t> compute_measures()=0; 00051 #else 00052 00057 virtual SGVector<float64_t> compute_measures(); 00058 #endif 00059 00065 virtual CKernel* select_kernel(); 00066 00068 const char* get_name() const=0; 00069 00070 protected: 00083 virtual SGVector<float64_t> solve_optimization(SGVector<float64_t> mmds); 00084 00085 #ifdef HAVE_LAPACK 00086 00087 static const float64_t* get_Q_col(uint32_t i); 00088 00090 static void print_state(libqp_state_T state); 00091 00093 index_t m_opt_max_iterations; 00094 00096 float64_t m_opt_epsilon; 00097 00099 float64_t m_opt_low_cut; 00100 00102 static SGMatrix<float64_t> m_Q; 00103 #endif 00104 00105 private: 00107 void init(); 00108 }; 00109 00110 } 00111 00112 #endif /* __MMDKERNELSELECTIONCOMB_H_ */