Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef SHAREBOOSTOPTIMIZER_H__
00012 #define SHAREBOOSTOPTIMIZER_H__
00013
00014 #include <shogun/multiclass/ShareBoost.h>
00015
00016 namespace shogun
00017 {
00018
00020 class ShareBoostOptimizer
00021 {
00022 public:
00024 ShareBoostOptimizer(CShareBoost *sb, bool verbose=false)
00025 :m_sb(sb), m_verbose(verbose) { SG_REF(m_sb); }
00027 ~ShareBoostOptimizer() { SG_UNREF(m_sb); }
00028
00030 void optimize();
00031 private:
00033 static float64_t lbfgs_evaluate(void *userdata, const float64_t *W, float64_t *grad, const int32_t n, const float64_t step);
00034
00036 static int lbfgs_progress(
00037 void *instance,
00038 const float64_t *x,
00039 const float64_t *g,
00040 const float64_t fx,
00041 const float64_t xnorm,
00042 const float64_t gnorm,
00043 const float64_t step,
00044 int n,
00045 int k,
00046 int ls
00047 );
00048
00049 CShareBoost *m_sb;
00050 bool m_verbose;
00051 };
00052
00053 }
00054
00055 #endif
00056