SHOGUN  3.2.1
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
LinearARDKernel.h
浏览该文件的文档.
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_ */
virtual EKernelType get_kernel_type()
EKernelType
Definition: Kernel.h:51
int32_t index_t
Definition: common.h:60
Linear Kernel with Automatic Relevance Detection.
parameter struct
Definition: Parameter.h:26
virtual void set_weights(SGVector< float64_t > weights)
virtual SGVector< float64_t > get_weights()
EFeatureClass
shogun feature class
Definition: FeatureTypes.h:35
Template class DotKernel is the base class for kernels working on DotFeatures.
Definition: DotKernel.h:29
virtual bool init(CFeatures *l, CFeatures *r)
virtual EFeatureClass get_feature_class()
SGVector< float64_t > m_weights
virtual float64_t get_weight(index_t i)
double float64_t
Definition: common.h:48
EFeatureType
shogun feature type
Definition: FeatureTypes.h:16
virtual float64_t compute(int32_t idx_a, int32_t idx_b)
The class Features is the base class of all feature objects.
Definition: Features.h:62
virtual void set_weight(float64_t w, index_t i)
virtual EFeatureType get_feature_type()
virtual SGMatrix< float64_t > get_parameter_gradient(const TParameter *param, index_t index=-1)
virtual const char * get_name() const

SHOGUN 机器学习工具包 - 项目文档