SHOGUN  5.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
MKLMulticlassGradient.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) 2009 Alexander Binder
8  * Copyright (C) 2009 Fraunhofer Institute FIRST and Max-Planck-Society
9  *
10  * Update to patch 0.10.0 - thanks to Eric aka Yoo (thereisnoknife@gmail.com)
11  *
12  */
13 
14 #ifndef MKLMulticlassGRADIENT_H_
15 #define MKLMulticlassGRADIENT_H_
16 
17 #include <shogun/lib/config.h>
18 
19 #include <shogun/base/SGObject.h>
21 
22 
23 namespace shogun
24 {
31 {
32 public:
40  virtual ~MKLMulticlassGradient();
41 
46 
51 
58  virtual void setup(const int32_t numkernels2);
59 
68  virtual void addconstraint(const ::std::vector<float64_t> & normw2,
69  const float64_t sumofpositivealphas);
70 
76  virtual void computeweights(std::vector<float64_t> & weights2);
77 
79  virtual const char* get_name() const { return "MKLMulticlassGradient"; }
80 
84  virtual void set_mkl_norm(float64_t norm);
85 
86 protected:
93  void linesearch2(std::vector<float64_t> & finalbeta,const std::vector<float64_t> & oldweights);
94 
101  void genbetas( ::std::vector<float64_t> & weights ,const ::std::vector<float64_t> & gammas);
102 
110  void gengammagradient( ::std::vector<float64_t> & gammagradient ,const ::std::vector<float64_t> & gammas,const int32_t dim);
111 
118  float64_t objectives(const ::std::vector<float64_t> & weights, const int32_t index);
119 
126  void linesearch(std::vector<float64_t> & finalbeta,const std::vector<float64_t> & oldweights);
127 
128 protected:
130  int32_t numkernels;
131 
132 
134  ::std::vector< ::std::vector<float64_t> > normsofsubkernels;
136  ::std::vector< float64_t > sumsofalphas ;
139 };
140 }
141 
142 #endif
virtual void addconstraint(const ::std::vector< float64_t > &normw2, const float64_t sumofpositivealphas)
void linesearch(std::vector< float64_t > &finalbeta, const std::vector< float64_t > &oldweights)
::std::vector< ::std::vector< float64_t > > normsofsubkernels
virtual void computeweights(std::vector< float64_t > &weights2)
void genbetas(::std::vector< float64_t > &weights, const ::std::vector< float64_t > &gammas)
double float64_t
Definition: common.h:50
MKLMulticlassOptimizationBase is a helper class for MKLMulticlass.
void gengammagradient(::std::vector< float64_t > &gammagradient, const ::std::vector< float64_t > &gammas, const int32_t dim)
virtual void set_mkl_norm(float64_t norm)
virtual void setup(const int32_t numkernels2)
float64_t objectives(const ::std::vector< float64_t > &weights, const int32_t index)
virtual const char * get_name() const
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
MKLMulticlassGradient operator=(MKLMulticlassGradient &gl)
::std::vector< float64_t > sumsofalphas
void linesearch2(std::vector< float64_t > &finalbeta, const std::vector< float64_t > &oldweights)
MKLMulticlassGradient is a helper class for MKLMulticlass.

SHOGUN Machine Learning Toolbox - Documentation