SHOGUN  4.1.0
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
HomogeneousKernelMap.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  * Written (W) 2012 Viktor Gal
8  * Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson.
9  */
10 
11 #ifndef _CHOMOGENEOUKERNELMAP__H__
12 #define _CHOMOGENEOUKERNELMAP__H__
13 
14 #include <shogun/lib/config.h>
15 
18 #include <shogun/lib/common.h>
19 
20 
21 namespace shogun
22 {
28  };
29 
34  };
35 
55  class CHomogeneousKernelMap : public CDensePreprocessor<float64_t>
56  {
57  public:
60 
70  float64_t gamma = 1.0, uint64_t order = 1, float64_t period = -1);
71 
73  virtual ~CHomogeneousKernelMap();
74 
76  virtual bool init(CFeatures* features);
77 
79  virtual void cleanup();
80 
86 
92 
94  virtual const char* get_name() const { return "HomogeneousKernelMap"; }
95 
98 
107 
116 
120  void set_gamma(float64_t g);
124  float64_t get_gamma(float64_t g) const;
125 
129  void set_order(uint64_t o);
133  uint64_t get_order() const;
134 
138  void set_period(float64_t p);
142  float64_t get_period() const;
143 
144  private:
145  void init ();
146  void register_params ();
147  inline float64_t get_smooth_spectrum (float64_t omega) const;
148  inline float64_t sinc (float64_t x) const;
149  inline float64_t get_spectrum (float64_t omega) const;
150  SGVector<float64_t> apply_to_vector(const SGVector<float64_t>& in_v) const;
151 
152  private:
153  HomogeneousKernelType m_kernel;
155  float64_t m_gamma;
156  float64_t m_period;
157  uint64_t m_numSubdivisions;
158  float64_t m_subdivision;
159  uint64_t m_order;
160  int64_t m_minExponent;
161  int64_t m_maxExponent;
162  SGVector<float64_t> m_table;
163  };
164 }
165 #endif /* _CHOMOGENEOUKERNELMAP__H__ */
EPreprocessorType
Definition: Preprocessor.h:32
virtual const char * get_name() const
void set_window_type(HomogeneousKernelMapWindowType w)
Template class DensePreprocessor, base class for preprocessors (cf. CPreprocessor) that apply to CDen...
double float64_t
Definition: common.h:50
HomogeneousKernelMapWindowType
Type of spectral windowing function.
HomogeneousKernelMapWindowType get_window_type() const
HomogeneousKernelType
Type of kernel.
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
virtual EPreprocessorType get_type() const
Preprocessor HomogeneousKernelMap performs homogeneous kernel maps as described in.
The class Features is the base class of all feature objects.
Definition: Features.h:68
virtual bool init(CFeatures *features)
void set_kernel_type(HomogeneousKernelType k)
float64_t get_gamma(float64_t g) const
virtual SGVector< float64_t > apply_to_feature_vector(SGVector< float64_t > vector)
apply preproc on single feature vector
virtual SGMatrix< float64_t > apply_to_feature_matrix(CFeatures *features)
HomogeneousKernelType get_kernel_type() const

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