SHOGUN  v3.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LinearARDKernel.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  * (W) 2012 Jacob Walker
8  *
9  * Adapted from WeightedDegreeRBFKernel.h
10  */
11 
12 #ifndef LINEARARDKERNEL_H_
13 #define LINEARARDKERNEL_H_
14 
15 #include <shogun/lib/common.h>
18 
19 namespace shogun
20 {
21 
24 {
25 public:
28 
33  CLinearARDKernel(int32_t size);
34 
42  int32_t size=10);
43 
44  virtual ~CLinearARDKernel();
45 
52  virtual bool init(CFeatures* l, CFeatures* r);
53 
58  virtual EKernelType get_kernel_type() { return K_LINEARARD; }
59 
64  virtual const char* get_name() const { return "LinearARDKernel"; }
65 
70  virtual EFeatureClass get_feature_class() { return C_DENSE; }
71 
76  virtual EFeatureType get_feature_type() { return F_DREAL; }
77 
83  virtual void set_weight(float64_t w, index_t i);
84 
91  virtual float64_t get_weight(index_t i);
92 
95 
100  virtual void set_weights(SGVector<float64_t> weights) { m_weights=weights; }
101 
102 protected:
111  virtual float64_t compute(int32_t idx_a, int32_t idx_b);
112 
117  void init_ft_weights();
118 
127  index_t index=-1);
128 
129 private:
130  void init();
131 
132 protected:
135 };
136 }
137 #endif /* LINEARARDKERNEL_H_ */

SHOGUN Machine Learning Toolbox - Documentation